calcpdf: Densities of univariate distributions

Description Usage Arguments Details Value Author(s) See Also

View source: R/calcpdf.R

Description

Convenience function to return probability densities of several univariate distributions.

Usage

1
calcpdf(x,distpar,log=FALSE)

Arguments

x

vector at which probability densities will be evaluated

distpar

distribution type and parameters (see details)

log

if TRUE returns log of density, otherwise density

Details

Argument distpar should be a character vector containing the distribution name (first element in the vector) and parameter values (subsequent elements; these are converted to numeric values automatically).

Implemented distribution types and their required parameters are:

"Uniform" : min, max
"Normal" : mean, sd
"NormalTrunc" (truncated normal distribution) : mean, sd, min, max
"Lognormal" : mean, sd (note R parameters are mean and sd of the log of the random variable)
"LognormalTrunc" : mean, sd, min, max (note R parameters are mean and sd of the log of the random variable)
"Inv" (inverse distribution) : min, max
"Exponential" : mean

Value

Probability density (or log density) at the sample points in x.

Author(s)

Peter Reichert <peter.reichert@eawag.ch>

See Also

calcpdf_mv


baccione-eawag/EawagSchoolTools documentation built on Dec. 19, 2021, 6:38 a.m.