Name

intprb_getcrudemc — Uses a crude Monte-Carlo to estimate the integral.

Calling Sequence

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

Parameters

nprob:

the problem number

n:

a 1 x 1 matrix of floating point integers, the spatial dimension.

p:

a floating point matrix, the parameters of the problem

callf :

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

integr :

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

accur :

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

varf :

a 1 x 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

2010 - Michael Baudin (Scilab version)