Skip to contents

Auxiliary for Controlling pclm Fitting

Usage

control.pclm(lambda     = NA,
             kr         = 2,
             deg        = 3,
             int.lambda = c(0.1, 1e+5),
             diff       = 2,
             opt.method = c("BIC", "AIC"),
             max.iter   = 1e+3,
             tol        = 1e-3)

Arguments

lambda

Smoothing parameter to be used in pclm estimation. If lambda = NA an algorithm will find the optimal values. pclm takes a single value. pclm2D takes two, one for the age axis and one for the year axis, and either may be NA to be found by optimisation while the other is held fixed.

kr

Knot ratio. Number of internal intervals used for defining 1 knot in B-spline basis construction. See MortSmooth_bbase. Default 2 in control.pclm and 7 in control.pclm2D. In the two-dimensional model kr applies to both axes, so it must not exceed the length of the shorter one: a panel of fewer than kr years has no internal knot and is rejected.

deg

Degree of the splines needed to create equally-spaced B-splines basis over an abscissa of data. Default: 3, a cubic spline. Must be an integer of at least 2.

int.lambda

If lambda is optimized an interval to be searched needs to be specified. Format: vector containing the end-points. Default c(0.1, 1e5) in control.pclm and c(0.1, 1e3) in control.pclm2D. The optimum does sometimes land on a boundary; widen the interval if lambda comes back equal to an end-point.

diff

An integer indicating the order of differences of the components of PCLM coefficients. Default value: 2.

opt.method

Selection criterion of the model. Possible values are "AIC" and "BIC". Default: "BIC".

max.iter

Maximal number of iterations used in fitting procedure.

tol

Relative tolerance in PCLM fitting procedure. The iteration stops when the mean absolute relative error of the fitted bin totals falls below tol, or when that error stops changing by more than 0.1%, whichever comes first. Default: 1e-3. Note that it is a convergence tolerance on the fit, not an accuracy guarantee on the result. With a large lambda the penalty holds the fit away from the observed bins and the realized mean relative error can be several percent, because the second stopping rule fires long before tol is reached. Set tol = 1e-12 to see this: the fit does not move.

Value

A list with exactly eight control parameters.

See also

Examples

control.pclm()
#> $lambda
#> [1] NA
#> 
#> $kr
#> [1] 2
#> 
#> $deg
#> [1] 3
#> 
#> $int.lambda
#> [1] 1e-01 1e+05
#> 
#> $diff
#> [1] 2
#> 
#> $opt.method
#> [1] "BIC"
#> 
#> $max.iter
#> [1] 1000
#> 
#> $tol
#> [1] 0.001
#>