필터 지우기
필터 지우기

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