Type: Package
Title: Allan Variance
Version: 0.1.3
Date: 2023-08-29
LazyData: true
Maintainer: Stéphane Guerrier <stef.guerrier@gmail.com>
Description: Implements the allan variance and allan variance linear regression estimator for latent time series models. More details about the method can be found, for example, in Guerrier, S., Molinari, R., & Stebler, Y. (2016) <doi:10.1109/LSP.2016.2541867>.
Depends: R (≥ 3.5.0)
License: AGPL-3
Imports: Rcpp, stats, simts
Suggests: knitr, rmarkdown
LinkingTo: Rcpp, RcppArmadillo
Encoding: UTF-8
RoxygenNote: 7.2.3
VignetteBuilder: knitr
URL: https://github.com/SMAC-Group/avar
BugReports: https://github.com/SMAC-Group/avar/issues
NeedsCompilation: yes
Packaged: 2023-08-29 15:10:58 UTC; lionel
Author: Stéphane Guerrier [aut, cre], James Balamuta [aut], Gaetan Bakalli [aut], Roberto Molinari [aut], Justin Lee [aut], Ahmed Radi [aut], Haotian Xu [aut], Yuming Zhang [aut], Nathanael Claussen [aut], Lionel Voirol [ctb]
Repository: CRAN
Date/Publication: 2023-08-29 15:50:06 UTC

Non-stationary Maximal-overlapping Allan Variance

Description

Calculation of the theoretical Maximal-overlapping Allan variance for constant-mean non-stationary time series data.

Usage

MOAV(n, covmat)

Arguments

n

An integer indicating the length of each vector of consecutive observations considered for the average.

covmat

A matrix indicating the T-by-T covariance matrix of the time series with length T.

Details

This calculation of Maximal-overlapping Allan variance is based on the definition on "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260. Here n is an integer larger than 1 and smaller than floor\left(log_2 \left(dim\left(covmat\right)[1]\right)\right)-1.

Value

A field <numeric> that is the theoretical Maximal-overlapping Allan variance for constant-mean non-stationary time series data.

Author(s)

Haotian Xu

Examples


set.seed(999)
Xt = arima.sim(n = 100, list(ar = 0.3))
avar(Xt, type = "to")

a = matrix(rep(0, 1000^2), nrow = 1000)
for (i in 1:1000){
  a[,i] = seq(from = 1 - i, length.out = 1000)
}
a.diag = diag(a)
a[upper.tri(a,diag=TRUE)] = 0
a = a + t(a) + diag(a.diag)
covmat = 0.3^a
sapply(1:8, function(y){MOAV(2^y, covmat)})


Non-stationary Non-overlapping Allan Variance

Description

Calculation of the theoretical Non-overlapping Allan variance for constant-mean non-stationary time series data.

Usage

NOAV(n, covmat)

Arguments

n

An integer indicating the length of each vector of consecutive observations considered for the average.

covmat

A matrix indicating the T-by-T covariance matrix of the time series with length T.

Details

This calculation of Non-overlapping Allan variance is based on the definition on "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260. Here n is an integer larger than 1 and smaller than floor\left(log_2 \left(dim\left(covmat\right)[1]\right)\right)-1.

Value

A field <numeric> that is the theoretical Non-overlapping Allan variance for constant-mean non-stationary time series data.

Author(s)

Haotian Xu

Examples


set.seed(999)
Xt = arima.sim(n = 100, list(ar = 0.3))
avar(Xt, type = "to")

a = matrix(rep(0, 1000^2), nrow = 1000)
for (i in 1:1000){
  a[,i] = seq(from = 1 - i, length.out = 1000)
}
a.diag = diag(a)
a[upper.tri(a,diag=TRUE)] = 0
a = a + t(a) + diag(a.diag)
covmat = 0.3^a
sapply(1:8, function(y){NOAV(2^y, covmat)})



Allan variance of IMU Data from an ADIS 16405 sensor

Description

This data set contains Allan variance of gyroscope and accelerometer data from an ADIS 16405 sensor.

Usage

adis_av

