weibullMlink {VGAMextra} | R Documentation |
Link functions for the mean of 2–parameter continuous distributions: The Weibull distribution.
Description
Computes the weibullMlink
transformation, its inverse and
the first two derivatives.
Usage
weibullMlink(theta, shape = NULL, wrt.param = NULL,
bvalue = NULL, inverse = FALSE,
deriv = 0, short = TRUE, tag = FALSE)
Arguments
theta |
Numeric or character. This is |
shape |
The shape parameter. Required for this link to work.
See
|
wrt.param |
Positive integer, either |
bvalue , inverse , deriv , short , tag |
See |
Details
This is the link for the mean of
the 2–parameter Weibull distribution, also known as the
weibullMlink
transformation.
It can only be used within
weibullRff
and is defined as
for given ('shape' parameter) where
is the scale parameter.
weibullMlink
is expressly a function of , i.e.
, therefore
(shape)
must be entered at every call.
Numerical values of or
out of range may
result in
Inf
, -Inf
, NA
or NaN
.
Value
For deriv = 0
, the weibmeanlnik
transformation of
theta
, i.e., , when
inverse = FALSE
.
If inverse = TRUE
, then becomes
,
and the inverse,
for given
, is
returned.
When deriv = 1
theta
becomes
, and
with
,
and the argument
wrt.param
must be
considered:
A) If inverse = FALSE
, then
eta1
/
is returned when
wrt.param = 1
, and
eta1
/
if
wrt.param = 2
.
B) For inverse = TRUE
, this function returns
/
eta1
and
/
eta1
conformably arranged
in a matrix, if wrt.param = 1
,
as a function of ,
.
When
wrt.param = 2
, a matrix with columns
/
eta2
and
/
eta2
is returned.
For deriv = 2
, the second derivatives in
terms of theta
are likewise returned.
Note
Numerical instability may occur for values theta
too close
to zero. Use argument bvalue
to replace them before
computing the link.
If theta
is character, then arguments inverse
and
deriv
are ignored. See Links
for further details.
Author(s)
V. Miranda and Thomas W. Yee.
See Also
weibullQlink
,
weibullRff
,
weibullR
,
lgamma
,
Links
.
Examples
eta <- seq(-3, 3, by = 0.1) # this is eta = log(mu(b, a)).
shape <- exp(1) # 'shape' argument.
## E1. Get 'scale' values with A WARNING (not the same length)!
theta <- weibullMlink(theta = eta, shape = shape, inverse = TRUE) # Scale
## Not run:
## E2. Plot theta vs. eta, 'shape' fixed.
plot(theta, eta, type = "l", ylab = "", col = "blue",
main = paste0("weibullMlink(theta; shape = ",
round(shape, 3), ")"))
abline(h = -3:3, v = 0, col = "gray", lty = "dashed")
## End(Not run)
## E3. weibullMlink() and its inverse ##
etabis <- weibullMlink(theta = theta, shape = shape, inverse = FALSE)
summary(eta - etabis) # Should be 0