Learn R Programming

skewMLRM (version 1.6)

tgamma: Truncated gamma distribution

Description

Compute the probability density and quantile functions for the truncated gamma distribution with shape and scale parameters, restricted to the interval (a,b).

Usage

dtgamma(x, shape, scale = 1, a = 0, b = Inf)
qtgamma(p, shape, scale = 1, a = 0, b = Inf)

Value

dtgamma gives the density function for the truncated gamma distribution. qtgamma gives the quantile function for the truncated gamma distribution.

Arguments

x

vector of quantiles

p

vector of probabilities

shape

shape parameter

scale

scale parameter

a

lower limit of range

b

upper limit of range

Author

Clecio Ferreira, Diego Gallardo and Camila Zeller

Examples

Run this code
##probability density and quantile function of the truncated gamma
##model with shape and scale parameters equal to 1
##evaluated in 2 and 0.75, respectively
dtgamma(2, shape=1, a=1)
qtgamma(0.75, shape=1, a=1)
##standard gamma distribution with shape parameter 2 evaluated in 1
dtgamma(1, shape=2)
dgamma(1, shape=2)

Run the code above in your browser using DataLab