simulate8gmn: simulates a multinormal vector with varying expectation

View source: R/f07.normal.code.r

simulate8gmnR Documentation

simulates a multinormal vector with varying expectation

Description

returns a matrix of simulated values with the variable in columns and the simulations in rows.

Usage

simulate8gmn(loi, cova, nbs, tol=1e-7)

Arguments

loi

list defining the distribution of the initial vector with $mu, its expectation, $gamma, its variance matrix and $rho a matrix of regression coefficients for the covariables modifying the expectation.

cova

Values to give to the covariables. Must be a matrix with nbs rows and ncol(loi$rho) columns or a vector with ncol(loi$rho) values to be used for all simulations (i.e to replace a matrix with identical rows..

nbs

number of simulations to return.

tol

tolerance value to be transmitted to mvrnorm.

Details

Just a call to the function simulate8mn, adding the terms to the expectation due to the regression...

Value

A matrix of size : nbs x length(loi$mu)

Examples

 loi <- list(mu=c(D=2, E=4), 
 rho=matrix(1:6, 2, dimnames=list(LETTERS[4:5], 
 LETTERS[1:3])), 
 gamma=matrix(c(1, 1, 1, 2), 2));
 cova <- matrix(runif(36), 12, dimnames=list(NULL, LETTERS[1:3]));
 print(simulate8gmn(loi, cova, 12));

rbmn documentation built on July 9, 2023, 6:37 p.m.