kappa4Int: Arc length of four-parameter kappa CDF.

Description Usage Arguments Details Value Examples

Description

Calculate the arc length for a univariate four-parameter kappa cumulative distribution function over a specified interval.

Usage

1
2
3
kappa4Int(mu, sigma, h, k, tau, q1, q2, quantile)

kappa4Int2(mu, sigma, h, k, tau, q1, q2, quantile)

Arguments

mu

A real number specifying the location parameter.

sigma

A positive real number specifying the scale parameter.

h, k

Real numbers specifying the two shape parameters.

tau

A real number between 0 and 1, corresponding to the CDF value at the point of truncation.

q1

The point (or vector for kappa4Int2) specifying the lower limit of the arc length integral.

q2

The point (or vector for kappa4Int2) specifying the upper limit of the arc length integral.

quantile

Logical, TRUE/FALSE, whether q1 and q2 are quantiles, or actual points in the domain.

Details

The arc length of a univariate four-parameter kappa cumulative distribution function is approximated using the numerical integration C code implimented for R's integrate functions, i.e. using Rdqags. For this approximation, subdiv = 100 (100 subdivisions), and eps_abs = eps_rel = 1e-10, i.e. the absolute and relative errors respectively.

Value

kappa4Int: A list with the following components:

kappa4Int2: A vector having length equal to that of the vector of lower quantile bounds, containing the arc lengths requested for a four-parameter kappa cumulative distribution function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(alR)
mu <- 4
sigma <- 0.4
h <- -4
tau <- 1 ## no truncation
k <- kappa4tc(-4, 0, 1)$par
kappa4Int(mu, sigma, h, k, tau, 0.025, 0.975, TRUE)
p1 <- qkappa4(0.025, mu, sigma, h, k)
p2 <- qkappa4(0.975, mu, sigma, h, k)
kappa4Int(mu, sigma, h, k, tau, p1, p2, FALSE)

kappa4Int2(mu, sigma, h, k, tau, c(0.025, 0.5), c(0.5, 0.975), TRUE)
p12 <- qkappa4(0.5, mu, sigma, h, k)
kappa4Int2(mu, sigma, h, k, tau, c(p1, p12), c(p12, p2), FALSE)

mtloots/alR documentation built on May 23, 2019, 8:18 a.m.