covMatAR | R Documentation |
This function generates generates an Autoregressive (AR) covariance structure
matrix of size p \times p
based on the specified autoregressive
coefficient (\rho
) and variance (\sigma^2
).
covMatAR(p, sigma2 = 1, rho)
p |
An integer specifying the number of dimensions of the covariance matrix. |
sigma2 |
A numeric value specifying the variance parameter (default = 1). |
rho |
A numeric value specifying the autoregressive coefficient. If not provided, a random value between 0 and 1 will be generated. The Autoregressive structure is defined as follows:
where |
A p \times p
numeric matrix representing the Autoregressive (AR) covariance structure.
# generate a covariance matrix for \eqn{p = 5}, \eqn{\sigma^2 = 1}, and \eqn{\rho = 0.9}.
covMatAR(p = 5, rho = 0.9)
# generate a covariance matrix for \eqn{p = 5}, \eqn{\sigma^2 = 5}, and \eqn{\rho = 0.9}.
covMatAR(p = 5, sigma2 = 5, rho = 0.9)
# generate covariance matrix for \eqn{p = 5}, and no value is considered for \eqn{\rho}
covMatAR(p = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.