Learn R Programming

gmwm (version 2.0.0)

avar: Calculate the Allan Variance

Description

Computes the Allan Variance

Usage

avar(x, type = "mo")

Arguments

x
A vec containing the time series under observation.
type
A string containing either "mo" for Maximal Overlap or "to" for Tau Overlap

Value

Allan variance fixedav A list that contains:
  • "clusters"The size of the cluster
  • "allan"The Allan variance
  • "errors"The error associated with the variance estimation.

Details

The decomposition and the amount of time it takes to perform it depends on whether you are using the Tau Overlap or the Maximal Overlap.

Maximal Overlap Allan Variance Given $N$ equally spaced samples with averaging time $tau = n*tau_0$, where $n$ is an integer such that $1<= n="" <="N/2$." therefore,="" $n$="" is="" able="" to="" be="" selected from="" ${n|n<="" floor(log2(n))}$="" then,="" $m="N" -="" 2n$="" samples="" exist.="" the="" maximal-overlap="" estimator="" given="" by:="" $\frac{1}{{2\left(="" {n="" 2k="" +="" 1}="" \right)}}\sum\limits_{t="2k}^N" {{{\left[="" {{{\bar="" y}_t}\left(="" k="" \right)="" {{\bar="" y}_{t="" k}}\left(="" \right)}="" \right]}^2}}="" $<="" p="">

where $ {{\bar y}_t}\left( \tau \right) = \frac{1}{\tau }\sum\limits_{i = 0}^{\tau - 1} {{{\bar y}_{t - i}}} $.

Tau-Overlap Allan Variance Given $N$ equally spaced samples with averaging time $tau = n*tau_0$, where $n$ is an integer such that $1<= n="" <="N/2$." therefore,="" $n$="" is="" able="" to="" be="" selected from="" ${n|n<="" floor(log2(n))}$="" then,="" a="" sampling="" of="" $m="\left\lfloor" {\frac{{n="" -="" 1}}{n}}="" \right\rfloor="" 1$="" samples="" exist.="" the="" tau-overlap="" estimator="" given="" by:<="" p="">

where $ {{\bar y}_t}\left( \tau \right) = \frac{1}{\tau }\sum\limits_{i = 0}^{\tau - 1} {{{\bar y}_{t - i}}} $.

References

Long-Memory Processes, the Allan Variance and Wavelets, D. B. Percival and P. Guttorp

Examples

Run this code
set.seed(999)
# Simulate white noise (P 1) with sigma^2 = 4
N = 100000
white.noise = rnorm(N, 0, 2)
#plot(white.noise,ylab="Simulated white noise process",xlab="Time",type="o")
#Simulate random walk (P 4)
random.walk = cumsum(0.1*rnorm(N, 0, 2))
combined.ts = white.noise+random.walk
av_mat = avar_mo_cpp(combined.ts)

Run the code above in your browser using DataLab