eta <- seq(-3, 3, by = 0.1) # this is eta = log(Normal - Quantiles).
sigma <- exp(1) # 'sigma' argument.
percentile <- c(25, 50, 75, 95) # some percentiles of interest.
## E1. Get 'mean' values.
theta <- uninormalQlink(theta = eta, percentile = percentile,
sd = sigma, inverse = TRUE) # Mu
if (FALSE) {
## E2. Plot theta vs. eta, 'shape' fixed, for different percentiles.
plot(theta[, 1], eta, type = "l", las = 1, lty = 2, lwd = 3,
ylim = c(-10, 10), xlim = c(-10, 10),
main = "uninormalQlink(theta; shape), fixed 'shape'.",
xlab = "Theta (scale)", ylab = "uninormalQlink")
abline(v = 0, h = 0, col = "red")
lines(theta[, 2], eta, lty = 2, lwd = 3, col = "blue")
lines(theta[, 3], eta, lty = 2, lwd = 3, col = "orange")
lines(theta[, 4], eta, lty = 2, lwd = 3, col = "red")
legend("bottomright", c("25th Perc", "50th Perc", "75th Perc", "95th Perc"),
col = c("black", "blue", "orange", "red"), lty = c(2, 2, 2, 2),
lwd = rep(3, 4))
}
## E3. uninormalQlink() and its inverse ##
etabis <- uninormalQlink(theta = theta, percentile = percentile,
sd = sigma, inverse = FALSE)
my.diff <- eta - etabis
summary(my.diff) # Zero
Run the code above in your browser using DataLab