Function to compute derivatives of exp(a) w.r.t. exp(d) where d stands for a shorter vector of 'a' G-spline coefficients.
derivative.expAD(knots, sdspline, last.three, all = TRUE)
A matrix with
A vector of G-spline knots
Standard deviation
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
.
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.
Arnošt Komárek arnost.komarek@mff.cuni.cz
To satisfy the three constraints
a[last.three[1]] = 0
and
a[last.three[2:3]]
are expressed as a function of
a[-last.three]
in the following way:
a[-last.three]
this function computes
derivatives of all == TRUE
all == FALSE