NVASIM: N-Vasicek distribution (normal kernel) with mean...

NVASIMR Documentation

N-Vasicek distribution (normal kernel) with mean parameterization

Description

Defines the normal-kernel Vasicek distribution under a mean parameterization for use as a gamlss.family. The parameter \mu represents the mean of the distribution, with 0 < \mu < 1, and \sigma is a shape parameter.

The density, distribution function, quantile function and random number generation are provided by dNVASIM(), pNVASIM(), qNVASIM() and rNVASIM(), respectively.

Usage

dNVASIM(x, mu, sigma, log = FALSE)

pNVASIM(q, mu, sigma, lower.tail = TRUE, log.p = FALSE)

qNVASIM(p, mu, sigma, lower.tail = TRUE, log.p = FALSE)

rNVASIM(n, mu, sigma)

NVASIM(mu.link = "logit", sigma.link = "logit")

Arguments

x

Vector of quantiles in the interval (0,1).

mu

Vector of mean values.

sigma

Vector of shape parameter values.

log

Logical; if TRUE, the log-density is returned.

q

Vector of quantiles in the interval (0,1).

lower.tail

Logical; if TRUE, probabilities P(X \le x) are returned.

log.p

Logical; if TRUE, probabilities p are given as log(p) or cumulative probabilities are returned on the log scale, as appropriate.

p

Vector of probabilities.

n

Number of observations. If length(n) > 1, the length is taken to be the number required.

mu.link

Link function for the \mu parameter.

sigma.link

Link function for the \sigma parameter.

Details

Probability density function

f(x\mid \mu ,\sigma )=\sqrt{\frac{1-\sigma }{\sigma }}\exp \left\{ \frac{1}{2}\left[ \Phi ^{-1}\left( x\right) ^{2}-\left( \frac{\Phi ^{-1}\left( x\right) \sqrt{1-\sigma }-\Phi ^{-1}\left( \mu \right) }{\sqrt{\sigma }}\right) ^{2}\right] \right\}

Cumulative distribution function

F(x\mid \mu ,\sigma )=\Phi \left( \frac{\Phi ^{-1}\left( x\right) \sqrt{1-\sigma }-\Phi ^{-1}\left( \mu \right) }{\sqrt{\sigma }}\right)

Quantile function

Q(\tau \mid \mu ,\sigma )=F^{-1}(\tau \mid \mu ,\sigma )=\Phi \left(\frac{\Phi ^{-1}\left(\mu\right) +\Phi ^{-1}\left( \tau \right) \sqrt{\sigma }}{\sqrt{1-\sigma }}\right)

Expected value

E(X) = \mu

Variance

Var(X) = \Phi_2\left ( \Phi^{-1}(\mu),\Phi^{-1}(\mu),\sigma \right )-\mu^2

where (x, \mu, \sigma, \tau) \in (0,1) and \Phi_2(\cdot) is the probability distribution function for the standard bivariate normal distribution with correlation \sigma.

Value

NVASIM() returns a gamlss.family object.

Note

In the NVASIM() parameterization, \mu corresponds to the mean of the distribution and \sigma is a shape parameter.

Author(s)

Josmar Mazucheli jmazucheli@gmail.com Bruna Alves pg402900@uem.br

References

Hastie, T. J. and Tibshirani, R. J. (1990). Generalized Additive Models. Chapman and Hall, London.

Mazucheli, J., Alves, B., Korkmaz, M. C., and Leiva, V. (2022). Vasicek quantile and mean regression models for bounded data: New formulation, mathematical derivations, and numerical applications. Mathematics, 10, 1389. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3390/math10091389")}

Rigby, R. A. and Stasinopoulos, D. M. (2005). Generalized additive models for location, scale and shape (with discussion). Applied Statistics, 54(3), 507–554.

Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019). Distributions for Modeling Location, Scale, and Shape: Using GAMLSS in R. Chapman and Hall/CRC.

Stasinopoulos, D. M. and Rigby, R. A. (2007). Generalized additive models for location, scale and shape (GAMLSS) in R. Journal of Statistical Software, 23(7), 1–45.

Stasinopoulos, D. M., Rigby, R. A., Heller, G., Voudouris, V., and De Bastiani, F. (2017). Flexible Regression and Smoothing: Using GAMLSS in R. Chapman and Hall/CRC.

Vasicek, O. A. (1987). Probability of loss on loan portfolio. KMV Corporation.

Vasicek, O. A. (2002). The distribution of loan portfolio value. Risk, 15(12), 1–10.

See Also

NVASIQ, pmvnorm

Examples


set.seed(123)
x <- rNVASIM(n = 1000, mu = 0.50, sigma = 0.69)
R <- range(x)
S <- seq(from = R[1], to = R[2], length.out = 1000)

hist(x, prob = TRUE, main = 'Vasicek')
lines(S, dNVASIM(x = S, mu = 0.50, sigma = 0.69), col = 2)

plot(ecdf(x))
lines(S, pNVASIM(q = S, mu = 0.50, sigma = 0.69), col = 2)

plot(quantile(x, probs = S), type = "l")
lines(qNVASIM(p = S, mu = 0.50, sigma = 0.69), col = 2)

library(gamlss)
set.seed(123)
data <- data.frame(y =  rNVASIM(n = 100, mu = 0.5, sigma = 0.69))

fit <- gamlss(y ~ 1, data = data, mu.link = 'logit', sigma.link = 'logit', family = NVASIM)
1 /(1 + exp(-fit$mu.coefficients))
1 /(1 + exp(-fit$sigma.coefficients))

## Not run: 
library(gamlss)
set.seed(123)

n <- 1000
x <- rbinom(n, size = 1, prob = 0.5)
eta <- 0.5 + 1 * x;
mu <- 1 / (1 + exp(-eta));
sigma <- 0.5;
y <- rNVASIM(n, mu, sigma)
data <- data.frame(y, x)

fit <- gamlss(y ~ x, data = data, family = NVASIM, mu.link = 'logit', sigma.link = 'logit', 
control = gamlss.control(n.cyc = 200))
summary(fit)

## End(Not run)

vasicekreg documentation built on Aug. 20, 2026, 9:08 a.m.