Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/uninormalQlink.R

Computes the `uninormalQlink`

transformation, its inverse and
the first two derivatives.

1 2 3 4 5 |

`theta` |
Numeric or character. This is |

`percentile` |
Numeric. A vector of percentiles of interest, denoted as |

`sd` |
Numeric, positive. The 'standard deviation' parameter (required),
denoted as |

`wrt.param` |
Positive integer, either |

`bvalue, inverse, deriv, short, tag` |
See |

A 2-parameter link for the quantiles of the normal
distribution. It can only be used within
`uninormalff`

as the first linear
predictor. It is defined as

*
uninormalQlink(μ; σ) =
η_1(μ; σ) =
μ + σ * Φ^(-1)(perc) *

where *Φ* is the error function
(see, e.g., `erf`

),
*μ in (-∞, ∞)*, and *σ > 0*.
This link is expressly a function of *θ = μ*, therefore
*sigma* must be entered at every call.
Numerical values of *σ* out of range may
result in `Inf`

, `-Inf`

, `NA`

or `NaN`

.

For `deriv = 0`

, the `uninormalQlink`

transformation of
`theta`

, i.e. *μ*, when `inverse = FALSE`

.
If `inverse = TRUE`

, then *θ* becomes *η*,
and the inverse, *η - σ Φ^{-1}(perc)*,
*for given* *σ*, is returned.

When `deriv = 1`

`theta`

becomes
*θ = (μ, σ)= (θ_1, θ_2)*, and
*η = (η_1, η_2)* with
*η_2 = log σ*,
and the argument `wrt.param`

must be
considered:

A) If `inverse = FALSE`

, then
*d* `eta1`

/ *d* *μ* is returned when
`wrt.param = 1`

, and
*d* `eta1`

/ *d* *σ* if
`wrt.param = 2`

.

B) For `inverse = TRUE`

, this link returns
*d* *μ* / *d* `eta1`

and
*d* *σ* / *d* `eta1`

conformably arranged
in a matrix, if `wrt.param = 1`

,
as a function of *θi*, *i = 1, 2*.
When `wrt.param = 2`

, then
*dμ* / *d* `eta2`

and
*dσ* / *d* `eta2`

is returned.

For `deriv = 2`

, the second derivatives in
terms of `theta`

are similarly returned.

Numerical instability may occur for values of
`sigma`

too close
to zero. Use argument `bvalue`

to replace the former only before
computing the link.

If `theta`

is character, then arguments `inverse`

and
`deriv`

are ignored. See `Links`

for further details.

V. Miranda and Thomas W. Yee.

`uninormalff`

,
`uninormal`

,
`Links`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ```
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
## Not run:
## 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))
## End(Not run)
## E3. uninormalQlink() and its inverse ##
etabis <- uninormalQlink(theta = theta, percentile = percentile,
sd = sigma, inverse = FALSE)
my.diff <- eta - etabis
summary(my.diff) # Zero
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.