avar: Compute the Empirical Allan Variance

View source: R/avar.r

avarR Documentation

Compute the Empirical Allan Variance

Description

This function estimates the Allan variance.

Usage

avar(x, type = "mo", ...)

## Default S3 method:
avar(x, type = "mo", freq = 1, ...)

## S3 method for class 'imu'
avar(x, type = "mo", ...)

Arguments

x

A vec of time series observations or an imu object.

type

A string containing either "mo" for Maximal Overlap or "to" for Tau Overlap.

...

Further arguments passed to other methods.

Details

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

Value

If the input x is a vec, then the function returns a list that contains:

  • "levels": The averaging time at each level.

  • "allan": The estimated Allan variance.

  • "type": Type of estimator (mo or to).

If the input x is an imu object, then the function returns a list that contains:

  • "sensor": Name of the sensor.

  • "freq": The frequency at which the error signal is measured.

  • "n": Sample size of the data.

  • "type": The types of sensors considered in the data.

  • "axis": The axes of sensors considered in the data.

  • "avar": A list containing the computed Allan variance based on the data.

Maximal Overlap Allan Variance

Given N equally spaced samples with averaging time \tau = n\tau _0, we define n as an integer such that 1 \le n \le \frac{N}{2}. Therefore, n can be selected from \left\{ {n|n < \left\lfloor {{{\log }_2}\left( N \right)} \right\rfloor } \right\} Based on the latter, we have M = N - 2n levels of decomposition. The Maximal-overlap estimator is 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( k \right)} \right]}^2}}

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, we define n as an integer such that 1 \le n \le \frac{N}{2}. Therefore, n can be selected from \left\{ {n|n < \left\lfloor {{{\log }_2}\left( N \right)} \right\rfloor } \right\} Based on the latter, we have m = \left\lfloor {\frac{{N - 1}}{n}} \right\rfloor - 1 levels of decomposition. The tau-overlap estimator is given by:

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

set.seed(999)
Xt = rnorm(10000)
av_mat_mo = avar(Xt, type = "mo", freq = 100)
av_mat_tau = avar(Xt, type = "to")


avar documentation built on Aug. 29, 2023, 5:09 p.m.