wc {cyclomort}R Documentation

Wrapped Cauchy and Integrated Wrapped Cauchy functions

Description

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

Usage

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 \mu, concentration parameter \rho, and period \tau and are "unweighted", i.e.

\int_0^\tau f(t) dt = \tau

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^\tau f(t) dt = k\gamma\tau

Value

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

Examples


# 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)

[Package cyclomort version 1.0.2 Index]