powered by
Density, distribution function, and random generation for the folded normal distribution.
dfoldnorm(x, mu = 0, sigma = 1, log = FALSE)pfoldnorm(q, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE)rfoldnorm(n, mu = 0, sigma = 1)
pfoldnorm(q, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE)
rfoldnorm(n, mu = 0, sigma = 1)
dfoldnorm gives the density, pfoldnorm gives the distribution function, and rfoldnorm generates random deviates.
dfoldnorm
pfoldnorm
rfoldnorm
vector of quantiles
location parameter
scale parameter, must be positive.
logical; if TRUE, probabilities/ densities \(p\) are returned as \(\log(p)\).
TRUE
logical; if TRUE, probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).
number of random values to return
vector of probabilities
This implementation of dfoldnorm allows for automatic differentiation with RTMB.
RTMB
x <- rfoldnorm(1, 1, 2) d <- dfoldnorm(x, 1, 2) p <- pfoldnorm(x, 1, 2)
Run the code above in your browser using DataLab