set_spline_options {opm}R Documentation

Spline options

Description

Function to set up spline options which can be passed to do_aggr.

Usage

  set_spline_options(type = c("tp.spline", "p.spline", "smooth.spline"),
    knots = NULL, gamma = 1,
    est.method = c("REML", "ML", "GCV"), s.par = NULL,
    correlation = NULL, save.models = FALSE,
    filename = NULL, ...)

Arguments

type

Character scalar. Specifies the spline type which should be fitted. This can be either thin plate splines (tp.spline), penalised B-splines (i.e, P-splines p.spline) or smoothing splines (smooth.spline).

knots

Integer scalar. Determines the number of knots. Per default, the number of knots is chosen adaptively to the number of unique observations. The default number also depends on the spline type.

gamma

Integer scalar. Specifies a constant multiplier to inflate the degrees of freedom in the "GCV" method to increase penalisation of models that are too close to the data and thus not smooth enough.

est.method

Character scalar. The smoothing parameter estimation method. Currently, only "REML", code"ML" and "GCV" are supported. This argument is ignored for type = "smooth.spline". For details see gam and gamm (see package mgcv).

s.par

list. Further arguments to be passed to the smoother s (see package mgcv). Note that the mgcv options k and bs are specified using type and knots in opm.

correlation

An optional "corStruct" object (see the help topic corClasses in the nlme package) as used to define correlation structures in package nlme. For better coverage of confidence intervals and slightly improved spline fits it is advised to use an AR process of order 1 or 2. However, this correction for auto-correlated error terms results in increased run time.

save.models

Should the models be saved (on the disk) for further inspections and plotting?

filename

File name of the models. Per default a name is auto-generated based on date and time. The file is always generated in the current working directory.

...

Additional arguments to be passed to gam or smooth.spline.

Value

List of options.

Author(s)

Benjamin Hofner

See Also

Other aggregation-functions: do_aggr


[Package opm version 1.3.63 Index]