libSUFR
a LIBrary of Some Useful Fortran Routines
Loading...
Searching...
No Matches
sufr_statistics Module Reference

Procedures to do statistics. More...

Functions/Subroutines

real(double) function median (data, mask)
 Compute the median of a data array.
 
real function median_sp (data, mask)
 Compute the median of a data array - single-precision wrapper for median()
 
real(double) function mean (data, mask)
 Compute the mean of a data array.
 
real function mean_sp (data, mask)
 Compute the mean of a data array - single-precision wrapper for mean()
 
real(double) function mean_weight (data, wgts, mask)
 Compute the weighted mean of a data array.
 
real(double) function stdev (data, dmean, mask, var)
 Compute the standard deviation of a data array with mean 'mean'.
 
real function stdev_sp (data, mean, mask)
 Compute the standard deviation of a data array with mean 'mean' - single-precision wrapper for stDev()
 
real(double) function stdev_weight (data, wgts, wmean, mask)
 Compute the weighted standard deviation of a data array with weighted mean 'wMean'.
 
pure subroutine mean_var_running (mean, var, data, num, stdev)
 Compute a running mean and variance by adding a data point and the data point number to existing values. If num=1, initialise. Note that mean and var are I/O variables and cannot be dummy variables or values. Num must be accurate, and increased by one between calls by the user. Optionally, return the standard deviation.
 
subroutine prob_range (data, range, llim, ulim, mask)
 Find a given probability range for a data array - the narrowest range that contains a given fraction of data points.
 
subroutine prob_range_sp (data, range, llim, ulim, mask)
 Find a given probability range for a data array - the narrowest range that contains a given fraction of data points - single-precision wrapper for prob_range()
 
pure integer function determine_nbin_1d (npoints)
 Roughly estimate the number of 1D bins needed, from the number of data points.
 
subroutine bin_data_1d (xdat, nbin, norm, mode, cumul, xmin, xmax, xbin, ybin)
 Bin data in 1D bins by counting the number of data points in each bin.
 
subroutine bin_data_1d_sp (xdat, nbin, norm, mode, cumul, xmin, xmax, xbin, ybin)
 Bin data in 1D bins by counting the number of data points in each bin - single-precision wrapper for bin_data_1d()
 
pure subroutine histogram_1d_onthefly (xdat, nbin, mode, cumul, xmin, xmax, xbin, ybin, init, weight)
 Create a 1D histogram on the fly (point by point). Bin data points by computing the bin they should be in.
 
subroutine bin_data_2d (xdat, ydat, norm, nxbin, nybin, xmin, xmax, ymin, ymax, z, tr, weights)
 Bin data in 2 dimensions - computing the bin number rather than searching for it is ~10x faster.
 
subroutine bin_data_2d_sp (xdat, ydat, norm, nxbin, nybin, xmin, xmax, ymin, ymax, z, tr, weights)
 Bin data in 2 dimensions - single-precision wrapper for bin_data_2d()
 
subroutine histogram_2d_onthefly (xdat, ydat, nxbin, nybin, xmin, xmax, ymin, ymax, z, init, weight, tr)
 Bin data in 2 dimensions - computing the bin number rather than searching for it is ~10x faster.
 
pure integer(long) function faculty_i (n)
 Compute the faculty of an integer, returning a long integer.
 
pure real(double) function faculty (n)
 Compute the faculty of an integer, returning a double-precision real.
 
pure real(double) function binom_coeff (n, k)
 Compute the binomial coefficient of n and k.
 
pure real(double) function binom_prob (n, k, p)
 Compute the binomial probability of n and k, and probability p.
 
pure real(double) function binom_cumul_prob (n, k, p)
 Compute the cumulative binomial probability of n and k OR FEWER, and probability p.
 
pure real(double) function poisson_prob (k, lambda)
 Compute the Poisson probability of EXACTLY k events occurring in a fixed interval for a known average rate lambda, and independently of the time since the last event: P = λ^k e^-λ / k!
 
pure real(double) function poisson_prob_cumul (k, lambda)
 Compute the cumulative Poisson probability of k OR FEWER events occurring in a fixed interval for a known average rate lambda, and independently of the time since the last event: P = Σ(i=0,k) λ^i e^-λ / i!
 
real(double) function correlation (data1, data2)
 Compute the normalised correlation between two data series.
 

Detailed Description

Procedures to do statistics.

Function/Subroutine Documentation

◆ bin_data_1d()

