triangle {VGAM} | R Documentation

## Triangle Distribution Family Function

### Description

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

### Usage

    triangle(lower=0, upper=1, link="elogit",
             earg=if(link=="elogit") list(min = lower, max = upper) else
             list(), 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.
`earg` | List. Extra argument for the link. See `earg` in `Links` for general information.
`itheta` | Optional initial value for the parameter. The default is to compute the value internally.

### Details

The triangle distribution has a probability density function that consists of two lines joined at theta. 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 little messy to write.

### Value

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

### Note

The response must contain values in (A,B). For most data sets (especially small ones) it is very common for half-stepping to occur.

### Author(s)

T. W. Yee

### See Also

`Triangle`.

### Examples

    y  = rtriangle(n <- 3000, theta=3/4)
    fit = vglm(y ~ 1, triangle(link="identity"), trace=TRUE)
    coef(fit, matrix=TRUE)
    Coef(fit)
    head(fit@extra$lower)
    head(fitted(fit))
    mean(y)

[Package VGAM version 0.7-9 Index]