eta <- seq(-3, 3, by = 0.1) # this is eta = log(Weibull-quantiles).
shape <- exp(1) # 'shape' argument.
percentile <- c(25, 50, 75, 95) # some percentiles of interest.
## E1. Get 'scale' values. Gives a warning (not of the same length) !
theta <- weibullQlink(theta = eta, percentile = percentile,
shape = shape, inverse = TRUE) # Scale
if (FALSE) {
## E2. Plot theta vs. eta, 'shape' fixed, for different percentiles.
plot(theta[, 1], eta, type = "l", lwd = 3,
ylim = c(-4, 4),
main = paste0("weibullQlink(theta; shape = ", round(shape, 3), ")"),
xlab = "Theta (scale)", ylab = "weibullQlink")
abline(h = -3:3, v = 0, col = "gray", lty = "dashed")
lines(theta[, 2], eta, lwd = 3, col = "blue")
lines(theta[, 3], eta, lwd = 3, col = "orange")
lines(theta[, 4], eta, lwd = 3, col = "red")
legend("bottomright", c("25th Perc", "50th Perc", "75th Perc", "95th Perc"),
col = c("black", "blue", "orange", "red"),
lwd = rep(3, 4))
}
## E3. weibullQlink() and its inverse ##
etabis <- weibullQlink(theta = theta, percentile = percentile,
shape = shape, inverse = FALSE)
summary(eta - etabis) # Should be 0 for each colum (percentile)
Run the code above in your browser using DataLab