Title: | Allan Variance |
---|---|
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>. |
Authors: | 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] |
Maintainer: | Stéphane Guerrier <[email protected]> |
License: | AGPL-3 |
Version: | 0.1.2 |
Built: | 2024-10-29 04:47:05 UTC |
Source: | https://github.com/smac-group/avar |
This data set contains Allan variance of gyroscope and accelerometer data from an ADIS 16405 sensor.
adis_av
adis_av
A list of the following elements:
"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.
The IMU data comes from Department of Geomatics Engineering, University of Calgary.
This function allows us to calculate the theoretical allan variance for stationary first-order autoregressive (AR1) process.
av_ar1(n, phi, sigma2)
av_ar1(n, phi, sigma2)
n |
An |
phi |
A |
sigma2 |
A |
A double
indicating the theoretical allan variance for AR1 process.
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.
Yuming Zhang
av1 = av_ar1(n = 5, phi = 0.9, sigma2 = 1) av2 = av_ar1(n = 8, phi = 0.5, sigma2 = 2)
av1 = av_ar1(n = 5, phi = 0.9, sigma2 = 1) av2 = av_ar1(n = 8, phi = 0.5, sigma2 = 2)
This function allows us to calculate the theoretical allan variance for drift process.
av_dr(delta, n)
av_dr(delta, n)
delta |
A |
n |
An |
A double
indicating the theoretical allan variance for the drift
process.
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.
av1 = av_dr(delta = 1, n = 5) av2 = av_dr(delta = 2, n = 8)
av1 = av_dr(delta = 1, n = 5) av2 = av_dr(delta = 2, n = 8)
This function allows us to calculate the theoretical allan variance for stationary quantization noise process.
av_qn(Q2, n)
av_qn(Q2, n)
Q2 |
A |
n |
An |
A double
indicating the theoretical allan variance for the quantization noise
process.
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.
av1 = av_qn(Q2 = 1, n = 5) av2 = av_qn(Q2 = 2, n = 8)
av1 = av_qn(Q2 = 1, n = 5) av2 = av_qn(Q2 = 2, n = 8)
This function allows us to calculate the theoretical allan variance for random walk process.
av_rw(omega2, n)
av_rw(omega2, n)
omega2 |
A |
n |
An |
A double
indicating the theoretical allan variance for the random walk
process.
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.
av1 = av_rw(omega2 = 1, n = 5) av2 = av_rw(omega2 = 2, n = 8)
av1 = av_rw(omega2 = 1, n = 5) av2 = av_rw(omega2 = 2, n = 8)
This function allows us to calculate the theoretical allan variance for stationary white noise process.
av_wn(sigma2, n)
av_wn(sigma2, n)
sigma2 |
A |
n |
An |
A double
indicating the theoretical allan variance for the white noise
process.
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.
av1 = av_wn(sigma2 = 1, n = 5) av2 = av_wn(sigma2 = 2, n = 8)
av1 = av_wn(sigma2 = 1, n = 5) av2 = av_wn(sigma2 = 2, n = 8)
Estimate the parameters of time series models based on the Allan Variance Linear Regression (AVLR) approach
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, ... )
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, ... )
x |
A |
... |
Further arguments passed to other methods. |
qn |
A |
wn |
A |
rw |
A |
dr |
A |
ci |
A |
B |
A |
alpha |
A |
qn_gyro |
A |
wn_gyro |
A |
rw_gyro |
A |
dr_gyro |
A |
qn_acc |
A |
wn_acc |
A |
rw_acc |
A |
dr_acc |
A |
If the input x
is a vec
, then the function returns a list
that contains:
"estimates": The estimated value of the parameters.
"implied_ad": The Allan deviation implied by the estimated parameters.
"implied_ad_decomp": The Allan deviation implied by the estimated parameters for each individual model (if more than one is specified).
"av": The avar
object computed from the provided data.
If the input x
is of the class imu_avar
, then the function returns a list
that contains:
"gyro": The estimation results correseponding to the gyroscope component.
"acc": The estimation results correseponding to the accelerometer component.
"imu_av": The imu_avar
object computed based on the IMU data.
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)
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)
This function allows us to calculate the theoretical covariance matrix of a non-stationary AR(1) blocks process.
covmat_ar1blocks(n_total, n_block, phi, sigma2)
covmat_ar1blocks(n_total, n_block, phi, sigma2)
n_total |
An |
n_block |
An |
phi |
A |
sigma2 |
A |
The theoretical covariance matrix
of the AR(1) blocks process.
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.
Yuming Zhang
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)
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)
This function allows us to calculate the theoretical covariance matrix of a bias-instability process.
covmat_bi(sigma2, n_total, n_block)
covmat_bi(sigma2, n_total, n_block)
sigma2 |
A |
n_total |
An |
n_block |
An |
The theoretical covariance matrix
of the bias-instability process.
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.
Yuming Zhang
covmat1 = covmat_bi(sigma2 = 1, n_total = 1000, n_block = 10) covmat2 = covmat_bi(sigma2 = 2, n_total = 800, n_block = 20)
covmat1 = covmat_bi(sigma2 = 1, n_total = 1000, n_block = 10) covmat2 = covmat_bi(sigma2 = 2, n_total = 800, n_block = 20)
This function allows us to calculate the theoretical covariance matrix of a non-stationary white noise process.
covmat_nswn(sigma2, n_total)
covmat_nswn(sigma2, n_total)
sigma2 |
A |
n_total |
An |
The theoretical covariance matrix
of the non-stationary white noise process.
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.
Yuming Zhang
covmat1 = covmat_nswn(sigma2 = 1, n_total = 1000) covmat2 = covmat_nswn(sigma2 = 2, n_total = 800)
covmat1 = covmat_nswn(sigma2 = 1, n_total = 1000) covmat2 = covmat_nswn(sigma2 = 2, n_total = 800)
Estimate the parameters of time series models based on the Allan Variance Linear Regression (AVLR) approach
fit_avlr(qn, wn, rw, dr, ad, scales)
fit_avlr(qn, wn, rw, dr, ad, scales)
qn |
A |
wn |
A |
rw |
A |
dr |
A |
ad |
A |
scales |
A |
A list
with the estimated parameters.
This data set contains Allan variance of IMAR gyroscopes data.
imar_av
imar_av
A list of the following elements:
"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.
The IMU data comes from Geodetic Engineering Laboratory (TOPO) and Swiss Federal Institute of Technology Lausanne (EPFL).
This data set contains Allan variance of gyroscope and accelerometer data from an KVH1750 sensor.
kvh1750_av
kvh1750_av
A list of the following elements:
"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.
The IMU data comes from Department of Geomatics Engineering, University of Calgary.
This data set contains Allan variance of LN200 gyroscope and accelerometer data.
ln200_av
ln200_av
A list of the following elements:
"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.
The IMU data comes from Geodetic Engineering Laboratory (TOPO) and Swiss Federal Institute of Technology Lausanne (EPFL).
Calculation of the theoretical Maximal-overlapping Allan variance for constant-mean non-stationary time series data.
MOAV(n, covmat)
MOAV(n, covmat)
n |
An |
covmat |
A |
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 .
A field <numeric>
that is the theoretical Maximal-overlapping Allan variance for constant-mean non-stationary time series data.
Haotian Xu
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)})
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)})
Calculation of the theoretical Non-overlapping Allan variance for constant-mean non-stationary time series data.
NOAV(n, covmat)
NOAV(n, covmat)
n |
An |
covmat |
A |
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 .
A field <numeric>
that is the theoretical Non-overlapping Allan variance for constant-mean non-stationary time series data.
Haotian Xu
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)})
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)})
Displays a plot of Allan variance with its corresponding pointwise confidence intervals.
## 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, ... )
## 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, ... )
x |
An |
units |
A |
xlab |
A |
ylab |
A |
main |
A |
col_ad |
A |
col_ci |
A |
nb_ticks_x |
An |
nb_ticks_y |
An |
legend_position |
A |
ci_ad |
A |
point_cex |
A |
point_pch |
A |
text_legend_cex |
A |
... |
Additional arguments affecting the plot. |
A plot of the Allan deviation and relative confidence interval for each scale.
Stephane Guerrier, Nathanael Claussen and Justin Lee
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")
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")
Displays a plot of the Allan variance (AV) with the CI values and the AV implied by the estimated parameters.
## 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, ... )
## 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, ... )
x |
An |
decomp |
A |
units |
A |
xlab |
A |
ylab |
A |
main |
A |
col_ad |
A |
col_ci |
A |
nb_ticks_x |
An |
nb_ticks_y |
An |
legend_position |
A |
ci_ad |
A |
point_cex |
A |
point_pch |
A |
show_scales |
A |
text_legend_cex |
A |
... |
Additional arguments affecting the plot. |
Plot of Allan deviation and relative confidence intervals for each scale.
Stephane Guerrier and Justin Lee
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)
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)
Displays a plot of Allan variance based on IMU data with its corresponding pointwise confidence intervals.
## 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, ... )
## 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, ... )
x |
An |
xlab |
A |
ylab |
A |
main |
A |
col_ad |
A |
col_ci |
A |
nb_ticks_x |
An |
nb_ticks_y |
An |
ci_ad |
A |
point_pch |
A |
point_cex |
A |
... |
Additional arguments affecting the plot. |
A plot of the Allan deviation and relative confidence interval for each scale.
Stephane Guerrier and Yuming Zhang
data("navchip_av") plot(navchip_av)
data("navchip_av") plot(navchip_av)
Displays a plot of the Allan variance (AV) with the CI values and the AV implied by the estimated parameters for the IMU.
## 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, ... )
## 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, ... )
x |
An |
xlab |
A |
ylab |
A |
main |
A |
col_ad |
A |
col_ci |
A |
nb_ticks_x |
An |
nb_ticks_y |
An |
ci_ad |
A |
point_pch |
A |
point_cex |
A |
... |
Additional arguments affecting the plot. |
Plot of Allan deviation and relative confidence intervals for each scale.
Stephane Guerrier and Justin Lee
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)
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)
Displays the information on the output of the 'avar()' function
## S3 method for class 'avar' print(x, ...)
## S3 method for class 'avar' print(x, ...)
x |
A |
... |
Arguments to be passed to methods |
console output
set.seed(999) Xt = rnorm(10000) out = avar(Xt) print(out)
set.seed(999) Xt = rnorm(10000) out = avar(Xt) print(out)
Displays the summary table of the output of the 'avar()' function
## S3 method for class 'avar' summary(object, ...)
## S3 method for class 'avar' summary(object, ...)
object |
A |
... |
Additional arguments affecting the summary produced.
A
|
set.seed(999) Xt = rnorm(10000) out = avar(Xt) summary(out)
set.seed(999) Xt = rnorm(10000) out = avar(Xt) summary(out)