eta <- seq(-3, 3, by = 0.1) # this is eta = log(mu(b, a)).
shape <- rep(exp(0.8), length(eta)) # 'shape' argument.
## E1. Get 'rate' values.
theta <- gammaRMlink(theta = eta, shape = shape, inverse = TRUE) # rate
if (FALSE) {
## E2. Plot theta vs. eta, 'shape' fixed.
plot(theta, eta, type = "l", las = 1, ylab = "",
main = "gammaRMlink(theta; shape)")
}
## E3. gammaRMlink() and its inverse ##
etabis <- gammaRMlink(theta = theta, shape = shape, inverse = FALSE)
my.diff <- eta - etabis
summary(my.diff) # Zero
## E4. Special values arranged in a matrix ##
bbeta <- matrix(eta[1:9], ncol = 3, nrow = 3) #Ensure equal dimensions.
alpha <- matrix(c(Inf, -Inf, NA, NaN, -1 , 1, 0, -2, 2), ncol = 3, nrow = 3)
# The gammaRMlink transformation (log(a/b))
gammaRMlink(theta = bbeta, shape = alpha, inv = FALSE) # NaNs produced.
# Same as
log(alpha/bbeta)
Run the code above in your browser using DataLab