R-plotting a PDF of a truncated normal

by user593721   Last Updated September 18, 2018 11:26 AM

Any idea how can I plot this truncated normal PDF in R. The mean is 0 with variance 1 so the PDF is: exp((-x^2)/2)) * I{x>=2} where I is an indicator function. Any help will be appreciated. Thanks.



Answers 1


Nothing simpler. Try:

x <- seq(-5, 5, by=0.01)
plot(x[x >= 2], exp((-x^2)/2)[x >= 2])
liori
liori
September 18, 2018 10:26 AM

Related Questions




Draw distribution on ggplot2 bar graph

Updated April 12, 2017 15:26 PM

Drawing a theoretical density histogram in R?

Updated June 22, 2017 19:26 PM

spss degree/frequency distribution plot

Updated September 03, 2017 01:26 AM