TABLE OF CONTENTS


MetropolisHastings/updatepostvar.curve [ Functions ]

NAME

    updatepostvar.curve --- update the prior variance for a curve

FUNCTION

Updates the prior variance for the spline parameters of either the hazard or frailty curve, with an inverse-gamma prior and given hyperparameters.

SYNOPSIS

3109 updatepostvar.curve <- function(curve)

INPUTS

    curve      an RCurve structure

OUTPUTS

    curve      the updated curve

SOURCE

3112 {
3113     if(curve$hasspline) curve$spline.priorvar <- rinvgamma(1, length(curve$spline.par) /
3114         2 + curve$spline.hyper[1], scale = curve$spline.penaltyfactor * smoothpen(curve) *
3115         curve$spline.priorvar + curve$spline.hyper[2])
3116     if(curve$haspar) curve$param.priorvar <- rinvgamma(1, length(curve$param.par) /
3117         2 + curve$param.hyper[1], scale = sum(curve$param.par^2) / 2 + curve$param.hyper[2])
3118     return(curve)
3119 }