Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

d

Density Function


Description

d is a generic function that evaluates the density function of a distribution object at given values.

Usage

## S3 method for class 'compdist'
d(O, x, log = FALSE)

## S3 method for class 'trans_compdist'
d(O, x, log = FALSE)

## S3 method for class 'mixdist'
d(O, x, log = FALSE)

## S3 method for class 'trans_mixdist'
d(O, x, log = FALSE)

d(O, x, log = FALSE)

## S3 method for class 'standist'
d(O, x, log = FALSE)

## S3 method for class 'trans_contdist'
d(O, x, log = FALSE)

## S3 method for class 'trans_discrdist'
d(O, x, log = FALSE)

Arguments

O

distribution object.

x

vector of quantiles.

log

logical; if TRUE, probabilities p are given as log(p), default: FALSE.

Details

Methods of d function evaluates any offered distribution from the package mistr. The function makes use of the d[sufix] functions as dnorm or dbeta and thus, if a new distribution is added, these functions must be reachable through the search path.

Value

Vector of computed results.

Examples

N <- normdist(1, 3)
d(N, c(NA, 1, 3, 5))

C <- cauchydist()
M <- mixdist(N, C, weights = c(0.5, 0.5))
d(M, c(NA, 1, 3, 5))

CC <- compdist(N, C, weights = c(0.5, 0.5), breakpoints = 1)
CCC <- 2*C+5
d(CCC, c(NA, 1, 3, 5))

mistr

Mixture and Composite Distributions

v0.0.4
GPL-3
Authors
Lukas Sablica [aut, cre] (<https://orcid.org/0000-0001-9166-4563>), Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.