iwls_1d() fits the 1ts model with IWLS algorithm.
Usage
iwls_1d(
r,
y,
Bs,
P,
Wprior = NULL,
control_algorithm = list(maxiter = 20, conv_crit = 1e-05, verbose = FALSE)
)Arguments
- r
A vector of exposure times of length ns.
- y
A vector of event counts of length ns.
- Bs
A matrix of B-splines for the
stime scale of dimension ns by cs.- P
The penalty matrix of dimension cs by cs.
- Wprior
An optional vector of length ns of a-priori weights.
- control_algorithm
A list with optional values for the parameters of the iterative processes:
maxiterThe maximum number of iteration for the IWSL algorithm. Default is 20.conv_critThe convergence criteria, expressed as difference between estimates at iteration i and i+1. Default is1e-5.verboseA Boolean. Default isFALSE. IfTRUEmonitors the iteration process.
Value
A list with the following elements:
alphaThe vector of estimated P-splines coefficients of length cs.SE_alphaThe vector of estimated Standard Errors for thealphacoefficients, of length cs.HThe hat-matrix.CovThe full variance-covariance matrix.devianceThe deviance.edThe effective dimension of the model.aicThe value of the AIC.bicThe value of the BIC.Bbasesa list with the B-spline basisBs(this is a list for compatibility with functions in 2d).