Mainly intended for internal use with location scale model families.
Given the derivatives of the log-likelihood wrt the linear predictor, this function obtains
the derivatives and Hessian wrt the regression coefficients and derivatives of
the Hessian w.r.t. the smoothing parameters. For input derivative array packing conventions see trind.generator
.
gamlss.gH(X, jj, l1, l2, i2, l3 = 0, i3 = 0, l4 = 0, i4 = 0, d1b = 0,
d2b = 0, deriv = 0, fh = NULL, D = NULL)
matrix containing the model matrices of all the linear predictors.
list of index vectors such that X[,jj[[i]]]
is the model matrix of the i-th linear predictor.
array of 1st order derivatives of each element of the log-likelihood wrt each parameter.
array of 2nd order derivatives of each element of the log-likelihood wrt each parameter.
two-dimensional index array, such that l2[,i2[i,j]]
contains the partial w.r.t. params
indexed by i,j with no restriction on the index values (except that they are in 1,...,ncol(l1)).
array of 3rd order derivatives of each element of the log-likelihood wrt each parameter.
third-dimensional index array, such that l3[,i3[i,j,k]]
contains the partial w.r.t. params
indexed by i,j,k.
array of 4th order derivatives of each element of the log-likelihood wrt each parameter.
third-dimensional index array, such that l4[,i4[i,j,k,l]]
contains the partial w.r.t. params
indexed by i,j,k,l.
first derivatives of the regression coefficients wrt the smoothing parameters.
second derivatives of the regression coefficients wrt the smoothing parameters.
if deriv==0
only first and second order derivatives will be calculated. If
deriv==1
the function return also the diagonal of the first derivative of the Hessian,
if deriv==2
it return the full 3rd order derivative and if deriv==3
it provides
also 4th order derivatives.
eigen-decomposition or Cholesky factor of the penalized Hessian.
diagonal matrix, used to provide some scaling.
A list containing lb
- the grad vector w.r.t. coefs; lbb
- the Hessian matrix w.r.t. coefs;
d1H
- either a list of the derivatives of the Hessian w.r.t. the smoothing parameters, or a single matrix whose columns are the leading diagonals of these dervative matrices; trHid2H
- the trace of the inverse Hessian multiplied by the second derivative of the Hessian w.r.t. all combinations of smoothing parameters.