TABLE OF CONTENTS


CMetropolisHastings/UpdatePostvarCurve [ Functions ]

NAME

    UpdatePostvarCurve --- update prior variance for a CCurve

FUNCTION

Update the prior variance for the spline and parametric parameters of a hazard or frailty curve, with an inverse-gamma prior on the hyperparameters. See also updatepostvar.curve.

SYNOPSIS

2591 void UpdatePostvarCurve(curveP theCurve)

INPUTS

    theCurve      a CCurve structure

OUTPUTS

    theCurve      the input, with SplinePriorVar component updated

SOURCE

2595 {
2596     int c1 = 1;
2597     // spline prior variance
2598     if(theCurve->hasSpline) theCurve->SplinePriorvar[0] = rinvgamma(
2599             (double) theCurve->nj / 2 + theCurve->SplineHyper[0],
2600             theCurve->SplinePenaltyFactor[0] * SmoothnessPenalty(theCurve) * theCurve->SplinePriorvar[0] 
2601                 + theCurve->SplineHyper[1] );
2602 
2603     // parametric component prior variance
2604     if(theCurve->hasPar) theCurve->ParamPriorvar[0] = rinvgamma(
2605             (double) theCurve->np / 2 + theCurve->ParamHyper[0],
2606             pow(F77_CALL(dnrm2)(&(theCurve->np), theCurve->ParamPar, &c1),2)/2 + 
2607                 theCurve->ParamHyper[1] );
2608 }