Last chance! 50% off unlimited learning
Sale ends in
exponential(link = "loge", location = 0, expected = TRUE,
ishrinkage = 0.95, parallel = FALSE, zero = NULL)
Links
for more choices.TRUE
Fisher scoring is used,
otherwise Newton-Raphson. The latter is usually faster.CommonVGAMffArguments
for information."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.amlexponential
,
gpd
,
laplace
,
expgeometric
,
explogff
,
poissonff
,
mix2exp
,
freund61
,
simulate.vlm
,
Exponential
.edata <- data.frame(x2 = runif(nn <- 100) - 0.5)
edata <- transform(edata, x3 = runif(nn) - 0.5)
edata <- transform(edata, eta = 0.2 - 0.7 * x2 + 1.9 * x3)
edata <- transform(edata, rate = exp(eta))
edata <- transform(edata, y = rexp(nn, rate = rate))
with(edata, stem(y))
fit.slow <- vglm(y ~ x2 + x3, exponential, data = edata, trace = TRUE)
fit.fast <- vglm(y ~ x2 + x3, exponential(exp = FALSE), data = edata,
trace = TRUE, crit = "coef")
coef(fit.slow, mat = TRUE)
summary(fit.slow)
# Compare results with a GPD. Has a threshold.
threshold <- 0.5
gdata <- data.frame(y1 = threshold + rexp(n = 3000, rate = exp(1.5)))
fit.exp <- vglm(y1 ~ 1, exponential(location = threshold), data = gdata)
coef(fit.exp, matrix = TRUE)
Coef(fit.exp)
logLik(fit.exp)
fit.gpd <- vglm(y1 ~ 1, gpd(threshold = threshold), data = gdata)
coef(fit.gpd, matrix = TRUE)
Coef(fit.gpd)
logLik(fit.gpd)
Run the code above in your browser using DataLab