s-news
[Top] [All Lists]

Re: Monte-carlo method for integral calculation

To: asanquer@virbac.fr
Subject: Re: Monte-carlo method for integral calculation
From: Tim Hesterberg <timh@insightful.com>
Date: Tue, 18 Sep 2007 10:27:24 -0700
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <OFDC8E65A3.4EBD1DAB-ONC125735A.00240F71-C125735A.002491BC@virbac.fr> (asanquer@virbac.fr)
References: <OFDC8E65A3.4EBD1DAB-ONC125735A.00240F71-C125735A.002491BC@virbac.fr>
integrate() handles infinite intervals.

The standard approach, which integrate() uses, is to use a
transformation (u-substitution)
        u = 1/x
        \int_1^\infty f(x) dx = \int_0^1 f(1/u) u^{-2} du
It adjusts this based on the value of a.  For a double-infinite
integral it splits the domain into two and does a transformation
for each.

For Monte Carlo you can do a transformation followed by Monte Carlo.
But for a one-variable problem it is generally better to use an
adaptive deterministic method like integrate() rather than
Monte Carlo.

Tim Hesterberg

>Hello,
>
>I would like to perform integral calculation using the Monte-carlo method. 
>I understood how to use the method when the integral is defined on a 
>finite interval [a ; b], but how can I do when my integral is defined in 
>an interval [a ; infinite[ ?
>Does someone have a clue for this, or may be an S-PLUS function ?
>
>Thanks a lot,
>
>Anna le Sanquer

========================================================
| Tim Hesterberg       Senior Research Scientist       |
| timh@insightful.com  Insightful Corp.                |
| (206)802-2319        1700 Westlake Ave. N, Suite 500 |
| (206)283-8691 (fax)  Seattle, WA 98109-3044, U.S.A.  |
|                      www.insightful.com/Hesterberg   |
========================================================
I'll teach:
Advanced Programming in S-PLUS
                Oct 8-9 San Francisco
Bootstrap Methods and Permutation Tests
                Oct 10-11 San Francisco
http://www.insightful.com/services/training.asp


<Prev in Thread] Current Thread [Next in Thread>