Many distributions may be used to describe patterns that are non-negative; however, there are not as many choices when an upper bound is also needed (although the beta distribution
is very flexible). For various reasons, truncated distributions are sometimes preferred, and the truncated normal
is particularly popular. While R has a package that includes the standard functions for this distribution (see rtnorm, dtnorm, etc. in the msm pacakge
), the true expectation and variance of the distribution may be of interest. It turns out that the first two moments of the truncated normal are not too hard to calculate (but worth writing functions for):
##return the expectation of a truncated normal distribution
##return the variance of a truncated normal distribution
 "1.52135857341077 0.197281057170982"
 "1.52090857118 0.197111175109889"
To leave a comment
for the author, please follow the link and comment on his blog: Quantitative Ecology
offers daily e-mail updates
news and tutorials
on topics such as: visualization (ggplot2
), programming (RStudio
, Web Scraping
) statistics (regression
, time series
) and more...
If you got this far, why not subscribe for updates
from the site? Choose your flavor: e-mail
, or facebook