public class StandardDeviationVisitor extends Object implements FeatureCalc, FeatureAttributeVisitor
---------------------------- | 1 --- Std dev = | ___ \ ( x - mean ) ^ 2 \| N /__aka std dev = sqrt((sum((x-mean)^2))/N) where N is the number of samples.
It uses the rolling variance algorithm described here: http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#On-line_algorithm
Modifier and Type | Class and Description |
---|---|
static class |
StandardDeviationVisitor.Result |
Constructor and Description |
---|
StandardDeviationVisitor(Expression expr)
Constructs a standard deviation visitor based on the specified expression
|
Modifier and Type | Method and Description |
---|---|
Expression |
getExpression() |
List<Expression> |
getExpressions()
List of expressions used by visitor.
|
double |
getMean()
mean value generated when calcualting standard deviation
|
int |
getNaNCount() |
int |
getNullCount() |
CalcResult |
getResult()
Returns the result of the calculation as a handy object which can be merged and modified.
|
Optional<List<Class>> |
getResultType(List<Class> inputTypes)
Returns the expected output type given the input type.
|
void |
init(SimpleFeatureCollection collection) |
void |
reset() |
void |
setValue(Object value) |
void |
visit(Feature feature)
Visit the provided feature.
|
void |
visit(SimpleFeature feature) |
public StandardDeviationVisitor(Expression expr)
public void init(SimpleFeatureCollection collection)
public Expression getExpression()
public void setValue(Object value)
public List<Expression> getExpressions()
FeatureAttributeVisitor
getExpressions
in interface FeatureAttributeVisitor
public Optional<List<Class>> getResultType(List<Class> inputTypes)
FeatureAttributeVisitor
getResultType
in interface FeatureAttributeVisitor
inputTypes
- The type of the input expressionspublic CalcResult getResult()
FeatureCalc
getResult
in interface FeatureCalc
public void visit(SimpleFeature feature)
public void visit(Feature feature)
FeatureVisitor
Please consult the documentation for the FeatureCollection you are visiting to learn more - the provided feature may be invalid, or read only.
visit
in interface FeatureVisitor
public void reset()
public double getMean()
public int getNaNCount()
public int getNullCount()
Copyright © 1996–2022 Geotools. All rights reserved.