rmmvnorm: Multivariate normal random numbers

Description Usage Arguments Details See Also Examples

Description

Interface functions to use rmvnorm for hyperSpec-class objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
rmmvnorm(n, mean, sigma)

## S4 method for signature 'numeric,hyperSpec,matrix'
rmmvnorm(n, mean, sigma)

## S4 method for signature 'numeric,hyperSpec,array'
rmmvnorm(n, mean, sigma)

## S4 method for signature 'numeric,matrix,matrix'
rmmvnorm(n, mean, sigma)

## S4 method for signature 'numeric,matrix,array'
rmmvnorm(n, mean, sigma)

Arguments

n

vector giving the numer of cases to generate for each group

mean

matrix with mean cases in rows

sigma

common covariance matrix or array (ncol (mean) x ncol (mean) x nrow (mean)) with individual covariance matrices for the groups.

Details

The mvtnorm method for hyperSpec objects supports producing multivariate normal data for groups with different mean but common covariance matrix, see the examples.

See Also

rmvnorm

cov and pooled.cov about calculating covariance of hyperSpec objects.

Examples

1
2
3
4
5
6
7
## multiple groups, common covariance matrix

if (require ("mvtnorm")){
   pcov <- pooled.cov (chondro, chondro$clusters)
   rnd <- rmmvnorm (rep (10, 3), mean = pcov$mean, sigma = pcov$COV)
   plot (rnd, col = rnd$.group)
}

hyperSpec documentation built on May 2, 2019, 5:45 p.m.