50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

smoothSurv (version 2.6)

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

Description

Function to compute derivatives of exp(a) w.r.t. exp(d) where d stands for a shorter vector of 'a' G-spline coefficients.

Usage

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

Value

A matrix with ω coefficients.

Arguments

knots

A vector of G-spline knots μ.

sdspline

Standard deviation σ0 of the basis G-spline.

last.three

Indeces of the three 'a' G-spline coefficients which are expressed as a function of the remaining (g-3) 'a' 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(mu). Consequently, a[last.three[1]] <- 0.

all

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

Author

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

Details

To satisfy the three constraints j=1gcj=1, j=1gcjμj=0, j=1gcjμj2=1σ02 imposed on the G-spline we use the following parametrization: cj=exp(aj)l=1gexp(al),j=1,,g. The constraints can be solved such that a[last.three[1]] = 0 and a[last.three[2:3]] are expressed as a function of a[-last.three] in the following way: ak=log{ω0,k+jlast.threeωj,kexp(aj)},k=last.three[2],last.three[3], where ω coefficients are a function of knots and G-spline standard deviation. If we denote d the vector a[-last.three] this function computes derivatives of exp(a) w.r.t. exp(d) together with the intercept term used to compute exp(a) from exp(d). This is actually a matrix of ω coefficients. If we denote it as Ω then if all == TRUE exp(a)=Ω1,T+Ω1,Texp(d) and if all == FALSE exp(a[last.three[2:3]])=Ω1,T+Ω1,Texp(d).