Learn R Programming

SI (version 0.2.0)

SI.MVM: Mean Value Method

Description

Mean Value Method

Usage

SI.MVM(h, from, to, N)

Arguments

h

Density function to be integrated

from

The start point

to

The end point

N

The number of trials

Value

I

Approximated integration

Var

Estimated variance

%% ~Describe the value returned %% If it is a LIST, use %% \item{comp1 }{Description of 'comp1'} %% \item{comp2 }{Description of 'comp2'} %% ...

Examples

Run this code
# NOT RUN {
## To integrate exp(x) from -1 to 1
set.seed(0)
h <- function(x){
    exp(x)
}
N <- 100000
MVMresult <- SI.MVM(h,-1,1,N)
I2 <- MVMresult[[1]]
VarI2 <- MVMresult[[2]]
# }

Run the code above in your browser using DataLab