wc: Wrapped Cauchy and Integrated Wrapped Cauchy functions

Description Usage Arguments Details Value Examples

View source: R/wrappedCauchyFunctions.R

Description

Fundamental periodic hazard function, mixed hazard function, and their (analytical) integrals.

Usage

1
2
3
4
5
6
7
wc(t, mu, rho, tau)

iwc(t, mu, rho, tau)

mwc(t, mus, rhos, gammas, tau)

imwc(t, mus, rhos, gammas, tau)

Arguments

t

time (numeric, can be vectorized)

mu

mean peak

rho

concentration parameter (0 <= rho <= 1)

tau

period

mus

k-vector of mean peaks (assuming k seasons)

rhos

k-vector of concentration parameters

gammas

k-vector of average hazard values for each component

Details

These functions are mainly internal. wc and iwc are both parameterized in terms of peak mean μ, concentration parameter ρ, and period τ and are "unweighted", i.e.

\int_0^τ f(t) dt = τ

The mixture model versions, mwc and imwc, are correspondingly parameterized in terms of vectors mus, rhos, and also gammas which correspond to the mean hazard contribution of each peak, such that

\int_0^τ f(t) dt = kγτ

Value

numeric value (or vector of values of same length as t) of the respective function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# wrapped Cauchy functions
curve(wc(x, mu = 100, rho = .7, tau = 365), xlim = c(0,365), n = 1e4, 
      ylab = "hazard", xlab = "time")
curve(wc(x, mu = 100, rho = .5, tau = 365), add = TRUE, col = 2)
curve(wc(x, mu = 100, rho = .3, tau = 365), add = TRUE, col = 3)

# mixed wrapped Cauchy functions
curve(mwc(x, mus = c(0.125, 0.5), rhos = c(0.7, 0.5), 
          gammas = c(2, 1), tau = 1), xlim = c(0,1), ylab = "hazard", xlab = "time")
curve(mwc(x, mus = c(0.25, 0.75), rhos = c(0.3, 0.8), 
          gammas = c(0.6, 0.4), tau = 1), add = TRUE, col = 2)
curve(mwc(x, mus = c(0.25, 0.5, 0.75), rhos = c(0.6, 0.5, 0.4), 
          gammas = c(0.5, 0.2, 0.3), tau = 1), add = TRUE, col = 3)

cyclomort documentation built on Aug. 20, 2020, 5:06 p.m.