Format

A list of the following elements:

Source

The IMU data comes from Department of Geomatics Engineering, University of Calgary.


Calculate Theoretical Allan Variance for Stationary First-Order Autoregressive (AR1) Process

Description

This function allows us to calculate the theoretical allan variance for stationary first-order autoregressive (AR1) process.

Usage

av_ar1(n, phi, sigma2)

Arguments

n

An integer value for the size of the cluster.

phi

A double value for the autocorrection parameter \phi.

sigma2

A double value for the variance parameter \sigma ^2.

Value

A double indicating the theoretical allan variance for AR1 process.

Note

This function is based on the calculation of the theoretical allan variance for stationary AR1 process raised in "Allan Variance of Time Series Models for Measurement Data" by Nien Fan Zhang, 2008, Metrologia, 45(5): 549. This calculation is fundamental and necessary for the study in "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260.

Author(s)

Yuming Zhang

Examples

av1 = av_ar1(n = 5, phi = 0.9, sigma2 = 1)
av2 = av_ar1(n = 8, phi = 0.5, sigma2 = 2)

Calculate Theoretical Allan Variance for Drift Process

Description

This function allows us to calculate the theoretical allan variance for drift process.

Usage

av_dr(delta, n)

Arguments

delta

A double value for the noise parameter \delta.

n

An integer value for the size of the cluster.

Value

A double indicating the theoretical allan variance for the drift process.

Note

This function is based on the calculation of the theoretical allan variance for drift process raised in "Allan Variance of Time Series Models for Measurement Data" by Nien Fan Zhang, 2008, Metrologia, 45(5): 549. This calculation is fundamental and necessary for the study in "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260.

Examples

av1 = av_dr(delta = 1, n = 5)
av2 = av_dr(delta = 2, n = 8)

Calculate Theoretical Allan Variance for Stationary Quantization Noise Process

Description

This function allows us to calculate the theoretical allan variance for stationary quantization noise process.

Usage

av_qn(Q2, n)

Arguments

Q2

A double value for the noise parameter Q^2.

n

An integer value for the size of the cluster.

Value

A double indicating the theoretical allan variance for the quantization noise process.

Note

This function is based on the calculation of the theoretical allan variance for stationary quantization noise process raised in "Allan Variance of Time Series Models for Measurement Data" by Nien Fan Zhang, 2008, Metrologia, 45(5): 549. This calculation is fundamental and necessary for the study in "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260.

Examples

av1 = av_qn(Q2 = 1, n = 5)
av2 = av_qn(Q2 = 2, n = 8)

Calculate Theoretical Allan Variance for Random Walk Process

Description

This function allows us to calculate the theoretical allan variance for random walk process.

Usage

av_rw(omega2, n)

Arguments

omega2

A double value for the noise parameter \omega ^2.

n

An integer value for the size of the cluster.

Value

A double indicating the theoretical allan variance for the random walk process.

Note

This function is based on the calculation of the theoretical allan variance for random walk process raised in "Allan Variance of Time Series Models for Measurement Data" by Nien Fan Zhang, 2008, Metrologia, 45(5): 549. This calculation is fundamental and necessary for the study in "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260.

Examples

av1 = av_rw(omega2 = 1, n = 5)
av2 = av_rw(omega2 = 2, n = 8)

Calculate Theoretical Allan Variance for Stationary White Noise Process

Description

This function allows us to calculate the theoretical allan variance for stationary white noise process.

Usage

av_wn(sigma2, n)

Arguments

sigma2

A double value for the variance parameter \sigma ^2.

n

An integer value for the size of the cluster.

Value

A double indicating the theoretical allan variance for the white noise process.

Note

This function is based on the calculation of the theoretical allan variance for stationary white noise process raised in "Allan Variance of Time Series Models for Measurement Data" by Nien Fan Zhang, 2008, Metrologia, 45(5): 549. This calculation is fundamental and necessary for the study in "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260.

Examples

av1 = av_wn(sigma2 = 1, n = 5)
av2 = av_wn(sigma2 = 2, n = 8)

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:

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

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")


