# Internal function. With stratified samples, calculate the variance of the estimate from importance sampling without control variates

### Description

Internal function. With stratified samples, calculate the variance of the estimate from importance sampling without control variates

### Usage

1 | ```
get.var(Y, nvec)
``` |

### Arguments

`Y` |
vector of stratified samples of length |

`nvec` |
the vector of number of samples from each mixture component. It sums up to |

### Details

Suppose we sample Y from a mixture *q_{α} = α_1*q_1 + ... + α_J*q_J*. To estimate *\mathrm{mean}(Y)*, fixing the number of samples from each mixture component and getting a stratified sample would reduce the variance of the estimate. The formula for *\mathrm{Var}(\hat{μ})* with stratified samples is

*\mathrm{Var}(\hat{μ}) = 1/n \times ∑_{j=1}^J α_j \mathrm{Var}(Y_j)*

### Value

the variance estimate of *\hat{μ} = 1/n ∑_{i=1}^n Y[i]*

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.