---
title: "Distributions"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Distributions}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

`fssg` comes with a number of native distributions. These distributions are custom built, or sourced from other great R packages. The below table gives additional information on all included distributions. 

Please note, AFT/PH specifications are based on model results reviewing by the fssg author team, and may not perfectly reflect how the distribution works in reality. In general, for distributions marked as AFT, a higher effect size (i.e. a positive one) usually implies longer survival time. For distributions marked as PH, a higher effect size usually implies a higher hazard rate. Please take the time to verify that your interpretation of these coefficients is consistent with the model's prediction before publishing or reporting. 


```{r setup, echo=F}
library(fssg)


names <- names(fssg_dist_list())
dist  <- c('Generalized F',
  'Generalized F (alternative)',
  'Generalized Gamma',
  'Generalized Gamma (alternayive)',
  'Exponential',
  'Weibull',
  'Weibull (PH form)',
  'Log Normal',
  'Gamma',
  'Gompertz',
  'Log-Logistic',
  'Exponential',
  'Lognormal',
  'Beta-Prime',
  'Cauchy',
  'Cauchy',
  'Dagum',
  'Exponential Logarithm',
  'Generalized Extreme Value',
  'Generalized Extreme Value',
  'Fatigue / Birnbaum Saunders (No location parameter)',
  'Fatigue / Birnbaum Saunders',
  'Fatigue / Birnbaum Saunders',
  'Fold-Normal',
  'Fold-Normal',
  'Feller-Pareto',
  'Frechet',
  'Gamma-Gompertz',
  'Gumbel',
  'Gumbel Type II',
  'Hypertabatastic',
  'Hypertabatastic',
  'Inverse Chi-squared',
  'Inverse Gamma',
  'Inverse Gaussian',
  'Inverse Gaussian',
  'Inverse Lindley',
  'Laplace',
  'Levy',
  'Lindley',
  'Log Cauchy',
  'Lomax',
  'Lomax',
  'Nakagami',
  'Pareto I',
  'Pareto II',
  'Pareto III',
  'Pareto IV',
  'Rayleigh',
  'Rice',
  'Rice',
  'Shifted Gompertz',
  'Singh Madalla / Burr Type 12',
  'Scaled Inverse Chi-squared'
)

source <- c('flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'flexsurv',
  'extraDistr',
  'stats',
  'stats',
  'VGAM',
  'VGAM',
  'extraDistr',
  'extraDistr',
  'extraDistr',
  'extraDistr',
  'extraDistr',
  'VGAM',
  'VGAM',
  'actuar',
  'extraDistr',
  'fssg',
  'extraDistr',
  'VGAM',
  'fssg',
  'fssg',
  'extraDistr',
  'extraDistr',
  'VGAM',
  'VGAM',
  'fssg',
  'extraDistr',
  'VGAM',
  'VGAM',
  'fssg',
  'extraDistr',
  'extraDistr',
  'VGAM',
  'VGAM',
  'VGAM',
  'VGAM',
  'VGAM',
  'extraDistr',
  'VGAM',
  'VGAM',
  'extraDistr',
  'VGAM',
  'extraDistr')

var <- c('mu',
'mu',
'mu',
'scale',
'rate',
'scale',
'scale',
'meanlog',
'rate',
'rate',
'scale',
'rate',
'meanlog',
'scale',
'scale',
'location',
'scale',
'scale',
'sigma (scale)',
'mu (location)',
'beta(scale)',
'beta(scale)',
'mu (location)',
'sd',
'mean',
'rate',
'sigma (scale)',
'b (scale)',
'sigma (scale)',
'scale',
'a ',
'b',
'nu',
'beta (scale)',
'mu (location)',
'lambda (scale)',
'theta',
'sigma (scale)',
'scale',
'theta',
'mu (location)',
'lambda (scale)',
'kappa (shape)',
'scale',
'scale',
'scale',
'scale',
'scale',
'sigma',
'vee',
'sigma',
'b',
'scale',
'tau'
)

direc <- c(
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'PH',
  'AFT',
  'PH',
  'AFT',
  'AFT',
  'PH',
  'AFT',
  'PH',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'Unclear',
  'PH',
  'AFT',
  'PH',
  'AFT',
  'AFT',
  'PH',
  'PH',
  'PH',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'PH',
  'AFT', 
  'PH',
  'PH',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'AFT',
  'PH',
  'AFT',
  'AFT'
)

knitr::kable(data.frame(
  fssg_names = names, 
  distribution=dist,
  package_source=source,
  varying_parameter=var,
  model_specification=direc
))
```
