SI.SSM {SI} | R Documentation |
Stratified Sampling Method
Description
Stratified Sampling Method
Usage
SI.SSM(h, from, to, level, N)
Arguments
h |
Density function to be integrated |
from |
The start point |
to |
The end point |
level |
Stratification, number of intervals |
N |
The number of trials |
Value
I |
Approximated integration |
Var |
Estimated variance |
Examples
## To integrate exp(x) from -1 to 1
set.seed(0)
h <- function(x){
exp(x)
}
N <- 100000
SSMresult <- SI.SSM(h,-1,1,10,N)
I4 <- SSMresult[[1]]
VarI4 <- SSMresult[[2]]
[Package SI version 0.2.0 Index]