Learn R Programming

lognorm (version 0.1.6)

varEffective: varEffective

Description

Estimate the variance of a correlated time series

Usage

varEffective(res, nEff = computeEffectiveNumObs(res, 
    na.rm = na.rm), na.rm = FALSE, ...)

Arguments

res

numeric of autocorrelated numbers, usually observation - model residuals

nEff

effective number of observations

na.rm

set to TRUE to remove NA cases before computation

…

further arguments to var

Value

The estimated variance of the sample

Details

The BLUE is not anymore the usual variance, but a modified variance as given in Zieba 2011

Examples

Run this code
# NOT RUN {
# generate autocorrelated time series
res <- stats::filter(rnorm(1000), filter = rep(1,5), circular = TRUE)
res[100:120] <- NA
# if correlations are neglected, the estimate of the variance is biased low
(varNeglectCorr <- var(res, na.rm = TRUE))
(varCorr <- varEffective(res, na.rm = TRUE))
# }

Run the code above in your browser using DataLab