Integration using Monte-Carlo method

Click For Summary

Homework Help Overview

The problem involves using the Monte-Carlo method to evaluate the integral \(\int\limits_1^{ + \infty } {\frac{{\sqrt {\ln (x)} }}{{{x^5}}}dx}\) and determining the absolute error associated with the approximation.

Discussion Character

  • Exploratory, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • The original poster attempts to transform the integral into a form suitable for Monte-Carlo integration and calculates an approximation using random numbers. Some participants provide an alternative analytical approach to evaluate the integral, questioning the necessity of the Monte-Carlo method.

Discussion Status

Participants are exploring different methods to approach the integral, with some providing insights into error estimation in Monte-Carlo integration. There is no explicit consensus on the preferred method, but various lines of reasoning are being discussed.

Contextual Notes

There is a noted requirement to use the Monte-Carlo method specifically, despite the availability of an exact analytical solution. Participants are also discussing the implications of error estimation in the context of the Monte-Carlo approach.

Pzi
Messages
26
Reaction score
0

Homework Statement


Integrate using Monte-Carlo method and evaluate absolute error.
[tex]\int\limits_1^{ + \infty } {\frac{{\sqrt {\ln (x)} }}{{{x^5}}}dx}[/tex]

Homework Equations


Everything about Monte-Carlo integration I guess.

The Attempt at a Solution


[tex]I = \int\limits_1^{ + \infty } {\frac{{\sqrt {\ln (x)} }}{{{x^5}}}dx} = \int\limits_{\pi /4}^{\pi /2} {\frac{{\sqrt {\ln (\tan (t))} }}{{{{(\tan (t))}^5} \cdot {{(\cos (t))}^2}}}dt}[/tex]

I define random variable Y so that its mean would be equal to my integral I.
[tex]{y_k} = \left( {\frac{\pi }{2} - \frac{\pi }{4}} \right) \cdot \frac{{\sqrt {\ln (\tan ({t_k}))} }}{{{{(\tan ({t_k}))}^5} \cdot {{(\cos ({t_k}))}^2}}} = \frac{{\pi \sqrt {\ln (\tan ({t_k}))} }}{{4{{(\tan ({t_k}))}^5} \cdot {{(\cos ({t_k}))}^2}}}[/tex]
[tex]{t_k} = \left( {\frac{\pi }{2} - \frac{\pi }{4}} \right) \cdot {r_k} + \frac{\pi }{4} = \frac{\pi }{4}\left( {{r_k} + 1} \right)[/tex]
r_k - equally likely random numbers between 0 and 1.

I then proceed using 55 random numbers to calculate my approximation.
[tex]{\hat I_n} = \frac{1}{n}\sum\limits_{k = 1}^n {{y_k}}[/tex]
[tex]I \approx {\hat I_{55}} = \frac{1}{{55}}\sum\limits_{k = 1}^{55} {{y_k}} = 0.{\rm{113481}}[/tex]

What about absolute error? It is meant to be like "it is very likely (probability over 0.9 or whatever) that our approximation missed the actual value by no more than *ERROR NUMBER*".
 
Physics news on Phys.org
[tex] t = \sqrt{\ln x} \Rightarrow x = e^{t^2}, dx = 2 \, t \, e^{t^2} \, dt[/tex]
[tex] \frac{\sqrt{\ln x}}{x^5} \, dx = t \, e^{-5 t^2} \, 2 \, t \, e^{t^2} \, dt = 2 \, t^2 \, e^{-4 t^2} \, dt[/tex]
[tex] x = 1 \Rightarrow t = 0, \ x \rightarrow \infty \Rightarrow t \rightarrow \infty[/tex]
So, your integral is equivalent to:
[tex] I = 2 \, \int_{0}^{\infty}{t^2 \, e^{-2 t^2} \, dt} = -2 \, \frac{d}{d a} \left(\int_{0}^{\infty}{e^{-a t^2} \, dt} \right) \vert_{a = 4} = - 2 \, \frac{d}{d a} \left( \frac{1}{2} \, \pi^{\frac{1}{2}} \, a^{-\frac{1}{2}} \right) \vert_{a = 4} = \frac{1}{2} \, \pi^{\frac{1}{2}} \, 4^{-\frac{3}{2}} = \frac{\sqrt{\pi}}{16} \approx 0.110778\ldots[/tex]