Compute Maximal-Overlap Allan Variance using Means

Description

Computation of Maximal-Overlap Allan Variance

Usage

avar_mo_cpp(x)

Arguments

x

A vector with dimensions N x 1.

Details

Given N equally spaced samples with averaging time \tau = n\tau _0, where n is an integer such that 1 \le n \le \frac{N}{2}. Therefore, n is able to be selected from \left\{ {n|n < \left\lfloor {{{\log }_2}\left( N \right)} \right\rfloor } \right\} Then, M = N - 2n samples exist. 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}}} .

Value

av A list that contains:

Author(s)

JJB

References

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

Examples


set.seed(999)
N = 100000
white.noise = rnorm(N, 0, 2)
random.walk = cumsum(0.1*rnorm(N, 0, 2))
combined.ts = white.noise+random.walk
av_mat = avar_mo_cpp(combined.ts)


Compute Tau-Overlap Allan Variance

Description

Computation of Tau-Overlap Allan Variance

Usage

avar_to_cpp(x)

Arguments

x

A vector with dimensions N x 1.

Details

Given N equally spaced samples with averaging time \tau = n\tau _0, where n is an integer such that 1 \le n \le \frac{N}{2}. Therefore, n is able to be selected from \left\{ {n|n < \left\lfloor {{{\log }_2}\left( N \right)} \right\rfloor } \right\} Then, a sampling of m = \left\lfloor {\frac{{N - 1}}{n}} \right\rfloor - 1 samples exist. 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}}} .

Value

av A matrix that contains:

Author(s)

JJB

References

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

Examples


set.seed(999)
N = 100000
white.noise = rnorm(N, 0, 2)
random.walk = cumsum(0.1*rnorm(N, 0, 2))
combined.ts = white.noise+random.walk
av_mat = avar_to_cpp(combined.ts)


Computes the Allan Variance Linear Regression estimator

Description

Estimate the parameters of time series models based on the Allan Variance Linear Regression (AVLR) approach

Usage

avlr(x, ...)

## Default S3 method:
avlr(
  x,
  qn = NULL,
  wn = NULL,
  rw = NULL,
  dr = NULL,
  ci = FALSE,
  B = 100,
  alpha = 0.05,
  ...
)

## S3 method for class 'imu_avar'
avlr(
  x,
  qn_gyro = NULL,
  wn_gyro = NULL,
  rw_gyro = NULL,
  dr_gyro = NULL,
  qn_acc = NULL,
  wn_acc = NULL,
  rw_acc = NULL,
  dr_acc = NULL,
  B = 100,
  alpha = 0.05,
  ...
)

Arguments

x

A vec of time series observations or an imu object.

...

Further arguments passed to other methods.

qn

A vec specifying on which scales the parameters of a Quantization Noise (QN) should be computed.

wn

A vec specifying on which scales the parameters of a White Noise (WN) should be computed.

rw

A vec specifying on which scales the parameters of a Random Wakk (RW) should be computed.

dr

A vec specifying on which scales the parameters of a Drift (DR) should be computed.

ci

A boolean to compute parameter confidence intervals.

B

A double for the number of bootstrap replicates to compute the parameter confidence intervals.

alpha

A double defining the level of the confidence interval (1 - 'alpha').

qn_gyro

A vec specifying on which scales the parameters of a Quantization Noise (QN) should be computed for the gyroscope component.

wn_gyro

A vec specifying on which scales the parameters of a White Noise (WN) should be computed for the gyroscope component.

rw_gyro

A vec specifying on which scales the parameters of a Random Wakk (RW) should be computed for the gyroscope component.

dr_gyro

A vec specifying on which scales the parameters of a Drift (DR) should be computed for the gyroscope component.

qn_acc

A vec specifying on which scales the parameters of a Quantization Noise (QN) should be computed for the accelerometer component.

wn_acc

A vec specifying on which scales the parameters of a White Noise (WN) should be computed for the accelerometer component.

rw_acc

A vec specifying on which scales the parameters of a Random Wakk (RW) should be computed for the accelerometer component.

