<< intprb_getcrudeld Integration Algorithms intprb_montecarlo >>

Intprbs >> Intprbs > Integration Algorithms > intprb_getcrudemc

intprb_getcrudemc

Uses a crude Monte-Carlo to estimate the integral.

Calling Sequence

[ integr , accur , varf ] = intprb_getcrudemc ( nprob , n , p , callf )

Parameters

nprob:

a 1-by-1 matrix of doubles, integer value,the problem number

n:

a 1-by-1 matrix of doubles, integer value, the spatial dimension.

p:

a matrix of doubles, the parameters of the problem

callf :

a 1-by-1 matrix of floating point integers, the number of calls to the function (default = 1.e4)

integr :

a 1-by-1 matrix of doubles, the approximate value of the integral, the mean of the function.

accur :

a 1-by-1 matrix of doubles, the estimated error on the integral.

varf :

a 1-by-1 matrix of doubles, the approximate value of the variance of f.

Description

Uses a crude Monte-Carlo to approximate the integral corresponding to the nprob problem. This function is a wrapper on intprb_crudemc.

Examples

// Consider problem #1
nprob = 1;
[n,p] = intprb_getsetup(nprob);
callf = 1.e4;
// Get the exact result
e = intprb_getexpect(n,p,nprob)
// Use a Monte Carlo
[integr,accur,varf]=intprb_getcrudemc(nprob,n,p,callf)

Authors


Report an issue
<< intprb_getcrudeld Integration Algorithms intprb_montecarlo >>