Learn R Programming

optismixture (version 0.1)

mixture.is.estimation: For a given mixture weight alpha, use importance sample with or withour control variates for estimation

Description

For a given mixture weight alpha, use importance sample with or withour control variates for estimation

Usage

mixture.is.estimation(seed, N, mixture.param, alpha, fname = "f",
  rpname = "rp", rqname = "rq", dpname = "dp", dqname = "dq",
  cv = TRUE)

Arguments

seed
seed for sampling
N
sample size
mixture.param
mixture.param = list(p, J, ...), where $p$ is the dimension of the sample, and $J$ is the number of mixture components, including the defensive one. mixture.param should be compatible with user defined functions f(n, j, mixture.param), rp(n, mixture.p
alpha
the mixture weight, sum up to 1
fname
name of user defined function fname(xmat, j, mixture.param). xmat is an $n \times p$ matrix of $n$ samples with $p$ dimensions. fname returns a vector of function values for each row in xmat. fname is defined f
rpname
name of user definded function rpname(n, mixture.param). It generates $n$ random samples from target distribution pname. Parameters can be specified in mixture.param. rpname returns an $n \times p$ matrix.
rqname
name of user defined function rqname(n, j, mixture.param). It generate $n$ random samples from the $j^{th}$ mixture component of proposal mixture distribution. rqname returns an $n \times p$ matrix. rqname is defined for $j = 1,
dpname
name of user defined function dpname(xmat, mixture.param). It returns the density of xmat from the target distribution $pname$ as a vector of length nrow(xmat). Note that only the ratio between dpname and dqname
dqname
name of user defined function dqname(xmat, j, mixture.param). It returns the density of xmat from the proposal distribution $q_j$ as a vector of length nrow(xmat). dqname is defined for $j = 1, \cdots, J - 1$. Note that
cv
TRUE indicates optimizing alpha and beta at the same time, and estimate with the formula $$\hat{\mu}_{\alpha_{**},\beta} = \frac{1}{n_2}\sum\limits_{i = 1}^{n_2}\frac{f(x_{i})p(x_{i}) - {\beta}^{\mathsf{T}}\bigl(\boldsymbol{q}(x_{i}) - p