dr_acc

A vec specifying on which scales the parameters of a Drift (DR) should be computed for the accelerometer component.

Value

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

If the input x is of the class imu_avar, then the function returns a list that contains:

Examples


set.seed(999)

N = 100000
Xt = rnorm(N) + cumsum(rnorm(N, 0, 3e-3))

av = avar(Xt)
plot(av)

# Input time series
fit = avlr(Xt, wn = 1:8, rw = 11:15)
fit

# Input directly Allan variance
fit = avlr(av, wn = 1:8, rw = 11:15)
fit

# Plot functions
plot(fit)
plot(fit, decomp = TRUE)
plot(fit, decomp = TRUE, show_scales = TRUE)


Compute bootstrap confidence intervals for the AVLR estimator

Description

Compute bootstrap confidence intervals for the AVLR estimator

Usage

boostrap_ci_avlr(model, B, n, qn, wn, rw, dr, alpha)

Arguments

model

A ts.model object that was estimated with the avlr function.

B

A double for the number of bootsrap replicates to compute the confidence intervals.

n

A double with the sample size.

qn

A vec specifying on which scales the parameters of a Quantization Noise (QN) was computed.

wn

A vec specifying on which scales the parameters of a White Noise (WN) was computed.

rw

A vec specifying on which scales the parameters of a Random Wakk (RW) was computed.

dr

A vec specifying on which scales the parameters of a Drift (DR) was computed.

alpha

A double defining the level of the confidence interval (1 - 'alpha').

Value

A list that contains:


Calculate Theoretical Covariance Matrix of AR(1) Blocks Process

Description

This function allows us to calculate the theoretical covariance matrix of a non-stationary AR(1) blocks process.

Usage

covmat_ar1blocks(n_total, n_block, phi, sigma2)

Arguments

n_total

An integer indicating the length of the whole AR(1) blocks process.

n_block

An integer indicating the length of each block of the AR(1) blocks process.

phi

A double value for the autocorrection parameter \phi.

sigma2

A double value for the variance parameter \sigma ^2.

Value

The theoretical covariance matrix of the AR(1) blocks process.

Note

This function helps calculate the theoretical covariance matrix of a non-stationary process, AR(1) blocks. It is helpful to calculate the theoretical allan variance of non-stationary processes, which can be used to compare with the theoretical allan variance of stationary processes as shown in "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260.

Author(s)

Yuming Zhang

Examples

covmat1 = covmat_ar1blocks(n_total = 1000, n_block = 10,
phi = 0.9, sigma2 = 1)
covmat2 = covmat_ar1blocks(n_total = 800, n_block = 20,
phi = 0.5, sigma2 = 2)

Calculate Theoretical Covariance Matrix of Bias-Instability Process

Description

This function allows us to calculate the theoretical covariance matrix of a bias-instability process.

Usage

covmat_bi(sigma2, n_total, n_block)

Arguments

sigma2

A double value for the variance parameter \sigma ^2.

n_total

An integer indicating the length of the whole bias-instability process.

n_block

An integer indicating the length of each block of the bias-instability process.

Value

The theoretical covariance matrix of the bias-instability process.

Note

This function helps calculate the theoretical covariance matrix of a non-stationary process, bias-instability. It is helpful to calculate the theoretical allan variance of non-stationary processes, which can be used to compare with the theoretical allan variance of stationary processes as shown in "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260.

Author(s)

Yuming Zhang

Examples

covmat1 = covmat_bi(sigma2 = 1, n_total = 1000, n_block = 10)
covmat2 = covmat_bi(sigma2 = 2, n_total = 800, n_block = 20)

Calculate Theoretical Covariance Matrix of Non-Stationary White Noise Process

Description

This function allows us to calculate the theoretical covariance matrix of a non-stationary white noise process.

Usage

covmat_nswn(sigma2, n_total)

Arguments

sigma2

A double value for the variance parameter \sigma ^2.

n_total

An integer indicating the length of the whole non-stationary white noise process.

Value

