Density, distribution function, quantile function, and random generation for the clearness index.

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

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

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

rsolarK(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, dsolarK() 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

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

  • psolarK() returns a numeric vector of probabilities.

  • qsolarK() returns a numeric vector of quantiles.

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

Details

Consider a latent random variable \(Y\) with density pdf_Y and distribution function cdf_Y. The clearness index is modeled as $$K(Y) = 1-\alpha-\beta \exp(-\exp(Y))$$ with support \([1-\alpha-\beta, 1-\alpha]\).

Note

Version 1.0.0.

Examples

alpha <- 0.001
beta <- 0.9
dsolarK(c(0.2, 0.5), alpha, beta, dnorm)
#> [1] 0.4355575 1.1791742
psolarK(c(0.2, 0.5), alpha, beta, pnorm)
#> [1] 0.01665414 0.29875279
qsolarK(c(0.1, 0.9), alpha, beta, pnorm)
#> [1] 0.3171644 0.9744633

set.seed(1)
rsolarK(3, alpha, beta, pnorm)
#> [1] 0.4716255 0.5616394 0.7283551