Description Usage Arguments Details Value Author(s) See Also Examples
Generates an n \times k multivariate data matrix
or a list of n \times k multivariate data matrices of length R
from the multivariate normal distribution
\mathbf{X} \sim \mathcal{N}_{k} ≤ft( \boldsymbol{μ}, \boldsymbol{Σ} \right) . %(\#eq:dist-X-mvn)
The model-implied matrices used to generate data is derived from the Reticular Action Model (RAM) Matrices.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
n |
Integer. Sample size. |
mu |
Numeric vector. Location parameter mean vector \boldsymbol{μ} of length k. |
M |
Numeric vector. Mean structure. Vector of means and intercepts. |
A |
\mathbf{A} matrix. Asymmetric paths (single-headed arrows), such as regression coefficients and factor loadings. |
sigma2 |
Numeric vector. Vector of variances σ^2. The first element should be the variance of an exogenous variable. |
F |
\mathbf{F} matrix. Filter matrix used to select the observed variables. |
I |
\mathbf{I} matrix. Identity matrix. |
tol |
Numeric.
Tolerance (relative to largest variance)
for numerical lack of positive-definiteness in |
empirical |
Logical.
If |
df |
Logical.
If |
varnames |
Character string.
Optional column names with the same length as |
R |
Integer.
Number of Monte Carlo replications. If |
par |
Logical.
If |
ncores |
Integer.
Number of cores to use if |
mc |
Logical.
If |
lb |
Logical.
If |
cl_eval |
Logical.
Execute |
cl_export |
Logical.
Execute |
cl_expr |
Expression.
Expression passed to |
cl_vars |
Character vector.
Names of objects to pass to |
The \mathbf{S} matrix is derived
from a vector of variances sigma2 ≤ft( σ^2 \right)
and the proceeds to generating data using the mvnram()
function.
The first element in sigma2 should be the variance of an exogenous variable.
If R = NULL
or R = 1
, returns an n \times k
multivariate normal data matrix or data frame .
If R
is an integer greater than 1, (e.g., R = 10
)
returns a list of length R
of n \times k
multivariate normal data matrix or data frame.
Ivan Jacob Agaloos Pesigan
Other multivariate data functions:
mvnram()
,
mvn()
1 2 3 4 5 6 7 8 9 10 11 | mu <- c(100, 100, 100)
A <- matrix(
data = c(0, sqrt(0.26), 0, 0, 0, sqrt(0.26), 0, 0, 0),
ncol = 3
)
sigma2 <- c(225, 225, 225)
F <- I <- diag(3)
X <- mvnramsigma2(n = 100, mu = mu, A = A, sigma2 = sigma2, F = F, I = I)
str(X)
Xstar <- mvnramsigma2(n = 100, mu = mu, A = A, sigma2 = sigma2, F = F, I = I, R = 100)
str(Xstar, list.len = 6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.