The theoretical covariance matrix of the non-stationary white noise process.

Note

This function helps calculate the theoretical covariance matrix of a non-stationary process, non-stationary white noise. It is helpful to calculate the theoretical allan variance of non-stationary processes, which can be used to compare with the theoretical allan variance of stationary processes as shown in "A Study of the Allan Variance for Constant-Mean Non-Stationary Processes" by Xu et al., 2017, IEEE Signal Processing Letters, 24(8): 1257–1260.

Author(s)

Yuming Zhang

Examples

covmat1 = covmat_nswn(sigma2 = 1, n_total = 1000)
covmat2 = covmat_nswn(sigma2 = 2, n_total = 800)

Internal function to the Allan Variance Linear Regression estimator

Description

Estimate the parameters of time series models based on the Allan Variance Linear Regression (AVLR) approach

Usage

fit_avlr(qn, wn, rw, dr, ad, scales)

Arguments

qn

A vec specifying on which scales the parameters of a Quantization Noise (QN) should be computed.

wn

A vec specifying on which scales the parameters of a White Noise (WN) should be computed.

rw

A vec specifying on which scales the parameters of a Random Wakk (RW) should be computed.

dr

A vec specifying on which scales the parameters of a Drift (DR) should be computed.

ad

A vec of the Allan variance.

scales

A vec of the scales.

Value

A list with the estimated parameters.


Allan variance of IMU Data from IMAR Gyroscopes

Description

This data set contains Allan variance of IMAR gyroscopes data.

Usage

imar_av

Format

A list of the following elements:

Source

The IMU data comes from Geodetic Engineering Laboratory (TOPO) and Swiss Federal Institute of Technology Lausanne (EPFL).


Integer Check

Description

Checks whether the submitted value is an integer

Usage

is.whole(x)

Arguments

x

A numeric value.

Value

A boolean value indicating whether the value is an integer or not.

Author(s)

James Balamuta

Examples

is.whole(2.3)
is.whole(4)
is.whole(c(1,2,3))
is.whole(c(.4,.5,.6))
is.whole(c(7,.8,9))

Allan variance of IMU Data from a KVH1750 IMU sensor

Description

This data set contains Allan variance of gyroscope and accelerometer data from an KVH1750 sensor.

Usage

kvh1750_av

Format

A list of the following elements:

Source

The IMU data comes from Department of Geomatics Engineering, University of Calgary.


Allan variance of IMU Data from a LN200 sensor

Description

This data set contains Allan variance of LN200 gyroscope and accelerometer data.

Usage

ln200_av

Format

A list of the following elements:

Source

The IMU data comes from Geodetic Engineering Laboratory (TOPO) and Swiss Federal Institute of Technology Lausanne (EPFL).


Description

This data set contains Allan variance of gyroscope and accelerometer data from a navchip sensor.

Usage

navchip_av

Format

A list of the following elements:

Source

The IMU data of the navchip sensor comes from Geodetic Engineering Laboratory (TOPO) and Swiss Federal Institute of Technology Lausanne (EPFL).


Plot Allan Deviation

Description

Displays a plot of Allan variance with its corresponding pointwise confidence intervals.

Usage

## S3 method for class 'avar'
plot(
  x,
  units = NULL,
  xlab = NULL,
  ylab = NULL,
  main = NULL,
  col_ad = NULL,
  col_ci = NULL,
  nb_ticks_x = NULL,
  nb_ticks_y = NULL,
  legend_position = NULL,
  ci_ad = NULL,
  point_cex = NULL,
  point_pch = NULL,
  text_legend_cex = 1,
  ...
)

Arguments

x

An avar object.

units

A string that specifies the units of time plotted on the x axis.

xlab

A string that gives a title for the x axis.

ylab

A string that gives a title for the y axis.

main

A string that gives an overall title for the plot.

col_ad

A string that specifies the color of the line allan variance line.

col_ci

A string that specifies the color of the shaded area covered by the confidence intervals.

nb_ticks_x

An integer that specifies the maximum number of ticks for the x-axis.

nb_ticks_y

