Continuous laplacian random variable
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
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!
採用された回答
Tom Lane
2013 年 5 月 30 日
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 件のコメント
John Agkali
2013 年 5 月 31 日
編集済み: John Agkali
2013 年 5 月 31 日
Thanks for your time !!But this is what i would like to represent with matlab <img153.imageshack.us/img153/1733/exampledi.jpg>...if you know how,that will be great !(If you can't see the photo, just copy-paste the link in the Address bar)
Tom Lane
2013 年 5 月 31 日
sigma = 1;
p = rand(50,1);
A=sign(rand(50,1)-.5).*sqrt(sigma^2/2).*log(1./p);
stem(A)
Here I'm conjecturing that the distribution you want is described by the formula for A, but with a random sign and with 0.1 replaced by a uniform random number. The formula you give for A is just a single numeric value. It is described as the clipping level in the image you provided.
I encourage you to think about this code fragment, understand it, and make sure it's what you want. You should be able to superimpose +/- the clipping level if you need to do that.
John Agkali
2013 年 6 月 2 日
First of all, thank you once again ! In order to understand it better, every time i run this code i got different outcomes based on rand()..But what does sign function do ? Is this last photo going to help http://img196.imageshack.us/img196/918/laplacianrandomvariable.png ?
It says under the diagramm about a inverse probability integral transformation.Is this the way I am going to represent the outcomes of a Laplacian Variable? I would be grateful if you could help me, this time too..
Tom Lane
2013 年 6 月 3 日
As I understand it, the Laplace distribution is the so-called double exponential distribution. If X has a Laplace distribution then, with probability 1/2 of each, either X or -X has an exponential distribution.
So, sign(rand(...)-.5) is either +1 or -1, each with probability 1/2.
John Agkali
2013 年 6 月 4 日
Could you explain to me how *sign *function works? Why do i need it ?
Tom Lane
2013 年 6 月 5 日
You need to find some way to get either a positive or a negative sign. This is one way. It produces the result +1 when its input is positive, and -1 when its input is negative.
John Agkali
2013 年 6 月 8 日
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
2013 年 6 月 9 日
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.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Uniform Distribution (Continuous) についてさらに検索
参考
2013 年 5 月 29 日
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
