Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
standardization?: boolean;
}): {
moranIndex: number;
expectedMoranIndex: number;
stdNorm: number;
zNorm: number;
} {
const inputField = options.inputField;
const threshold = options.threshold || 100000;
const p = options.p || 2;
const binary = options.binary || false;
const alpha = options.alpha || -1;
const standardization = options.standardization || true;
const weight = spatialWeight(fc, {
threshold,
p,
binary,
alpha,
standardization,
});
const y: number[] = [];
featureEach(fc, (feature) => {
const feaProperties = feature.properties || {};
// validate inputField exists
y.push(feaProperties[inputField]);
});
const yMean = mean(y);
const yVar = variance(y);