Calculates the PDF for a given truncated distribution
dtruncbeta(y, shape1, shape2, eta, a = 0, b = 1, ...)dtruncbinom(y, size, prob, eta, a = 0, b = attr(y, "parameters")$size, ...)
dtruncchisq(y, df, eta, a = 0, b = Inf, ...)
dtrunccontbern(y, lambda, eta, a = 0, b = 1, ...)
dtrunccontbern(y, lambda, eta, a = 0, b = 1, ...)
dtrunc(y, ...)
dtruncexp(y, rate = 1, eta, a = 0, b = Inf, ...)
dtruncgamma(y, shape, rate = 1, scale = 1/rate, eta, a = 0, b = Inf, ...)
dtruncinvgamma(y, shape, rate = 1, scale = 1/rate, eta, a = 0, b = Inf, ...)
dtruncinvgauss(y, m, s, eta, a = 0, b = Inf, ...)
dtrunclnorm(y, meanlog = 0, sdlog = 1, eta, a = 0, b = Inf, ...)
# S3 method for trunc_nbinom
dtrunc(y, size, prob, eta, a = 0, b = Inf, ...)
dtruncnbinom(y, size, prob, eta, a = 0, b = Inf, ...)
dtruncnbinom(y, size, prob, eta, a = 0, b = Inf, ...)
dtruncnorm(y, mean = 0, sd = 1, eta, a = -Inf, b = Inf, ...)
dtruncpois(y, lambda, eta, a = 0, b = Inf, ...)
The density of y
for the given values of the eta
parameter.
output from rtrunc or any valid numeric value(s).
positive shape parameter alpha
positive shape parameter beta
vector of natural parameters
point of left truncation. For discrete distributions, a
will be
included in the support of the truncated distribution.
point of right truncation
size
target for number of successful trials, or dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not be integer.
probability of success on each trial
degrees of freedom for "parent" distribution
mean and var of "parent" distribution
inverse gamma rate parameter
inverse gamma shape parameter
inverse gamma scale parameter
vector of means
vector of dispersion parameters
mean of untruncated distribution
standard deviation of untruncated distribution
mean of parent distribution
standard deviation is parent distribution
# Using the output of rtrunc
y <- rtrunc(50, mean = 5, sd = 2)
dtrunc(y, eta = c(0, -1))
# Directly-inputting values
dtruncnorm(y = c(5, 0, -10), eta = c(0, -0.05))
Run the code above in your browser using DataLab