derivative.cc3 {smoothSurv} | R Documentation |
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.
derivative.cc3(knots, sdspline, last.three, all = TRUE)
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
|
all |
If |
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.
A matrix with omega coefficients.
WARNING: This function was primarily used inside smoothSurvReg
.
Consequently, it has very few error checks on its input arguments.
Arnošt Komárek arnost.komarek[AT]mff.cuni.cz