Borrar filtros
Borrar filtros

Continuous laplacian random variable

3 visualizaciones (últimos 30 días)
John Agkali
John Agkali el 29 de Mayo de 2013
I want to plot the outcomes of a Laplacian random Variable when i have the type : A>=sqrt(sigma^2/2)*ln(1/0.01) with sigma=1.I understand what i need to plot but i can not understand that how can I present discrete values for 50 trials ..?Could anyone suggest me how can I do it ?
Thanks!

Respuesta aceptada

Tom Lane
Tom Lane el 30 de Mayo de 2013
Take a look at this:
sigma = 1;
p = rand(10000,1);
A=sqrt(sigma^2/2)*log(1./p);
hist(A,100)
I'm not sure if it's what you want. It uses random P in place of the 0.1 value from your expression. Otherwise it uses that expression to generate random numbers, and makes a histogram of them. Notice that I use "./" to perform division on every element of P.
Perhaps you can figure out how to present the result of 50 trials by looking at this.
  8 comentarios
John Agkali
John Agkali el 8 de Jun. de 2013
The first code segment that you gave me, the one with function hist in it, could you briefly tell me what a histogramm represents ? How can i "decode" its meaning ? And for what purposes is used ?
For example,if I hist the function in the second code segment that you sent me, hist(A), what can I describe about that ? Is there something very important about histogramm I should know ?
Thank you!!
Tom Lane
Tom Lane el 9 de Jun. de 2013
The image you posted showed each trial as a dot, plotted with a line connecting it to zero. That works fine with the 50 or so trials you have.
I had lots of trials so I made a histogram. It counts the number of trials in each of several bins, and draws a bar of that height. So the heights of the bars give a picture of the distribution of points across bins. It may be this is not important for what you are trying to do.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by