VGAM (version 1.0-4)

triangle: Triangle Distribution Family Function

Description

Estimating the parameter of the triangle distribution by maximum likelihood estimation.

Usage

triangle(lower = 0, upper = 1,
         link = extlogit(min = 0, max = 1), itheta = NULL)

Arguments

lower, upper

lower and upper limits of the distribution. Must be finite. Called \(A\) and \(B\) respectively below.

link

Parameter link function applied to the parameter \(\theta\), which lies in \((A,B)\). See Links for more choices. The default constrains the estimate to lie in the interval.

itheta

Optional initial value for the parameter. The default is to compute the value internally.

Value

An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm and vgam.

Warning

The MLE regularity conditions do not hold for this distribution (e.g., the first derivative evaluated at the mode does not exist because it is not continuous) so that misleading inferences may result, e.g., in the summary and vcov of the object. Additionally, convergence to the MLE often appears to fail.

Details

The triangle distribution has a probability density function that consists of two lines joined at \(\theta\), which is the location of the mode. The lines intersect the \(y = 0\) axis at \(A\) and \(B\). Here, Fisher scoring is used.

On fitting, the extra slot has components called lower and upper which contains the values of the above arguments (recycled to the right length). The fitted values are the mean of the distribution, which is \((A + B + \theta)/3\).

References

Kotz, S. and van Dorp, J. R. (2004) Beyond Beta: Other Continuous Families of Distributions with Bounded Support and Applications. Chapter 1. World Scientific: Singapore.

Nguyen, H. D. and McLachlan, G. J. (2016) Maximum likelihood estimation of triangular and polygon distributions. Computational Statistics and Data Analysis, 102, 23--36.

See Also

Triangle, Topple, simulate.vlm.

Examples

Run this code
# NOT RUN {
# Example 1
tdata <- data.frame(y = rtriangle(n <- 3000, theta = 3/4))
fit <- vglm(y ~ 1, triangle(link = "identitylink"), data = tdata, trace = TRUE)
coef(fit, matrix = TRUE)
Coef(fit)
head(fit@extra$lower)
head(fitted(fit))
with(tdata, mean(y))

# Example 2; Kotz and van Dorp (2004), p.14
rdata <- data.frame(y = c(0.1, 0.25, 0.3, 0.4, 0.45, 0.6, 0.75, 0.8))
fit <- vglm(y ~ 1, triangle(link = "identitylink"), data = rdata, trace = TRUE,
            crit = "coef", maxit = 1000)
Coef(fit)  # The MLE is the 3rd order statistic, which is 0.3.
fit <- vglm(y ~ 1, triangle(link = "identitylink"), data = rdata, trace = TRUE,
            crit = "coef", maxit = 1001)
Coef(fit)  # The MLE is the 3rd order statistic, which is 0.3.
# }

Run the code above in your browser using DataCamp Workspace