How can I use Monte Carlo method?

8 visualizaciones (últimos 30 días)
Rafael  Pires
Rafael Pires el 25 de Abr. de 2016
Respondida: Image Analyst el 25 de Abr. de 2016
Hey everyone,
How can I use the Monte Carlo method on matlab? I need this dristibution: Pi=1/(1+(i/31)^2,6) (Pi is the probability of i happens). i is a value of a atmospherical stroke and I need a random value of it. Help me please

Respuestas (2)

John D'Errico
John D'Errico el 25 de Abr. de 2016
Did you look in the stats toolbox? Why not? This is where you will find MANY distributions for random sampling. I'd guess that mnrnd is the tool you are looking for.
  2 comentarios
Rafael  Pires
Rafael Pires el 25 de Abr. de 2016
It's because I am new on matlab. I don't know the stats toolbox. Could you tell me where can I find it?
Image Analyst
Image Analyst el 25 de Abr. de 2016
There is a function called mnrnd() in the stats toolbox. There are also a bunch more in the random() function.
Alternatively you can use inverse transform sampling: https://en.wikipedia.org/wiki/Inverse_transform_sampling I attach a demo for that which does Rayleigh.

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 25 de Abr. de 2016
John's answer has distribution info. Here I attach a few demos on Monte Carlo experiments in general.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by