フィルターのクリア

How do I truncate a normally distributed random variable?

2 ビュー (過去 30 日間)
Yerzhigit Bapin
Yerzhigit Bapin 2017 年 7 月 11 日
編集済み: Torsten 2017 年 7 月 11 日
I have a random variable 'y' that follows the normal distribution. For example:
x = -4:0.1:4;
y = normpdf(x);
I need to create another vector consisting of elements of 'y' truncated at a certain point, how do I do that?

採用された回答

Torsten
Torsten 2017 年 7 月 11 日
編集済み: Torsten 2017 年 7 月 11 日
xtl = 2.0; % left point of trunction
xtr = Inf; % right point of truncation
x = -4:0.1:4;
y = normpdf(x);
yt = normpdf(x)/(normcdf(xtr)-normcdf(xtl)).*(x>=xtl).*(x<=xtr);
Best wishes
Torsten.

その他の回答 (1 件)

Torsten
Torsten 2017 年 7 月 11 日
https://de.mathworks.com/help/stats/prob.truncatabledistribution.truncate.html
Best wishes
Torsten.
  1 件のコメント
Yerzhigit Bapin
Yerzhigit Bapin 2017 年 7 月 11 日
This is only applicable to the probability distribution objects.

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

Community Treasure Hunt

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

Start Hunting!

Translated by