https://github.com/insightsengineering/jointsurvivalmodels.jl
Julia implementation of joint models combining longitudinal and survival endpoints
https://github.com/insightsengineering/jointsurvivalmodels.jl
joint-models julia
Last synced: about 1 year ago
JSON representation
Julia implementation of joint models combining longitudinal and survival endpoints
- Host: GitHub
- URL: https://github.com/insightsengineering/jointsurvivalmodels.jl
- Owner: insightsengineering
- License: mit
- Created: 2023-10-07T13:01:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-15T16:25:57.000Z (about 2 years ago)
- Last Synced: 2025-03-26T12:51:15.106Z (about 1 year ago)
- Topics: joint-models, julia
- Language: Julia
- Homepage: https://insightsengineering.github.io/JointSurvivalModels.jl/
- Size: 412 KB
- Stars: 13
- Watchers: 6
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JointSurvivalModels.jl
This package implements joint models in Julia. It was designed to support the modeling of joint models with probabilistic programming, for example using the [Turing.jl](https://github.com/TuringLang/Turing.jl) framework. Install it with:
```julia
using Pkg
Pkg.add("JointSurvivalModels")
```
The `JointSurvivalModel` implements a canonical formulation of joint models. It based on a hazard function
$h(t) = h_0(t) \exp(\gamma' \cdot L(M(t)))$ with a baseline hazard $h_0$ and a link to joint models $L(M(t))$. For a more detailed explanation see the [documentation](https://insightsengineering.github.io/JointSurvivalModels.jl/dev/).
## Example
The hazard of the exponential distribution $\text{Exp}(\alpha)$ is the constant function $x\mapsto \alpha$. For the joint longitudinal model we use a simple cosinus function. The joint hazard is then $h(t) = \alpha \exp(\gamma * \cos(t))$.
```julia
using JointSurvivalModels
constant_alpha(x) = 0.2
γ = 0.5
jm = JointSurvivalModel(constant_alpha, γ, cos)
```
Plotting the survival function vs the baseline hazard:
```julia
using StatsPlots, Distributions
r = range(0,12,100)
plot(r, ccdf(Exponential(1/0.2), r), label="Baseline survival")
plot!(r, ccdf(jm, r), label="Joint Survival")
```
For a more instructive example take a look at the documentation [first example](https://insightsengineering.github.io/JointSurvivalModels.jl/dev/FirstExample/) or the case study found in `example/`.
## Contribute
Contributions are welcome, the issue tracker is a good place to start.
## License
This project is licensed under the terms of the MIT license.