sqn: sqn distribution functions

qsqnR Documentation

sqn distribution functions

Description

Functions for sampling from sqn distribution

Usage

qsqn(p, a)

fsqn(p, a, log = FALSE)

dqsqn(p, a, log = FALSE)

psqn(q, a, n_grid = 50L, s_grid = 2L, tol = 1e-15, maxiter = 1000)

rsqn(n, a)

Arguments

p

vector of cumulative probabilities corresponding to quantile values

a

vector of a-coefficient parameters of sqn distribution

log

should the log density be returned. Default FALSE

q

real vector of values

n_grid

integer size of helper grid to be passed to make_pgrid. Default is 50

s_grid

integer beta shape of helper grid to be passed to make_pgrid. Default is 2

tol

tolerance value, default is 1e-6

maxiter

maximum number of iterations for approximation, default is 1e6

n

integer value correponding to number of samples to draw

Details

qsqn is a quantile function. fsqn is a quantile density function q(u). dqsqn is the reciprocal of it is density quantile function f(Q(p)). psqn is an approximation of the cumulative density function. rsqn is an RNG.

Examples

a <- c(9,  1.8, -1.13, 9)
p <- c(0.1, 0.5, 0.9)
qsqn(p, a)
fsqn(p, a)
dqsqn(p, a)
x <- c(5, 9, 14)
psqn(x, a)
a <- c(2.4, 0.4, -0.08, 9)
rsqn(100, a)

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