subroutine sufr_statistics::bin_data_1d ( real(double), dimension(:), intent(in) xdat,
integer, intent(in) nbin,
logical, intent(in) norm,
integer, intent(in) mode,
logical, intent(in) cumul,
real(double), intent(inout) xmin,
real(double), intent(inout) xmax,
real(double), dimension(:), intent(inout) xbin,
real(double), dimension(:), intent(inout) ybin )

Bin data in 1D bins by counting the number of data points in each bin.

Parameters
xDatData to be binned (ndat points)
NbinDesired number of bins. Note that the binned-data arrays xbin and ybin must have size >= Nbin+1
normNormalise histogram (T) or not (F)
modeMode: -1: xbin is left of bin, 0: xbin is centre of bin, 1: xbin is right of bin
cumulMake a cumulative histogram (T/F)
xMinMinimum value of the binning range. Set xMin=xMax to auto-determine (I/O)
xMaxMaximum value of the binning range. Set xMin=xMax to auto-determine (I/O)
xBinBinned data, location of the bins. The x values are the left side of the bin! (output)
yBinBinned data, height of the bins. I/O so that the array size can be checked (output)

Definition at line 596 of file statistics.f90.

References sufr_kinds::double, and sufr_system::quit_program_error().

Referenced by bin_data_1d_sp().

Here is the call graph for this function:

◆ bin_data_1d_sp()

subroutine sufr_statistics::bin_data_1d_sp ( real, dimension(:), intent(in) xdat,
integer, intent(in) nbin,
logical, intent(in) norm,
integer, intent(in) mode,
logical, intent(in) cumul,
real, intent(inout) xmin,
real, intent(inout) xmax,
real, dimension(:), intent(inout) xbin,
real, dimension(:), intent(inout) ybin )

Bin data in 1D bins by counting the number of data points in each bin - single-precision wrapper for bin_data_1d()

Parameters
xDatData to be binned (ndat points)
NbinDesired number of bins. Note that the binned-data arrays xBin and yBin must have size >= Nbin+1
normNormalise histogram (T) or not (F)
modeMode: -1: xBin is left of bin, 0: xBin is centre of bin, 1: xBin is right of bin
cumulMake a cumulative histogram (T/F)
xMinMinimum value of the binning range. Set xMin=xMax to auto-determine (I/O)
xMaxMaximum value of the binning range. Set xMin=xMax to auto-determine (I/O)
xBinBinned data, location of the bins. The x values are the left side of the bin! (output)
yBinBinned data, height of the bins. I/O so that the array size can be checked (output)

Definition at line 670 of file statistics.f90.

References bin_data_1d(), sufr_kinds::double, and sufr_system::quit_program_error().

Here is the call graph for this function:

◆ bin_data_2d()

subroutine sufr_statistics::bin_data_2d ( real(double), dimension(:), intent(in) xdat,
real(double), dimension(:), intent(in) ydat,
integer, intent(in) norm,
integer, intent(in) nxbin,
integer, intent(in) nybin,
real(double), intent(inout) xmin,
real(double), intent(inout) xmax,
real(double), intent(inout) ymin,
real(double), intent(inout) ymax,
real(double), dimension(nxbin+1,nybin+1), intent(out) z,
real(double), dimension(6), intent(out) tr,
real(double), dimension(size(xdat)), intent(in), optional weights )

Bin data in 2 dimensions - computing the bin number rather than searching for it is ~10x faster.

Parameters
xDatInput data: x values - array size: ndat
yDatInput data: y values - array size: ndat
normNormalise the bins (1) or not (0)
nxBinDesired number of bins in the x direction
nyBinDesired number of bins in the y direction
xMinLower limit for the binning range in the x direction - autodetermine if xMin = xMax
xMaxUpper limit for the binning range in the x direction - autodetermine if xMin = xMax
yMinLower limit for the binning range in the y direction - autodetermine if yMin = yMax
yMaxUpper limit for the binning range in the y direction - autodetermine if yMin = yMax
zBinned data set z(nxBin+1,nyBin+1) - this array may be larger than you expect - nbin bins have nbin+1 borders (output)
trTransformation elements for pgplot tr(6) (output)
weightsWeights to use when binning data, same size as xDat,yDat (optional)

Definition at line 804 of file statistics.f90.

References sufr_kinds::double, and sufr_system::quit_program_error().

Referenced by bin_data_2d_sp().

Here is the call graph for this function:

◆ bin_data_2d_sp()

