powered by
rnormAR1 efficiently generates samples from a multivariate normal distribution with AR(1) correlation \(cor(x_i, x_j) = \rho^{\lvert i-j \rvert}\).
rnormAR1
rnormAR1(n, p, rho = 0.5, means = 0, variances = 1)
A numeric \(n \times p\) matrix with the specified correlation, means, and variances.
Number of observations.
Number of variables.
Autoregressive correlation coefficient.
Numeric vector of feature means (length \(1\) or \(p\)).
Numeric vector of feature variances (length \(1\) or \(p\)).
X1 <- rnormAR1(10, 5) X2 <- rnormAR1(10, 5, rho = 0.3, means = 2, variances = 4) X3 <- rnormAR1(10, 5, rho = 0.4, means = 1:5, variances = 3:7)
Run the code above in your browser using DataLab