Computes the logffMlink
transformation, including its inverse
and the first two derivatives.
logffMlink(theta, bvalue = NULL,
alg.roots = c("Newton-Raphson", "bisection")[1],
inverse = FALSE, deriv = 0, short = TRUE, tag = FALSE)
For deriv = 0
, the logffMlink
transformation of
theta
, i.e., logitlink(theta) - clogloglink(theta)
, if
inverse = FALSE
.
When inverse = TRUE
the vector entered at theta
becomes
i.e., the inverse image of logffMlink
cannot be written in
closed--form, then the latter is equivalent to search for the roots
of the function
as a function of logff.func
is internally generated.
Then, with the method established at alg.roots
,
either Newton--Raphson or bisection, this link function
approximates and returns the inverse image
logffMlink
. In particular,
for Inf
, it returns
and
For deriv = 1
, d
eta
/ d
theta
as a function of theta
if inverse = FALSE
, else
the reciprocal d
theta
/ d
eta
.
Similarly, when deriv = 2
the second order derivatives
are correspondingly returned.
Both, first and second derivatives, can be written in closed--form.
Numeric or character. This is
This is a boundary value. See below.
Also refer to Links
for additional
details.
Character. The iterative algorithm to find the inverse of this link function. Default is the first (Newton--Raphson). Optionally, the bisection method is also available. See below for more details.
Details at Links
logffMlink
is a monotonically
increasing, convex, and strictly positive function in theta
) must be non-negative so that
NaN
will be returned.
See example 3. It is the plot of logffMlink
in
Besides, the vertical straight line theta
theta
too close to
V. Miranda and T. W. Yee
This link function arises as a natural link function for the mean,
logff
. It is defined for any value
of the shape parameter theta
in the
VGLM/VGAM context), logffMlink
is the difference of two common link functions:
logitlink
and
clogloglink
.
It is particularly usefull for event--rate data where the expected
number of events can be modelled as
While logffMlink
is not the canonical link function of
the logarithmic distribution, it is certainly part of the
canonical link, given by the composite
logffMlink
.
The domain set of this link function is theta
(that is Inf
,
-Inf
, NA
or NaN
. Use argument bvalue
to adequately replace them before computing the link function.
Particularly, if inverse = TRUE
and deriv = 0
,
then
If theta
is a character, then arguments inverse
and
deriv
are disregarded.
logff
,
newtonRaphson.basic
,
bisection.basic
,
Links
,
clogloglink
,
logitlink
.
## Example 1 ##
set.seed(0906)
Shapes <- sort(runif(10))
logffMlink(theta = Shapes, deriv = 1) ## d eta/d theta, as function of theta
logldata.inv <-
logffMlink(theta = logffMlink(theta = Shapes), inverse = TRUE) - Shapes
summary(logldata.inv) ## Should be zero
## Example 2 Some probability link funtions ##
s.shapes <- ppoints(100)
# \donttest{
par(lwd = 2)
plot(s.shapes, logitlink(s.shapes), xlim = c(-0.1, 1.1), type = "l", col = "limegreen",
ylab = "transformation", las = 1, main = "Some probability link functions")
lines(s.shapes, logffMlink(s.shapes), col = "blue")
lines(s.shapes, probitlink(s.shapes), col = "purple")
lines(s.shapes, clogloglink(s.shapes), col = "chocolate")
lines(s.shapes, cauchitlink(s.shapes), col = "tan")
abline(v = c(0.5, 1), lty = "dashed")
abline(v = 0, h = 0, lty = "dashed")
legend(0.1, 4.5, c("logffMlink","logitlink", "probitlink", "clogloglink",
"cauchitlink"),
col = c("blue", "limegreen", "purple", "chocolate", "tan"), lwd = 1)
par(lwd = 1)
# }
## Example 3. Plot of 'logffMlink()' with eta = 1.5. ##
m.eta1.5 <- logffMlink(theta = s.shapes, deriv = 0) - 1.5
# \donttest{
plot(m.eta1.5 ~ s.shapes, type = "l", col = "limegreen",
las = 1, lty = 2, lwd = 3, xlim = c(-0.1, 1.0), ylim = c(-2, 3),
xlab = "shape parameter, s, in (0, 1).",
ylab = "logffMlink(s) - 1.5",
main = "logff.func(s; 1.5) = logffMlink(s) - 1.5, in (0, 1)")
abline(h = 0, v = 0)
abline(v = 1.0, lty = 2)
# }
## Example 4. Special values of theta, inverse = FALSE ##
s.shapes <- c(-Inf, -2, -1, 0.0, 0.25, 0.5, 1, 10, 100, Inf, NaN, NA)
rbind(s.shapes, logffMlink(theta = s.shapes))
Run the code above in your browser using DataLab