subroutine sufr_statistics::bin_data_2d_sp ( real, dimension(:), intent(in) xdat,
real, dimension(:), intent(in) ydat,
integer, intent(in) norm,
integer, intent(in) nxbin,
integer, intent(in) nybin,
real, intent(inout) xmin,
real, intent(inout) xmax,
real, intent(inout) ymin,
real, intent(inout) ymax,
real, dimension(nxbin+1,nybin+1), intent(out) z,
real, dimension(6), intent(out) tr,
real, dimension(size(xdat)), intent(in), optional weights )

Bin data in 2 dimensions - single-precision wrapper for bin_data_2d()

Parameters
xDatInput data: x values - array size: ndat
yDatInput data: y values - array size: ndat
normNormalise the bins (1) or not (0)
nxBinDesired number of bins in the x direction
nyBinDesired number of bins in the y direction
xMinLower limit for the binning range in the x direction - autodetermine if xMin = xMax
xMaxUpper limit for the binning range in the x direction - autodetermine if xMin = xMax
yMinLower limit for the binning range in the y direction - autodetermine if yMin = yMax
yMaxUpper limit for the binning range in the y direction - autodetermine if yMin = yMax
zBinned data set z(nxBin+1,nyBin+1) - this array may be larger than you expect - nbin bins have nbin+1 borders (output)
trTransformation elements for pgplot tr(6) (output)
weightsWeights to use when binning data, same size as xDat,yDat (optional)

Definition at line 906 of file statistics.f90.

References bin_data_2d(), sufr_kinds::double, and sufr_system::quit_program_error().

Here is the call graph for this function:

◆ binom_coeff()

pure real(double) function sufr_statistics::binom_coeff ( integer, intent(in) n,
integer, intent(in) k )

Compute the binomial coefficient of n and k.

Parameters
nTotal number of trials; n in "n choose k"
kNumber of succesful trials; k in "n choose k"
Return values
binom_coeffBinomial coefficient n! / [k!(n-k)!]
See also
https://en.wikipedia.org/wiki/Binomial_coefficient#Binomial_coefficient_in_programming_languages

Definition at line 1080 of file statistics.f90.

References binom_coeff(), and sufr_kinds::double.

Referenced by binom_coeff(), and binom_prob().

Here is the call graph for this function:

◆ binom_cumul_prob()

pure real(double) function sufr_statistics::binom_cumul_prob ( integer, intent(in) n,
integer, intent(in) k,
real(double), intent(in) p )

Compute the cumulative binomial probability of n and k OR FEWER, and probability p.

Parameters
nTotal number of trials; n in "n choose k"
kNumber of succesful trials OR FEWER; k in "n choose k"
pProbability of a succesful trial
Return values
binom_cumul_probCumulative binomial probability Σ(i=0,k) n! / [i!(n-i)!] * p^i * (1-p)^(n-i)

Definition at line 1140 of file statistics.f90.

References binom_cumul_prob(), binom_prob(), and sufr_kinds::double.

Referenced by binom_cumul_prob().

Here is the call graph for this function:

◆ binom_prob()

pure real(double) function sufr_statistics::binom_prob ( integer, intent(in) n,
integer, intent(in) k,
real(double), intent(in) p )

Compute the binomial probability of n and k, and probability p.

Parameters
nTotal number of trials; n in "n choose k"
kNumber of succesful trials; k in "n choose k"
pProbability of a succesful trial
Return values
binom_probBinomial probability n! / [k!(n-k)!] * p^k * (1-p)^(n-k)

Definition at line 1117 of file statistics.f90.

References binom_coeff(), binom_prob(), and sufr_kinds::double.

Referenced by binom_cumul_prob(), and binom_prob().

Here is the call graph for this function:

◆ correlation()

real(double) function sufr_statistics::correlation ( real(double), dimension(:), intent(in) data1,
real(double), dimension(:), intent(in) data2 )

Compute the normalised correlation between two data series.

Parameters
data1Data series 1
data2Data series 2 - should have the same length as data1
Return values
correlationNormalised correlation [-1,1] between the two data series

Definition at line 1217 of file statistics.f90.

References correlation(), sufr_kinds::double, mean(), and sufr_system::warn().

Referenced by correlation().

Here is the call graph for this function:

◆ determine_nbin_1d()

pure integer function sufr_statistics::determine_nbin_1d ( integer, intent(in) npoints)

Roughly estimate the number of 1D bins needed, from the number of data points.

