derivative.cc3: Work Function for 'smoothSurvReg', currently nowhere used

View source: R/convertCDA.R

derivative.cc3R Documentation

Work Function for 'smoothSurvReg', currently nowhere used

Description

Function to compute derivatives of all 'c' G-spline coefficients with respect to chosen (g - 3) coefficients such that the whole vector of g 'c' coefficients satisfies the constraints.

Usage

derivative.cc3(knots, sdspline, last.three, all = TRUE)

Arguments

knots

A vector of G-spline knots mu.

sdspline

Standard deviation sigma0 of the basis G-spline .

last.three

Indeces of the three 'c' G-spline coefficients which are expressed as a function of the remaining (g - 3) 'c' G-spline coefficients such that the three constraints are satisfied. This must be a vector of length 3 with three different numbers from 1:length(knots).

all

If TRUE, matrix (g - 2) x g (there is one zero column) is returned. If FALSE, matrix (g - 2) x 3 is returned. The first row is always an intercept. See details.

Details

To satisfy the three constraints

c[1] + ... c[g] = 1,

c[1]mu[1] + ... c[g]mu[g] = 0,

c[1]mu[1]^2 + ... c[g]mu[g]^2 = 1 - sigma0^2

imposed on the G-spline we can express the three 'c' coefficients as a function of the remaining g - 3 'c' coefficients in the following way.

c[k] = omega[0,k] + sum[j != last.three]omega[j,k] c[j], k = last.three[1], last.three[2], last.three[3],

where omega coefficients are a function of knots and G-spline standard deviation. If we denote d the vector c[-last.three] this function computes derivatives of c w.r.t. d together with the intercept term used to compute c from d. This is actually a matrix of omega coefficients. If we denote it as Omega then if all == TRUE

c = t(Omega_[1,]) + t(Omega[-1,]) d

and if all == FALSE

c[last.three] = t(Omega_[1,]) + t(Omega[-1,]) d.

Value

A matrix with omega coefficients.

Note

WARNING: This function was primarily used inside smoothSurvReg. Consequently, it has very few error checks on its input arguments.

Author(s)

Arnošt Komárek arnost.komarek@mff.cuni.cz


smoothSurv documentation built on Oct. 11, 2022, 1:05 a.m.