Genentech / jmpost

https://genentech.github.io/jmpost/
17 stars 4 forks source link

Add shrinkage parameter to GSF & SF models #383

Closed gowerc closed 2 months ago

gowerc commented 2 months ago

Example code:

link_ks <- function(prior = prior_normal(0, 1)) {
    LinkComponent(
        key = "link_ks",
        stan = StanModule("
            functions {
                matrix link_ks_contrib(
                    matrix time,
                    matrix link_function_inputs
                ) {
                    return rep_matrix(log(link_function_inputs[,2]), cols(time));
                }
            }
        "),
        prior = prior
    )
}

JointModel(
    longitudinal = LongitudinalGSF(),
    survival = SurvivalExponential(),
    link = Link(
        link_ks(prior = prior_normal(0, 0.2))
    )
)