Parameters
npointsNumber of data points
Return values
determine_nbin_1dNumber of bins

Definition at line 564 of file statistics.f90.

References determine_nbin_1d().

Referenced by determine_nbin_1d().

Here is the call graph for this function:

◆ faculty()

pure real(double) function sufr_statistics::faculty ( integer, intent(in) n)

Compute the faculty of an integer, returning a double-precision real.

Parameters
nNumber - can be up to 170 for double-precision reals (as opposed to 20 for long integers and 13 for integers)
Return values
facultyFaculty of n; n! (double-precision real)

Definition at line 1055 of file statistics.f90.

References sufr_kinds::double, and faculty().

Referenced by faculty(), and poisson_prob().

Here is the call graph for this function:

◆ faculty_i()

pure integer(long) function sufr_statistics::faculty_i ( integer, intent(in) n)

Compute the faculty of an integer, returning a long integer.

Parameters
nNumber - up to 20 for long integers (up to 13 for integers)
Return values
faculty_iFaculty of n; n! - a long integer

Definition at line 1033 of file statistics.f90.

References faculty_i(), and sufr_kinds::long.

Referenced by faculty_i().

Here is the call graph for this function:

◆ histogram_1d_onthefly()

pure subroutine sufr_statistics::histogram_1d_onthefly ( real(double), intent(in) xdat,
integer, intent(in) nbin,
integer, intent(in) mode,
logical, intent(in) cumul,
real(double), intent(in) xmin,
real(double), intent(in) xmax,
real(double), dimension(:), intent(inout) xbin,
real(double), dimension(:), intent(inout) ybin,
logical, intent(in), optional init,
real(double), intent(in), optional weight )

Create a 1D histogram on the fly (point by point). Bin data points by computing the bin they should be in.

Note
Call this routine once to initialise (init=1; set xBin), then call many times to collect data and construct yBin (init=0)
Parameters
xDatData point to be binned
NbinDesired number of bins. Note that the binned-data arrays xBin and yBin must have size >= Nbin+1
modeMode: -1: xBin is left of bin, 0: xBin is centre of bin, 1: xBin is right of bin
cumulMake a cumulative histogram (T/F)
xMinMinimum value of the binning range. Set xMin=xMax to auto-determine (I/O)
xMaxMaximum value of the binning range. Set xMin=xMax to auto-determine (I/O)
xBinBinned data, location of the bins. The x values are the left side of the bin! (output)
yBinBinned data, height of the bins. I/O so that the array size can be checked (output)
initInitialisation call: true/false (data collection). Optional; default=false.
weightAdd weight to the bin, rather than 1. Optional; default=1.

Definition at line 719 of file statistics.f90.

References sufr_kinds::double, and sufr_system::quit_program_error().

Here is the call graph for this function:

◆ histogram_2d_onthefly()

subroutine sufr_statistics::histogram_2d_onthefly ( real(double), intent(in) xdat,
real(double), intent(in) ydat,
integer, intent(in) nxbin,
integer, intent(in) nybin,
real(double), intent(in) xmin,
real(double), intent(in) xmax,
real(double), intent(in) ymin,
real(double), intent(in) ymax,
real(double), dimension(nxbin+1,nybin+1), intent(out) z,
logical, intent(in), optional init,
real(double), intent(in), optional weight,
real(double), dimension(6), intent(out), optional tr )

Bin data in 2 dimensions - computing the bin number rather than searching for it is ~10x faster.

Parameters
xDatInput data point: x value
yDatInput data point: y value
nxBinDesired number of bins in the x direction
nyBinDesired number of bins in the y direction
xMinLower limit for the binning range in the x direction - autodetermine if xMin = xMax
xMaxUpper limit for the binning range in the x direction - autodetermine if xMin = xMax
yMinLower limit for the binning range in the y direction - autodetermine if yMin = yMax
yMaxUpper limit for the binning range in the y direction - autodetermine if yMin = yMax
zBinned data set z(nxBin+1,nyBin+1) - this array may be larger than you expect - nbin bins have nbin+1 borders (output)
initInit mode: true/false (optional)
weightWeight to use when binning data, same size as xDat,yDat (optional)
trTransformation elements for pgplot tr(6) (output; optional)

Definition at line 967 of file statistics.f90.

References sufr_kinds::double, and sufr_system::quit_program_error().

Here is the call graph for this function:

◆ mean()