An integer that specifies the maximum number of ticks for the y-axis.

legend_position

A string that specifies the position of the legend (use legend_position = NA to remove legend).

ci_ad

A boolean that determines whether to plot the confidence interval shaded area.

point_cex

A double that specifies the size of each symbol to be plotted.

point_pch

A double that specifies the symbol type to be plotted.

text_legend_cex

A double that specifies the size of the legend text.

...

Additional arguments affecting the plot.

Value

A plot of the Allan deviation and relative confidence interval for each scale.

Author(s)

Stephane Guerrier, Nathanael Claussen and Justin Lee

Examples


set.seed(999)
Xt = rnorm(10000)
av = avar(Xt)

plot(av)
plot(av, main = "Simulated white noise", xlab = "Scales")
plot(av, units = "sec", legend_position = "topright")
plot(av, col_ad = "darkred", col_ci = "pink")


Plot the AVLR with the Allan Variance

Description

Displays a plot of the Allan variance (AV) with the CI values and the AV implied by the estimated parameters.

Usage

## S3 method for class 'avlr'
plot(
  x,
  decomp = FALSE,
  units = NULL,
  xlab = NULL,
  ylab = NULL,
  main = NULL,
  col_ad = NULL,
  col_ci = NULL,
  nb_ticks_x = NULL,
  nb_ticks_y = NULL,
  legend_position = NULL,
  ci_ad = NULL,
  point_cex = NULL,
  point_pch = NULL,
  show_scales = FALSE,
  text_legend_cex = 1,
  ...
)

Arguments

x

An avlr object.

decomp

A boolean that determines whether the contributions of each individual model are plotted.

units

A string that specifies the units of time plotted on the x axis.

xlab

A string that gives a title for the x axis.

ylab

A string that gives a title for the y axis.

main

A string that gives an overall title for the plot.

col_ad

A string that specifies the color of the line allan variance line.

col_ci

A string that specifies the color of the shaded area covered by the confidence intervals.

nb_ticks_x

An integer that specifies the maximum number of ticks for the x-axis.

nb_ticks_y

An integer that specifies the maximum number of ticks for the y-axis.

legend_position

A string that specifies the position of the legend (use legend_position = NA to remove legend).

ci_ad

A boolean that determines whether to plot the confidence interval shaded area.

point_cex

A double that specifies the size of each symbol to be plotted.

point_pch

A double that specifies the symbol type to be plotted.

show_scales

A boolean that specifies if the scales used for each process should be plotted.

text_legend_cex

A double that specifies the size of the legend text.

...

Additional arguments affecting the plot.

Value

Plot of Allan deviation and relative confidence intervals for each scale.

Author(s)

Stephane Guerrier and Justin Lee

Examples


set.seed(999)

N = 100000
Xt = rnorm(N) + cumsum(rnorm(N, 0, 3e-3))
av = avlr(Xt, wn = 1:7, rw = 12:15)

plot.avlr(av)
plot.avlr(av, decomp = TRUE, main = "Simulated white noise", xlab = "Scales")
plot.avlr(av, units = "sec", legend_position = "topright")
plot.avlr(av, col_ad = "darkred", col_ci = "pink")
plot.avlr(av, decomp = TRUE, show_scales = TRUE)


Plot Allan Variance based on IMU Data

Description

Displays a plot of Allan variance based on IMU data with its corresponding pointwise confidence intervals.

Usage

## S3 method for class 'imu_avar'
plot(
  x,
  xlab = NULL,
  ylab = NULL,
  main = NULL,
  col_ad = NULL,
  col_ci = NULL,
  nb_ticks_x = NULL,
  nb_ticks_y = NULL,
  ci_ad = NULL,
  point_pch = NULL,
  point_cex = NULL,
  ...
)

Arguments

x

An avar object.

xlab

A string that gives a title for the x axis.

ylab

A string that gives a title for the y axis.

main

A string that gives an overall title for the plot.

col_ad

A string that specifies the color of the line allan variance line.

col_ci

A string that specifies the color of the shaded area covered by the confidence intervals.

