triangle {VGAM} | R Documentation |
Estimating the parameter of the triangle distribution by maximum likelihood estimation.
triangle(lower=0, upper=1, link="elogit", earg=if(link=="elogit") list(min = lower, max = upper) else list(), itheta=NULL)
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.
|
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.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.
The response must contain values in (A,B). For most data sets (especially small ones) it is very common for half-stepping to occur.
T. W. Yee
y = rtriangle(n <- 3000, theta=3/4) fit = vglm(y ~ 1, triangle(link="identity"), trace=TRUE) coef(fit, matrix=TRUE) Coef(fit) fit@extra$lower[1:5] fitted(fit)[1:5] mean(y)