TABLE OF CONTENTS
01structures/CCurve [ Definitions ]
NAME
CCurve --- structure to store a curve
FUNCTION
This structure contains all the information about a curve, either the hazard or the frailty. This includes all parameters for spline components, parametric components, weights, and knot positions, as well as spline basis functions, tuning parameters, etc. It is the C analogoue of the RCurve structure.
Note that many of the elements of the structure are pointers. This allows the memory allocated by R to be used directly, rather than having to re-allocate memory within C.
The components are described by commments in the source.
SOURCE
254 typedef struct curve { 255 int hasSpline, //has a spline component 256 hasPar, //has a parametric component 257 isHazard, //whether the curve represents hazard or frailty 258 SplineOrd, // order of the spline 259 SplineAdaptive, // whether the knots should birth/death/move 260 SplineNknots, //spline number of interior knots 261 SplineNknotsMax, // max number of knots 262 SplineNCandKnots, // number of candidate knots 263 nx, //number of observations 264 nj, //number of basis functions (spline) 265 njmax, // max value of nj 266 np, // number of parameters (parametric) 267 SplineFixedInd; // fixed index for frailty spline 268 double SplineFvar, // frailty variance 269 SplineEParSum; // sum of exponentials of spline parameters 270 penalty SplinePenaltyType; // (0=none, 1=diff, 2=2deriv, 3=log2der) 271 distribution ParDist; // Parametric distribution function 272 nknotsprior SplineNknotsPrior; 273 double *SplineKnots, //Knots of the spline 274 *SplineCandKnots, // Candidate knots for adaptive spline 275 *SplineCandOcc, // occupied indices for the spline candidate knots 276 *SplineNknotsHyper, // parameter for prior on the number of knots 277 *SplineBDMConst, //Tuning parameter for birth-death-move 278 *SplineBasis, //Basis of the spline 279 *SplineBasisCum, //Cumulative basis 280 *SplineBasisInt, //Integral over the basis functions 281 *SplineBasisExp, //Expectation of each spline component 282 *SplinePar, //Spline parameters (theta) 283 *SplineEPar, // exponential of Spline parameters (theta) 284 *SplineMin, // minimum recommended parameter value 285 *SplinePenaltyMatrix, // Penalty matrix on spline parameters 286 *SplinePenaltyFactor, // Weight factor for smoothness penalty 287 *SplineMeanPenalty, // penalty on the mean (frailty only) 288 *SplinePriorvar, //prior variance 289 *SplineHyper, //Spline Hyperparameters 290 *SplineCandCov, // Covariance matrix of candidates 291 *SplineCandSD, // standard deviations of candidates 292 *SplineCholCov, //Covariance matrix Cholesky decomposition 293 *SplineTun, // Tuning parameter for spline parameters 294 *SplineAccept, // Acceptance indicator for spline parameters 295 *ParamPar, //Parametric component parameters 296 *ParamPriorvar, // Parametric Prior variance 297 *ParamCandCov, // Candidate covariance 298 *ParamCholCov, // Candidate covariance Cholesky 299 *ParamTun, // Parametric tuning parameter 300 *ParamHyper, //Parametric hyperparameters 301 *ParamAccept, // Acceptance indicator for parametric parameters 302 *Weight, // Weight of spline component 303 *WeightPriorvar, //Prior variance of weight 304 *WeightTun, //Tuning parameter for weight 305 *WeightHyper, //Hyperparameters for weight 306 *WeightAccept, // Acceptance for weight 307 *Accept, // Acceptance indicator for x (only used by frailty) 308 *tun, // Tuning parameter (general) 309 *X, // Observations 310 *SplineY, // Spline estimates 311 *ParamY, // Parametric estimates 312 *Y, // estimates 313 *SplineYcum, // Spline cumulative 314 *ParamYcum, // parametric cumulative 315 *Ycum; // Cumulative 316 } *curveP;