Plot normal distribution that range from -1 to 1

Hi all, My question should be simple: I would plot a standard distribution with mu = 0 sigma = 1 that ranges between -1 and +1
Thanks

2 件のコメント

dpb
dpb 2017 年 6 月 21 日
Well, maybe not... :)
What to do with the tails? Just truncate or do you think you want the range of the distribution itself to also be bounded?
gianluca mattei
gianluca mattei 2017 年 6 月 21 日
the tails should not be truncated but within the range

サインインしてコメントする。

 採用された回答

dpb
dpb 2017 年 6 月 21 日

0 投票

Well, per the comment, you can't have both...try
x=linspace(-1,1);
plot(x,normpdf(x,0,1/3.5))
You can adjust the divisor for how narrow to make the actual SD to fit what you think the visual representation should be, but the standard z will have to cover the range to produce the tails in a normal. "That's just the way it is"

2 件のコメント

gianluca mattei
gianluca mattei 2017 年 6 月 21 日
this works!
But I miss something, how do you chose the standard dev?
dpb
dpb 2017 年 6 月 21 日
Purely arbitrary to get as much of the tail as you think you needs must have in the range specified [-1 1] here.
The precise way would be to pick a given tail percentage exceedance and then back out the Z for that and then compute SD from z=(x-u)/s. For u=0 that simply reduces to x/s which is the above.
>> 1-normcdf(0,3.5)
ans =
0.9998
>>
so the above includes ~99.96% (two-sided) of the distribution in range. Of course, it's still an unbounded distribution and there's nothing to say that some rare event won't generate a value in one of those tail areas.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2017 年 6 月 21 日

コメント済み:

dpb
2017 年 6 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by