nb_ticks_x

An integer that specifies the maximum number of ticks for the x-axis.

nb_ticks_y

An integer that specifies the maximum number of ticks for the y-axis.

ci_ad

A boolean that determines whether to plot the confidence interval shaded area.

point_pch

A double that specifies the symbol type to be plotted.

point_cex

A double that specifies the size of each symbol to be plotted.

...

Additional arguments affecting the plot.

Value

A plot of the Allan deviation and relative confidence interval for each scale.

Author(s)

Stephane Guerrier and Yuming Zhang

Examples

data("navchip_av")
plot(navchip_av)

Plot the AVLR with the Allan Deviation for IMU

Description

Displays a plot of the Allan variance (AV) with the CI values and the AV implied by the estimated parameters for the IMU.

Usage

## S3 method for class 'imu_avlr'
plot(
  x,
  xlab = NULL,
  ylab = NULL,
  main = NULL,
  col_ad = NULL,
  col_ci = NULL,
  nb_ticks_x = NULL,
  nb_ticks_y = NULL,
  ci_ad = NULL,
  point_pch = NULL,
  point_cex = NULL,
  ...
)

Arguments

x

An avlr object.

xlab

A string that gives a title for the x axis.

ylab

A string that gives a title for the y axis.

main

A string that gives an overall title for the plot.

col_ad

A string that specifies the color of the line allan variance line.

col_ci

A string that specifies the color of the shaded area covered by the confidence intervals.

nb_ticks_x

An integer that specifies the maximum number of ticks for the x-axis.

nb_ticks_y

An integer that specifies the maximum number of ticks for the y-axis.

ci_ad

A boolean that determines whether to plot the confidence interval shaded area.

point_pch

A double that specifies the symbol type to be plotted.

point_cex

A double that specifies the size of each symbol to be plotted.

...

Additional arguments affecting the plot.

Value

Plot of Allan deviation and relative confidence intervals for each scale.

Author(s)

Stephane Guerrier and Justin Lee

Examples


data(navchip_av)
navchip_avlr = avlr(navchip_av, wn_gyro = 1:20, rw_gyro = 1:20, wn_acc = 1:20, rw_acc = 1:20)
plot(navchip_avlr)


Prints Allan Variance

Description

Displays the information on the output of the 'avar()' function

Usage

## S3 method for class 'avar'
print(x, ...)

Arguments

x

A avar object.

...

Arguments to be passed to methods

Value

console output

Examples

set.seed(999)
Xt = rnorm(10000)
out = avar(Xt)
print(out)


Print avlr object

Description

Displays information about the avlr object

Usage

## S3 method for class 'avlr'
print(x, ...)

Arguments

x

A avlr object

...

Other arguments passed to specific methods

Value

Text output via print

Examples


set.seed(999)

N = 100000
Xt = rnorm(N) + cumsum(rnorm(N, 0, 3e-3))

fit = avlr(Xt, wn = 1:7, rw = 12:15)
print(fit)


Print imu_avlr object

Description

Displays information about the avlr object

Usage

## S3 method for class 'imu_avlr'
print(x, ...)

Arguments

x

A avlr object

...

Other arguments passed to specific methods

Value

Text output via print

Examples


data(navchip_av)
navchip_avlr = avlr(navchip_av, wn_gyro = 1:20, rw_gyro = 1:20, wn_acc = 1:20, rw_acc = 1:20)
print(navchip_avlr)


Summary Allan Variance

Description

Displays the summary table of the output of the 'avar()' function

Usage

## S3 method for class 'avar'
summary(object, ...)

Arguments

object

A avar object.

...

Additional arguments affecting the summary produced. A table that contains:

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

  • "AVar": The estimated Allan variance.

  • "ADev": The estimated Allan deviation.

  • "Lower CI": The lower bound of the confidence interval for the Allan deviation (ADev).

  • "Upper CI": The upper bound of the confidence interval for the Allan deviation (ADev).

Examples

set.seed(999)
Xt = rnorm(10000)
out = avar(Xt)
summary(out)