rmdistr: Random generator Function for multivariate data

Description Usage Arguments Value References Examples

View source: R/copulafunctions.R

Description

This function generates the values of a multivariate distribution with given marginals and correlation matrix

Usage

1
rmdistr(n, params, corr, distr)

Arguments

n

the length of the sample

params

a list of D elements corresponding to the matrices corresponding to the parameters:

corr

a matrix containing the correlation parameters of the multivariate distribution related to the states of the HMM;

distr

a vector containing the distribution for each component, "gaussian" for the normal distribution, "gamma" for the gamma distribution, "exp" for the exponential distribution

Value

The function returns a n x d matrix

References

Song, P. X.-K.(2000). Multivariate dispersion models generated from Gaussian copula. Scandinavian Journal of Statistics, 27(2), 305-320.

Examples

1
2
3
4
5
6
7
#Simulate a bivariate sample with a gaussian component and an exponential one
n <- 100
params <- list(t(c(1,1)), as.matrix(1))
corr <- cbind(c(1,0.5), c(0.5,1))
distr <- c("gaussian", "exp")

x <- rmdistr(n = n, params = params, corr = corr, distr = distr)

hmmhdd documentation built on Sept. 4, 2019, 5:03 p.m.

Related to rmdistr in hmmhdd...