fnorm-distribution: Folded Normal Distribution

Description Usage Arguments Details Value Author(s) References Examples

Description

Density, cumulative distribution, quantile functions and random number generation for the folded normal distribution with the location parameter mu and the scale sigma (which corresponds to standard deviation in normal distribution).

Usage

1
2
3
4
5
6
7
dfnorm(q, mu = 0, sigma = 1, log = FALSE)

pfnorm(q, mu = 0, sigma = 1)

qfnorm(p, mu = 0, sigma = 1)

rfnorm(n = 1, mu = 0, sigma = 1)

Arguments

q

vector of quantiles.

mu

vector of location parameters (means).

sigma

vector of scale parameters.

log

if TRUE, then probabilities are returned in logarithms.

p

vector of probabilities.

n

number of observations. Should be a single number.

Details

The distribution has the following density function:

f(x) = 1/sqrt(2 pi) (exp(-(x-mu)^2 / (2 sigma^2)) + exp(-(x+mu)^2 / (2 sigma^2)))

Both pfnorm and qfnorm are returned for the lower tail of the distribution.

Value

Depending on the function, various things are returned (usually either vector or scalar):

Author(s)

Ivan Svetunkov, [email protected]

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- dfnorm(c(-1000:1000)/200, 0, 1)
plot(x, type="l")

x <- pfnorm(c(-1000:1000)/200, 0, 1)
plot(x, type="l")

qfnorm(c(0.025,0.975), 0, c(1,2))

x <- rfnorm(1000, 0, 1)
hist(x)

greybox documentation built on March 26, 2020, 7:32 p.m.