SI.SPM: Stochastic Point Method

Description Usage Arguments Value Examples

Description

Stochastic Point Method

Usage

1
SI.SPM(h, from, to, M, N)

Arguments

h

Density function to be integrated

from

The start point

to

The end point

M

The upper bound of h(x) in [from,to]

N

The number of trials

Value

I

Approximated integration

Var

Estimated variance

Examples

1
2
3
4
5
6
7
8
9
## To integrate exp(x) from -1 to 1
set.seed(0)
h <- function(x){
    exp(x)
}
N <- 100000
SPMresult <- SI.SPM(h,-1,1,exp(1),N)
I1 <- SPMresult[[1]]
VarI1 <- SPMresult[[2]]

jaydu1/SI documentation built on May 12, 2019, 7:18 p.m.