Description Usage Arguments Value Examples
This function evaluates integrals of a multivariate random variables using important sampling method with a multivariate Gaussian proposal
1 | mvImportanceSampling(constr, mn, cv, muProp, sigProp, numObs)
|
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 of integrals
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.