mvImportanceSampling: Important Sampling for Multivariate variables

Description Usage Arguments Value Examples

Description

This function evaluates integrals of a multivariate random variables using important sampling method with a multivariate Gaussian proposal

Usage

1
mvImportanceSampling(constr, mn, cv, muProp, sigProp, numObs)

Arguments

constr

a function that describes the domain or constraint of the observations

mn

mean of the observations to be generated

cv

covariance matrix of the observations to be generated

muProp

mean of the proposal distribution

sigProp

covariance matrix of the proposal distribution

numObs

number of observations to be generated

Value

value of integrals

Examples

1
2
3
4
5
6
genconst <- function(u1, u2, l1, l2) { in_set <- function(X) {
 if (nrow(X) == 1) X = t(X)
 X[1,] > l1 & X[1,] < u1 & X[2,] > l2 & X[2,] < u2 & X[3,] > l1 &
 X[3,] < u1 & X[4,] > l2 & X[4,] < u2 }}
constr  <- genconst(u = 0, u = 0, l1 = 1, l2 = 1)
mvImportanceSampling(constr, rep(1/2, 4), diag(0.1,4), rep(0,4), diag(0.3,4), 100)

pasudyan/ConstrMixMod documentation built on May 10, 2019, 8:26 a.m.