metalog: Metalog distribution functions

qmetalogR Documentation

Metalog distribution functions

Description

Functions for sampling from metalog distribution

Usage

qmetalog(p, a, bl = -Inf, bu = Inf, log.p = FALSE)

fmetalog(p, a, bl = -Inf, bu = Inf, log.p = FALSE, log = FALSE)

dqmetalog(p, a, bl = -Inf, bu = Inf, log.p = FALSE, log = FALSE)

pmetalog(
  q,
  a,
  bl = -Inf,
  bu = Inf,
  n_grid = 50L,
  s_grid = 2L,
  tol = 1e-15,
  maxiter = 1000,
  log.p = FALSE
)

rmetalog(n, a, bl = -Inf, bu = Inf)

Arguments

p

vector of cumulative probabilities corresponding to quantile values

a

vector of a-coefficient parameters of metalog distribution

bl

real value of lower boundary (for bounded metalog). Default -Inf

bu

real value of upper boundary (for bounded metalog). Default Inf

log.p

should log probability be returned

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

qmetalog is a quantile function. fmetalog is a quantile density function q(u). dqmetalog is the reciprocal of it is density quantile function f(Q(p)). pmetalog is an approximation of the cumulative density function. rmetalog is an RNG.

Examples

a <- c(9,  1.8, -1.13)
p <- c(0.1, 0.5, 0.9)
qmetalog(p, a)
fmetalog(p, a)
dqmetalog(p, a)
x <- c(5, 9, 14)
pmetalog(x, a)
a <- c(2.4, 0.4, -0.08)
rmetalog(100, a)

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