Learn R Programming

rbmn (version 0.9-6)

simulate8gmn: 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)

Value

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

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...

Examples

Run this code
 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));

Run the code above in your browser using DataLab