sgsPy
structurally guided sampling
Loading...
Searching...
No Matches

#include <helper.h>

Public Member Functions

void update (double x)
double getMean ()
double getStdev ()
int64_t getCount ()

Detailed Description

This struct contains the intermediate values, as well as functions for updating the intermediate values of the variance of a raster band using Welfords method. The mean and standard deviation of a raster band can be calculated afterwards without requiring the whole raster to be in memory.

Double precision is always used for higher precision of potentially small values.

https://jonisalonen.com/2013/deriving-welfords-method-for-computing-variance/

Member Function Documentation

◆ getCount()

int64_t sgs::helper::Variance::getCount ( )
inline

calculate the total number of pixels.

Returns
itn64_t

◆ getMean()

double sgs::helper::Variance::getMean ( )
inline

getter function for running mean value.

Returns
double

◆ getStdev()

double sgs::helper::Variance::getStdev ( )
inline

calculate the standard deviation using the running variance calculation.

Returns
double

◆ update()

void sgs::helper::Variance::update ( double x)
inline

update the variance calculation with a new value.

Parameters
doublex

The documentation for this class was generated from the following file: