-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
63 lines (48 loc) · 2.07 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
output:
github_document:
toc: true
#always_allow_html: true
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
## R package `dfr.dist`: dynamic failure rate (DFR) distributions
<!-- badges: start -->
<!-- badges: end -->
An R package for working with models in survival analysis in which the distribution is
parameterized by a very flexible failure rate function, which is any function that
satisfies properties like being non-negative, integrating to infinity over the domain,
and having a support of `(0, Inf)`.
### Installation
You can install the development version of `dfr.dist` from GitHub repo with:
```{r,eval=F}
# install.packages("devtools")
devtools::install_github("queelius/dfr_dist")
```
### Usage
The R packge `dfr_dist` provides an API for specifying and estimating dynamic failure
rate distributions. They can depend on the data in any way, as the failure rate is
any function of time and any set of predictors, as long as the failure rate satsifies
two key properties:
1. It's non-negative. It is not meaningful to have a negative failure rate; the
failure rate can decrease some times, and even go to $0$, though.
2. At the limit as $t$ goes to infinity, the cumulative hazard $H$ also goes to
infinity:
$$
\lim_{t \to \infty} H(t, x_1, \ldots, x_p) = \infty,
$$
where $H(t, x_1, \ldots, x_p) = \int_{0}^t h(u, x_1, \ldots, x_p) du$.
If this constraint isn't satisfied, then the survival function is not well-defined,
since it is defined as $S(t) = \exp\bigl\{-H(t)\bigr\}$.
The `dfr_dist` object satisfies all of the requirements of an algebraic distribution
(see `algebraic.dist`) and a likelihoood model (see `likelihood.model`).
The package is designed to be used with the `algebraic.mle` package, which provides a
framework for performing maximum likelihood estimation (MLE).
A vignette showing how to use it is [here](https://queelius.github.io/dfr_dist/articles/failure_rate.html).