gendat_mvn_a: Generate Multivariate Normal Data from the A Matrix and...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/gendat.R

Description

Generates multivariate normal data from a p \times p A matrix, p dimensional vector of variances of observed variables, and p dimensional vector of means.

Usage

1
gendat_mvn_a(n, A, sigma2, F, I, mu = NULL, ...)

Arguments

n

Sample size.

A

Asymmetric paths, such as regression coefficients and factor loadings.

sigma2

Vector of variances (σ^2).

F

Filter matrix used to select the observed variables.

I

Identity matrix.

mu

p dimensional mean vector. Defaults to zeros if unspecified.

...

Arguments to pass to FUN.

Details

The function interally uses the ram_s function to derive the Σ_{p \times p} matrix from the matices provided. The generated Σ_{p \times p} matrix is then used together with the p dimensional vector of means to generate data using gendat_mvn.

Value

Returns an n \times p multivariate normal data matrix generated using the variance-covariance matrix derived from the RAM matrices and the mean vector provided.

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other data generating functions: gendat_linreg_X(), gendat_linreg_y(), gendat_linreg(), gendat_mvn_fe(), gendat_mvn(), gendat_vm(), gendat()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
A <- matrix(
  data = c(
    0, 0.26^(1 / 2), 0,
    0, 0, 0.26^(1 / 2),
    0, 0, 0
  ),
  ncol = 3
)
sigma2 <- c(15^2, 15^2, 15^2)
F <- I <- diag(3)
mu <- c(100, 100, 100)
data <- gendat_mvn_a(
  n = 1000,
  A = A,
  sigma2 = sigma2,
  F = F,
  I = I,
  mu = mu
)

jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.