View source: R/FUN_covariance_serial.R
| ar1m | R Documentation |
First-order autoregressive covariance structure. The returned dimensionless covariance shape is intended for use inside vsm, which supplies the single overall variance scale.
ar1m(x, rho = 0.30, fixed = FALSE,
variance = c("homogeneous", "heterogeneous"), values = NULL)
x |
Ordered factor or design defining q ordered covariance levels. |
rho |
Starting AR(1) correlation in (-1,1). |
fixed |
For homogeneous variance, a logical indicating whether rho is fixed. For heterogeneous variance, a logical vector of length q: rho followed by q-1 variance-ratio parameters. |
variance |
Whether the AR correlation has homogeneous or heterogeneous marginal variances. |
values |
Optional q positive starting variances when |
The homogeneous AR(1) shape is
K_{ij}=\rho^{|i-j|}.
Heterogeneous mode uses
K=D R(\rho)D,
with the first variance fixed as the relative-scale reference. The working correlation coordinate is \eta=\operatorname{atanh}(\rho), ensuring |\rho|<1.
Factor levels define the lag order, so numeric-looking levels must be in increasing numeric order; ar1m() warns otherwise. Inside vsm() one correlation is shared by every level of the other Kronecker factors. For a separate correlation per trial, wrap the vsm() term in dsumm.
A list containing the incidence/design matrix in Z and a compiled CovarianceFactor v2 descriptor in covFactor, for use inside vsm.
ar2m, ar3m, toeplitzm, vsm,
dsumm.
## Not run:
vsm(ar1m(time), ism(id))
# Separable row-by-range residual shared across trials:
# rcov = ~ vsm(dsm(trial), ar1m(range), ar1m(row), ism(units))
# Trial-specific correlations and variances:
# rcov = ~ dsumm(vsm(ar1m(range), ar1m(row), ism(units)), by=trial)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.