[R] folded normal distribution in R

Matthias Kohl Matthias.Kohl at stamats.de
Mon Oct 20 19:35:44 CEST 2008


Dear Andreas,

try:
library(distr)
X <- Norm() ## standard normal distribution
Y <- abs(X)
plot(Y)

Best regards,
Matthias

Andreas Wittmann wrote:
> Dear R useRs,
>
> i wanted to ask if the folded normal destribution (Y = abs(X) with X 
> normal distributed)
> with density and random number generator is implemented in R or in any 
> R-related package
> so far? Maybe i can use the non-central chi-square distribution and 
> rchisq(n, df=1, ncp>0) here?
>
> Thanks and best regards
>
> Andreas
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Dr. Matthias Kohl
www.stamats.de



More information about the R-help mailing list