slogis_xpower: Fitting the SLxP functions

fit_slogis_xpowerR Documentation

Fitting the SLxP functions

Description

Functions for fitting and sampling from SLxP distribution

Calculate QF, QDF, DQF qslogis_xpower, fslogis_xpower, dqslogis_xpower for the SLxP-QPD

Usage

fit_slogis_xpower(p, q, log.p = FALSE, tol = .Machine$double.eps^2)

approx_slogis_xpower(
  q,
  nterms = 3L,
  p = NULL,
  thin = FALSE,
  n_grid = 1000,
  s_grid = 2L,
  tol = .Machine$double.eps^2
)

qslogis_xpower(u, a)

fslogis_xpower(u, a, log = FALSE)

dqslogis_xpower(u, a, log = FALSE)

rslogis_xpower(n, a)

Arguments

p

the grid of probability values the quantiles q correspond to. This would be specified if metalog is fitted to the empirical CDF. Default is NULL.

q

vector of quantile values (data)

log.p

are probabilities provided on log scale. Default FALSE

tol

tolerance for solve() and qr.solve(), default is .Machine$double.eps^2

nterms

integer number of terms for approximating metalog. Default is 3

thin

logical. Should original data be thinned. Default is FALSE.

n_grid

in case data thinning is performed, integer number of quantiles to extract from data, if data vector q is longer than this value

s_grid

in case data thinning is performed, probability grid shape parameter passed to qpd::make_pgrid(). Default is 10.

u

numeric probability

a

numeric vector of SLxP-QPD parameters.

log

logical, should the result be returned as a log. Default is FALSE

n

number of samples to draw

Details

fit_slogis_xpower is for fitting the SLxP function to the set of QP values. Number of SLxP terms will match the number of QP pairs. approx_slogis_xpower is for approximating SLxP function to the set of data. is_slogis_xpower_valid is a function for checking if the SLxP is valid

Value

returns QF (qslogis_xpower), QDF (fslogis_xpower), DQF (dqslogis_xpower) or random variate of skew-logistic distribution

Examples

p <- c(0.1, 0.5, 0.9)
q <- c(4, 9, 12)
a <-fit_slogis_xpower(p,q)
p_grd <- make_pgrid()

fslogis_xpower(p_grd, a)
dqslogis_xpower(p_grd, a)

dmi3kno/qpd documentation built on Sept. 29, 2024, 6:39 p.m.