real(double) function sufr_statistics::mean ( real(double), dimension(:), intent(in) data,
logical, dimension(:), intent(in), optional mask )

Compute the mean of a data array.

Parameters
data1D array of data points
maskMask to apply to data (optional)
Return values
meanThe mean of a data array

Definition at line 119 of file statistics.f90.

References sufr_kinds::double, mean(), sufr_system::quit_program_error(), and sufr_system::warn().

Referenced by correlation(), mean(), mean_sp(), mean_var_running(), stdev(), and stdev_sp().

Here is the call graph for this function:

◆ mean_sp()

real function sufr_statistics::mean_sp ( real, dimension(:), intent(in) data,
logical, dimension(:), intent(in), optional mask )

Compute the mean of a data array - single-precision wrapper for mean()

Parameters
data1D array of data points
maskMask to apply to data (optional)
Return values
mean_spThe mean of a data array

Definition at line 158 of file statistics.f90.

References sufr_kinds::double, mean(), mean_sp(), and sufr_system::quit_program_error().

Referenced by mean_sp().

Here is the call graph for this function:

◆ mean_var_running()

pure subroutine sufr_statistics::mean_var_running ( real(double), intent(inout) mean,
real(double), intent(inout) var,
real(double), intent(in) data,
integer, intent(in) num,
real(double), intent(out), optional stdev )

Compute a running mean and variance by adding a data point and the data point number to existing values. If num=1, initialise. Note that mean and var are I/O variables and cannot be dummy variables or values. Num must be accurate, and increased by one between calls by the user. Optionally, return the standard deviation.

Parameters
meanRunning mean (I/O)
varRunning variance (I/O)
dataNew/current data point
numNumber of the current data point
stDevCurrent standard deviation (output; optional)
See also
https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Na%C3%AFve_algorithm

Definition at line 408 of file statistics.f90.

References sufr_kinds::double, mean(), and stdev().

Here is the call graph for this function:

◆ mean_weight()

real(double) function sufr_statistics::mean_weight ( real(double), dimension(:), intent(in) data,
real(double), dimension(:), intent(in) wgts,
logical, dimension(:), intent(in), optional mask )

Compute the weighted mean of a data array.

Parameters
data1D array of data points
wgtsWeights for all data points
maskMask to apply to data (optional)
Return values
mean_weightThe weighted mean of a data array
See also
https://en.wikipedia.org/wiki/Weighted_arithmetic_mean

Definition at line 196 of file statistics.f90.

References sufr_kinds::double, sufr_system::error(), mean_weight(), and sufr_system::quit_program_error().

Referenced by mean_weight(), and stdev_weight().

Here is the call graph for this function:

◆ median()

real(double) function sufr_statistics::median ( real(double), dimension(:), intent(in) data,
logical, dimension(:), intent(in), optional mask )

Compute the median of a data array.

Parameters
data1D array of data points
maskMask to apply to data (optional)
Return values
medianThe median of a data array

Definition at line 37 of file statistics.f90.

References sufr_kinds::double, median(), sufr_system::quit_program_error(), and sufr_sorting::sorted_index_list().

Referenced by median(), and median_sp().

Here is the call graph for this function:

◆ median_sp()

real function sufr_statistics::median_sp ( real, dimension(:), intent(in) data,
logical, dimension(:), intent(in), optional mask )

Compute the median of a data array - single-precision wrapper for median()

Parameters
data1D array of data points
maskMask to apply to data (optional)
Return values
median_spThe median of a data array

Definition at line 85 of file statistics.f90.

References sufr_kinds::double, median(), median_sp(), and sufr_system::quit_program_error().

Referenced by median_sp().

Here is the call graph for this function:

◆ poisson_prob()

pure real(double) function sufr_statistics::poisson_prob ( integer, intent(in) k,
real(double), intent(in) lambda )

Compute the Poisson probability of EXACTLY k events occurring in a fixed interval for a known average rate lambda, and independently of the time since the last event: P = λ^k e^-λ / k!

Parameters
kNumber of events
lambdaAverage event rate
Return values
poisson_probPoisson probability P = λ^k e^-λ / k!

Definition at line 1167 of file statistics.f90.

References sufr_kinds::double, faculty(), and poisson_prob().

Referenced by poisson_prob(), and poisson_prob_cumul().

Here is the call graph for this function:

◆ poisson_prob_cumul()

pure real(double) function sufr_statistics::poisson_prob_cumul ( integer, intent(in) k,
real(double), intent(in) lambda )

