0

I am a little bit confused about truncated distributions such as truncated normal distribution. I have a code in FORTRAN where the function gen_rnorm(mean,sigma) returns random normal value. Now I want to write a code for truncated normal distribution with $a=-3$ and $b=3$. My question is does truncated normal distribution mean that I run the function gen_rnorm(mean,sigma) and check if the returned value is between $a$ and $b$. If not then ask for another value. Is this what truncated normal distribution means?.

I hope my question makes sense.

Steffen Moritz
  • 1,564
  • 2
  • 15
  • 22
MrDi
  • 101
  • 2
  • It is simply the normal density function defined by its mean and variance cut off to be 0 below -3 and above 3 in your case. But it is renormalized to integrate to 1 over the intervaal [-3, 3]. – Michael R. Chernick Jan 12 '18 at 05:25
  • Your function generates a random number on that interval based on the derived density. One way to d it is to sample from the original normal distribution rejecting values outside the interval.. – Michael R. Chernick Jan 12 '18 at 05:29
  • @MichaelChernick, Are you saying that I should run my function and only accept values between $a$ and $b$? – MrDi Jan 12 '18 at 05:35
  • See also https://stats.stackexchange.com/questions/197628/laymans-explanation-of-censoring-in-survival-analysis/198481#198481 – Tim Jan 12 '18 at 07:50
  • That is called rejection sampling it is one of the ways to generate the samples; The method does work by sampling and rejecting values outside the range and continuing to sampling until you get the required sample size. – Michael R. Chernick Jan 12 '18 at 15:01

0 Answers0