Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rmmvnorm

Multivariate normal random numbers


Description

Interface functions to use rmvnorm for hyperSpec-class objects.

Usage

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

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

Examples

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

Work with Hyperspectral Data, i.e. Spectra + Meta Information (Spatial, Time, Concentration, ...)

v0.100.0
GPL (>= 3)
Authors
Claudia Beleites [aut, cre, dtc] (<https://orcid.org/0000-0003-1626-154X>), Valter Sergo [aut], Alois Bonifacio [ctb, dtc], Marcel Dahms [ctb], Björn Egert [ctb], Simon Fuller [ctb], Vilmantas Gegzna [ctb], Rustam Guliev [ctb], Bryan A. Hanson [ctb], Michael Hermes [ctb], Martin Kammer [dtc], Roman Kiselev [ctb], Sebastian Mellor [ctb]
Initial release
2021-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.