Package 'rjqpd'

Title: The Johnson Quantile-Parameterised Distribution
Description: Implementation of the Johnson Quantile-Parameterised Distribution in R. The Johnson Quantile-Parameterised Distribution (J-QPD) is a flexible distribution system that is parameterised by a symmetric percentile triplet of quantile values (typically the 10th-50th-90th) along with known support bounds for the distribution. The J-QPD system was developed by Hadlock and Bickel (2017) <doi:10.1287/deca.2016.0343>. This package implements the density, quantile, CDF and random number generator functions.
Authors: Bobby Ingram [aut, cre]
Maintainer: Bobby Ingram <[email protected]>
License: MIT + file LICENSE
Version: 0.2.3
Built: 2024-10-31 22:15:03 UTC
Source: https://github.com/bobbyingram/rjqpd

Help Index


Density function of Johnson Quantile-Parameterised Distribution.

Description

Density function of Johnson Quantile-Parameterised Distribution.

Usage

djqpd(x, params)

Arguments

x

vector of quantiles

params

jqpd object created using jqpd()

Value

A numeric vector of density values corresponding to the x quantile vector

Examples

x <- c(0.32, 0.40, 0.60)
params <- jqpd(x, lower = 0, upper = 1, alpha = 0.1)
iles <- seq(0.01, 0.99, 0.01)
density <- djqpd(x = iles, params)

Calculates the parameters of the Johnson Quantile-Parameterised Distribution

Description

Calculates the parameters of the Johnson Quantile-Parameterised Distribution

Usage

jqpd(x, lower = 0, upper = Inf, alpha = 0.1)

Arguments

x

a length 3 numeric vector containing the symmetric percentile triplet values used to parameterise the distribution.

lower

a real number specifying the lower bound of the distribution. (default: 0)

upper

a real number specifying the upper bound of the distribution. A value of Inf indicates a semi-bounded distribution. (default: Inf)

alpha

a real number (between 0 and 0.5) used to describe the symmetric percentile triplet for which the quantile values provided in 'x' correspond. For instance, alpha = 0.1 (default value) indicates the percentiles used are [0.1, 0.5, 0.9].

Value

A jqpd object with elements

x

a length 3 numeric vector containing the symmetric percentile triplet values used to parameterise the distribution

alpha

a real number (between 0 and 0.5) used to describe the symmetric percentile triplet for which the quantile values provided in 'x' correspond

lower

a real number specifying the lower bound of the distribution

upper

a real number specifying the upper bound of the distribution

c

distribution parameter

n

distribution parameter

eta

distribution parameter

delta

distribution parameter

lambda

distribution parameter

k

distribution parameter

Examples

theta <- jqpd(c(0.32, 0.40, 0.6), 0, 1, alpha = 0.1)

Calculates the kurtosis of a Johnson Quantile-Parameterised Distribution.

Description

Calculates the kurtosis of a Johnson Quantile-Parameterised Distribution.

Usage

jqpd_kurtosis(params)

Arguments

params

jqpd object created using jqpd()

Value

The kurtosis of the distribution as a length one numeric vector.


Calculates the mean of a Johnson Quantile-Parameterised Distribution.

Description

Calculates the mean of a Johnson Quantile-Parameterised Distribution.

Usage

jqpd_mean(params)

Arguments

params

jqpd object created using jqpd()

Value

The mean of the distribution as a length one numeric vector.


Calculates the standard-deviation of a Johnson Quantile-Parameterised Distribution.

Description

Calculates the standard-deviation of a Johnson Quantile-Parameterised Distribution.

Usage

jqpd_sd(params)

Arguments

params

jqpd object created using jqpd()

Value

The standard deviation of the distribution as a length one numeric vector.


Calculates the skewness of a Johnson Quantile-Parameterised Distribution.

Description

Calculates the skewness of a Johnson Quantile-Parameterised Distribution.

Usage

jqpd_skewness(params)

Arguments

params

jqpd object created using jqpd()

Value

The skewness of the distribution as a length one numeric vector.


Calculates the variance of a Johnson Quantile-Parameterised Distribution.

Description

Calculates the variance of a Johnson Quantile-Parameterised Distribution.

Usage

jqpd_var(params)

Arguments

params

jqpd object created using jqpd()

Value

The variance of the distribution as a length one numeric vector.


Cumulative distribution function of Johnson Quantile-Parameterised Distribution.

Description

Cumulative distribution function of Johnson Quantile-Parameterised Distribution.

Usage

pjqpd(x, params)

Arguments

x

vector of quantiles

params

jqpd object created using jqpd()

Value

A numeric vector of probabilities corresponding to the x quantiles vector

Examples

x <- c(0.32, 0.40, 0.60)
params <- jqpd(x, lower = 0, upper = 1, alpha = 0.1)
iles <- seq(0.01, 0.99, 0.01)
probs <- pjqpd(x = iles, params)

Plots the density, cumulative distribution function, quantile function and a set of 1000 random samples for a Johnson Quantile-Parameterised Distribution.

Description

Plots the density, cumulative distribution function, quantile function and a set of 1000 random samples for a Johnson Quantile-Parameterised Distribution.

Usage

plot_jqpd(params)

Arguments

params

jqpd object created using jqpd()

Value

no return value, called for side effects only


Quantile function of Johnson Quantile-Parameterised Distribution.

Description

Quantile function of Johnson Quantile-Parameterised Distribution.

Usage

qjqpd(p, params)

Arguments

p

vector of probabilities

params

jqpd object created using jqpd()

Value

A numeric vector of quantiles corresponding to the p probability vector

Examples

x <- c(0.32, 0.40, 0.60)
params <- jqpd(x, lower = 0, upper = 1, alpha = 0.1)
probs <- seq(0.01, 0.99, 0.01)
quantiles <- qjqpd(p = probs, params)

Generate random samples from a jqpd distribution object

Description

Generate random samples from a jqpd distribution object

Usage

rjqpd(n = 1, params)

Arguments

n

number of observations (default is 1)

params

jqpd object created using jqpd()

Value

A numeric vector of n random samples from the input distribution

Examples

x <- c(0.32, 0.40, 0.60)
params <- jqpd(x, lower = 0, upper = 1, alpha = 0.1)
samples <- rjqpd(n = 1000, params)