Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
MONTE CARLO

Subject: MONTE CARLO

From: george veropoulos

Date: 31 Jul, 2013 08:59:11

Message: 1 of 6

Dear friend

I would like find the integral

fxi(x)=integral{a(x)}{b(x)} {1/w *fE0(w)*fz(x/w)}dw

a(x) , b(x) is the limits of integration
fE0(w) is distribution of random variable E0
fz(x/w) is distribution of random variable z

there a methods like monte carlo to find this integral
because is veru difficult to applied a classical methids like
quadl


thnak you in advance

george veropoulos

Subject: MONTE CARLO

From: bartekltg

Date: 31 Jul, 2013 11:17:09

Message: 2 of 6

W dniu 2013-07-31 10:59, george veropoulos pisze:
> Dear friend
>
> I would like find the integral
>
> fxi(x)=integral{a(x)}{b(x)} {1/w *fE0(w)*fz(x/w)}dw
>
> a(x) , b(x) is the limits of integration
> fE0(w) is distribution of random variable E0
> fz(x/w) is distribution of random variable z

so fE0(w) fz(x/w) are just functions of w.

> there a methods like monte carlo to find this integral
> because is veru difficult to applied a classical methids like quadl

Why it is difficult? How you function look like?

Classical method is way better than MC in one dimension!

When function is smooth, use quadgk. This is very powerful
15th order Gauss-Kronrod formula.

If there is 'problem' for some "w"s, like uncontinuous n-th derivatives
(n<15 :), use waypoints.

  bartekltg

Subject: MONTE CARLO

From: george veropoulos

Date: 31 Jul, 2013 14:17:07

Message: 3 of 6

Ok i try the quadgk

thank you veru much

bartekltg <bartekltg@gmail.com> wrote in message <ktarnp$144$1@node2.news.atman.pl>...
> W dniu 2013-07-31 10:59, george veropoulos pisze:
> > Dear friend
> >
> > I would like find the integral
> >
> > fxi(x)=integral{a(x)}{b(x)} {1/w *fE0(w)*fz(x/w)}dw
> >
> > a(x) , b(x) is the limits of integration
> > fE0(w) is distribution of random variable E0
> > fz(x/w) is distribution of random variable z
>
> so fE0(w) fz(x/w) are just functions of w.
>
> > there a methods like monte carlo to find this integral
> > because is veru difficult to applied a classical methids like quadl
>
> Why it is difficult? How you function look like?
>
> Classical method is way better than MC in one dimension!
>
> When function is smooth, use quadgk. This is very powerful
> 15th order Gauss-Kronrod formula.
>
> If there is 'problem' for some "w"s, like uncontinuous n-th derivatives
> (n<15 :), use waypoints.
>
> bartekltg
>

Subject: MONTE CARLO

From: george veropoulos

Date: 31 Jul, 2013 14:23:10

Message: 4 of 6

a problem is the limits of intregration
are not clear...


bartekltg <bartekltg@gmail.com> wrote in message <ktarnp$144$1@node2.news.atman.pl>...
> W dniu 2013-07-31 10:59, george veropoulos pisze:
> > Dear friend
> >
> > I would like find the integral
> >
> > fxi(x)=integral{a(x)}{b(x)} {1/w *fE0(w)*fz(x/w)}dw
> >
> > a(x) , b(x) is the limits of integration
> > fE0(w) is distribution of random variable E0
> > fz(x/w) is distribution of random variable z
>
> so fE0(w) fz(x/w) are just functions of w.
>
> > there a methods like monte carlo to find this integral
> > because is veru difficult to applied a classical methids like quadl
>
> Why it is difficult? How you function look like?
>
> Classical method is way better than MC in one dimension!
>
> When function is smooth, use quadgk. This is very powerful
> 15th order Gauss-Kronrod formula.
>
> If there is 'problem' for some "w"s, like uncontinuous n-th derivatives
> (n<15 :), use waypoints.
>
> bartekltg
>

