sdDiff: sdDiff

View source: R/dataFunctions.R

sdDiffR Documentation

sdDiff

Description

sdDiff is a function based on the difference operator (or difference order for HALL method) estimating the time-series standard deviation. The estimation works for time-series generated by Gaussian random variables with constant standard deviation and multiple changes in mean. Three estimators are available:

  • HALL : the so-called HALL-estimator of order 3. For more details see: (1990) Asymptotically optimal difference-based estimation of variance in nonparametric regression. Authors: Hall, Peter and Kay, JW and Titterinton, DM. Biometrika, pages 521–528

  • MAD : the median absolute deviation estimator computed on diff(x)/sqrt(2) with x the vector of datapoints

  • SD : the standard deviation estimator (function sd) computed on diff(x)/sqrt(2) with x the vector of datapoints

Usage

sdDiff(x, method = "HALL")

Arguments

x

vector of datapoints

method

Three available methods: "HALL", "MAD" and "SD"

Value

a value equal to the estimated standard deviation

Examples

data <- dataGenerator(300, seq(0.1,1,0.1), sample(10), sigma = 2)
sdDiff(data, method = "HALL")
sdDiff(data, method = "MAD")
sdDiff(data, method = "SD")

gfpop documentation built on April 1, 2023, 12:22 a.m.