EDIT:
See exact result:
http://www.wolframalpha.com/input/?i=Integrate[Sqrt[Log[x]]%2Fx^5%2C{x%2C1%2CInfinity}]
 
Last edited:
Dickfore said:
[tex] t = \sqrt{\ln x} \Rightarrow x = e^{t^2}, dx = 2 \, t \, e^{t^2} \, dt[/tex]
[tex] \frac{\sqrt{\ln x}}{x^5} \, dx = t \, e^{-5 t^2} \, 2 \, t \, e^{t^2} \, dt = 2 \, t^2 \, e^{-4 t^2} \, dt[/tex]
[tex] x = 1 \Rightarrow t = 0, \ x \rightarrow \infty \Rightarrow t \rightarrow \infty[/tex]
So, your integral is equivalent to:
[tex] I = 2 \, \int_{0}^{\infty}{t^2 \, e^{-2 t^2} \, dt} = -2 \, \frac{d}{d a} \left(\int_{0}^{\infty}{e^{-a t^2} \, dt} \right) \vert_{a = 4} = - 2 \, \frac{d}{d a} \left( \frac{1}{2} \, \pi^{\frac{1}{2}} \, a^{-\frac{1}{2}} \right) \vert_{a = 4} = \frac{1}{2} \, \pi^{\frac{1}{2}} \, 4^{-\frac{3}{2}} = \frac{\sqrt{\pi}}{16} \approx 0.110778\ldots[/tex]

EDIT:
See exact result:
http://www.wolframalpha.com/input/?i=Integrate[Sqrt[Log[x]]%2Fx^5%2C{x%2C1%2CInfinity}]

It is necessary for me to use Monte-Carlo method for this one.
However I appreciate your observation about the precise value!
 
Because your integrand is given by the estimation of the mean:
[tex] I = \mu_{Y}[/tex]
of a random variable:
[tex] Y(X) = \frac{\sqrt \ln \tan X}{\tan^{5} X \, \cos^{2} X}[/tex]
when [itex]X \in \mathcal{U}(\pi/4, \pi/2)[/itex] is uniformly distributed, by taking the arithmetic average:
[tex] \mu_{Y} \approx \frac{1}{n} \, \sum_{k = 1}^{n}{f(X_k)}[/tex]
you may esitmate your error by the error propagation formula:
[tex] \sigma^{2}_{\mu_Y} = \sum_{k = 1}^{n}{\left( \frac{\partial \mu_Y}{\partial X_k} \right)^{2} \, \sigma^{2}_{X_k}}[/tex]
where the derivative is:
[tex] {\partial \mu_Y}{\partial X_k} = \frac{1}{n} \, f'(X_k)[/tex]

1. Find the derivative [itex]dY/dX[/itex], and estimate it at [itex]E(X) = \frac{\frac{\pi}{4} + \frac{\pi}{2}}{2} = \frac{3 \pi}{8}[/itex]. Let us call it A;

2. What is the variance of X [itex]\sigma^{2}_{X}[/itex], when [itex]X \in \mathcal{U}(\pi/4, \pi/2)[/itex] is uniformly distributed with the given limits. Let us call this number [itex]\sigma^2[/itex].

3. Then, using the above values, your error propagation formula becomes:
[tex] \sigma^{2}_{\mu_Y} = \sum_{k = 1}^{n}{\left( \frac{A}{n} \right)^{2} \, \sigma^{2}} = \frac{A^2 \, \sigma^2}{n}[/tex]

The error in the mean is then [itex]\sigma_{\mu_Y}[/itex]. This is a very general formula that holds for any Monte-Carlo evaluation. Notice that it is inversely proportional to the square root of the number of sample points. It is proportional to both the absolute value of the derivative [itex]A = \vert Y'(X = E X) \vert[/itex], and the standard deviation of the independent variable [itex]\sigma_{X}[/itex].
 

Similar threads

Replies
3
Views
2K
  • · Replies 105 ·
4
Replies
105
Views
11K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
6
Views
2K
  • · Replies 9 ·
Replies
9
Views
1K
  • · Replies 19 ·
Replies
19
Views
3K
Replies
2
Views
2K