Subject: MONTE CARLO

From: bartekltg

Date: 31 Jul, 2013 15:46:29

Message: 5 of 6

W dniu 2013-07-31 16:23, george veropoulos pisze:

 > bartekltg <bartekltg@gmail.com> wrote in message
 > <ktarnp$144$1@node2.news.atman.pl>...
 >> W dniu 2013-07-31 10:59, george veropoulos pisze:
 >> > Dear friend
 >> >
 >> > I would like find the integral
 >> >
 >> > fxi(x)=integral{a(x)}{b(x)} {1/w *fE0(w)*fz(x/w)}dw
 >> >
 >> > a(x) , b(x) is the limits of integration
 >> > fE0(w) is distribution of random variable E0
 >> > fz(x/w) is distribution of random variable z
 >>
 >> so fE0(w) fz(x/w) are just functions of w.
 >>
 >> > there a methods like monte carlo to find this integral
 >> > because is veru difficult to applied a classical methids
 >> like quadl
 >>
 >> Why it is difficult? How you function look like?
 >>
 >> Classical method is way better than MC in one dimension!
 >>
 >> When function is smooth, use quadgk. This is very powerful
 >> 15th order Gauss-Kronrod formula.
 >>
 >> If there is 'problem' for some "w"s, like uncontinuous n-th
 >> derivatives (n<15 :), use waypoints.
 >>
 >> bartekltg
 >>


> a problem is the limits of intregration are not clear...

I see limits are a(x) b(x). For every x we have clear limits.

You also need clear limits for MC integration!
The simplest (not the best:) way to do MC is:

probes = a + rand(1000,1)*(b-a);
mc_quadrature = sum(function ( probes))
or, if your function can't handle vector input, using arrayfun

As you see, wee neet to know limits.

bartekltg

Subject: MONTE CARLO

From: george veropoulos

Date: 31 Jul, 2013 19:56:22

Message: 6 of 6

?? im trying a classical method and i will see...

thank you again for your reply

george
bartekltg <bartekltg@gmail.com> wrote in message <ktbbgp$1rv$1@node1.news.atman.pl>...
> W dniu 2013-07-31 16:23, george veropoulos pisze:
>
> > bartekltg <bartekltg@gmail.com> wrote in message
> > <ktarnp$144$1@node2.news.atman.pl>...
> >> W dniu 2013-07-31 10:59, george veropoulos pisze:
> >> > Dear friend
> >> >
> >> > I would like find the integral
> >> >
> >> > fxi(x)=integral{a(x)}{b(x)} {1/w *fE0(w)*fz(x/w)}dw
> >> >
> >> > a(x) , b(x) is the limits of integration
> >> > fE0(w) is distribution of random variable E0
> >> > fz(x/w) is distribution of random variable z
> >>
> >> so fE0(w) fz(x/w) are just functions of w.
> >>
> >> > there a methods like monte carlo to find this integral
> >> > because is veru difficult to applied a classical methids
> >> like quadl
> >>
> >> Why it is difficult? How you function look like?
> >>
> >> Classical method is way better than MC in one dimension!
> >>
> >> When function is smooth, use quadgk. This is very powerful
> >> 15th order Gauss-Kronrod formula.
> >>
> >> If there is 'problem' for some "w"s, like uncontinuous n-th
> >> derivatives (n<15 :), use waypoints.
> >>
> >> bartekltg
> >>
>
>
> > a problem is the limits of intregration are not clear...
>
> I see limits are a(x) b(x). For every x we have clear limits.
>
> You also need clear limits for MC integration!
> The simplest (not the best:) way to do MC is:
>
> probes = a + rand(1000,1)*(b-a);
> mc_quadrature = sum(function ( probes))
> or, if your function can't handle vector input, using arrayfun
>
> As you see, wee neet to know limits.
>
> bartekltg
>
>

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us