Compute the cumulative Poisson probability of k OR FEWER events occurring in a fixed interval for a known average rate lambda, and independently of the time since the last event: P = Σ(i=0,k) λ^i e^-λ / i!

Parameters
kNumber of events
lambdaAverage event rate
Return values
poisson_prob_cumulCumulative Poisson probability P = Σ(i=0,k) λ^i e^-λ / i!

Definition at line 1191 of file statistics.f90.

References sufr_kinds::double, poisson_prob(), and poisson_prob_cumul().

Referenced by poisson_prob_cumul().

Here is the call graph for this function:

◆ prob_range()

subroutine sufr_statistics::prob_range ( real(double), dimension(:), intent(in) data,
real(double), intent(in) range,
real(double), intent(out) llim,
real(double), intent(out) ulim,
logical, dimension(:), intent(in), optional mask )

Find a given probability range for a data array - the narrowest range that contains a given fraction of data points.

Parameters
data1D array of data points
rangeProbability range - e.g. 0.95 = 95% probability ~ "2-sigma"
llimLower limit of probability range (output)
ulimUpper limit of probability range (output)
maskMask to apply to data (optional)

Definition at line 447 of file statistics.f90.

References sufr_numerics::deq(), sufr_kinds::double, sufr_system::error(), sufr_system::quit_program_error(), sufr_sorting::sorted_index_list(), and sufr_system::warn().

Referenced by prob_range_sp().

Here is the call graph for this function:

◆ prob_range_sp()

subroutine sufr_statistics::prob_range_sp ( real, dimension(:), intent(in) data,
real, intent(in) range,
real, intent(out) llim,
real, intent(out) ulim,
logical, dimension(:), intent(in), optional mask )

Find a given probability range for a data array - the narrowest range that contains a given fraction of data points - single-precision wrapper for prob_range()

Parameters
data1D array of data points
rangeProbability range - e.g. 0.95 = 95% probability ~ "2-sigma"
llimLower limit of probability range (output)
ulimUpper limit of probability range (output)
maskMask to apply to data (optional)

Definition at line 521 of file statistics.f90.

References sufr_kinds::double, prob_range(), sufr_system::quit_program_error(), and sufr_sorting::sorted_index_list().

Here is the call graph for this function:

◆ stdev()

real(double) function sufr_statistics::stdev ( real(double), dimension(:), intent(in) data,
real(double), intent(in), optional dmean,
logical, dimension(:), intent(in), optional mask,
real(double), intent(out), optional var )

Compute the standard deviation of a data array with mean 'mean'.

Parameters
data1D array with data points
dMeanMean of the data points (optional; will be computed if not provided)
maskMask to apply to data (optional)
varVariance of the data (output)
Return values
stDevThe standard deviation
See also
https://en.wikipedia.org/wiki/Standard_deviation

Definition at line 250 of file statistics.f90.

References sufr_kinds::double, sufr_system::error(), mean(), sufr_system::quit_program_error(), and stdev().

Referenced by mean_var_running(), stdev(), and stdev_sp().

Here is the call graph for this function:

◆ stdev_sp()

real function sufr_statistics::stdev_sp ( real, dimension(:), intent(in) data,
real, intent(in) mean,
logical, dimension(:), intent(in), optional mask )

Compute the standard deviation of a data array with mean 'mean' - single-precision wrapper for stDev()

Parameters
data1D array with data points
meanMean of the data points
maskMask to apply to data (optional)
Return values
stDevThe standard deviation

Definition at line 308 of file statistics.f90.

References sufr_kinds::double, mean(), sufr_system::quit_program_error(), stdev(), and stdev_sp().

Referenced by stdev_sp().

Here is the call graph for this function:

◆ stdev_weight()

real(double) function sufr_statistics::stdev_weight ( real(double), dimension(:), intent(in) data,
real(double), dimension(:), intent(in) wgts,
real(double), intent(in), optional wmean,
logical, dimension(:), intent(in), optional mask )

Compute the weighted standard deviation of a data array with weighted mean 'wMean'.

Parameters
data1D array with data points
wgtsWeights for all data points
wMeanWeighted mean of the data points (optional)
maskMask to apply to data (optional)
Return values
stDev_weightThe weighted standard deviation

Definition at line 343 of file statistics.f90.

References sufr_kinds::double, sufr_system::error(), mean_weight(), sufr_system::quit_program_error(), and stdev_weight().

Referenced by stdev_weight().

Here is the call graph for this function: