Density, distribution function, quantile function, and random generation for the solar risk driver.

dsolarX(x, alpha, beta, pdf_Y, log = FALSE)

psolarX(x, alpha, beta, cdf_Y, log.p = FALSE, lower.tail = TRUE)

qsolarX(p, alpha, beta, cdf_Y, log.p = FALSE, lower.tail = TRUE)

rsolarX(n, alpha, beta, cdf_Y)

Arguments

x

Numeric vector of quantiles.

alpha

Numeric scalar. Lower transformation parameter.

beta

Numeric scalar. Scale transformation parameter. Typically beta > 0 and alpha + beta < 1.

pdf_Y

Function. Density function of the latent variable Y.

log

Logical. If TRUE, dsolarX() returns log-densities.

cdf_Y

Function. Distribution function of the latent variable Y.

log.p

Logical. If TRUE, probabilities are supplied or returned on the log scale.

lower.tail

Logical. If TRUE, probabilities are \(P[X \le x]\); otherwise, \(P[X > x]\).

p

Numeric vector of probabilities.

Value

  • dsolarX() returns a numeric vector of density values.

  • psolarX() returns a numeric vector of probabilities.

  • qsolarX() returns a numeric vector of quantiles.

  • rsolarX() returns a numeric vector of random draws.

Details

Consider a latent random variable \(Y\) with density pdf_Y and distribution function cdf_Y. The solar risk driver is modeled as $$X(Y) = \alpha+\beta \exp(-\exp(Y))$$ with support \([\alpha, \alpha+\beta]\).

Note

Version 1.0.0.

Examples

alpha <- 0.001
beta <- 0.9
dsolarX(c(0.2, 0.5), alpha, beta, dnorm)
#> [1] 1.220592 1.179174
psolarX(c(0.2, 0.5), alpha, beta, pnorm)
#> [1] 0.3403505 0.7012472
qsolarX(c(0.1, 0.9), alpha, beta, pnorm)
#> [1] 0.02553671 0.68283556

set.seed(1)
rsolarX(3, alpha, beta, pnorm)
#> [1] 0.1395776 0.2261251 0.3925692