pffrGLS | R Documentation |
Implements additive regression for functional and scalar covariates and functional responses.
This function is a wrapper for mgcv
's gam
and its siblings to fit models of the general form
Y_i(t) = \mu(t) + \int X_i(s)\beta(s,t)ds + f(z_{1i}, t) + f(z_{2i}) + z_{3i} \beta_3(t) + \dots + E_i(t))
with a functional (but not necessarily continuous) response Y(t)
,
(optional) smooth intercept \mu(t)
, (multiple) functional covariates X(t)
and scalar covariates
z_1
, z_2
, etc. The residual functions E_i(t) \sim GP(0, K(t,t'))
are assumed to be i.i.d.
realizations of a Gaussian process. An estimate of the covariance operator K(t,t')
evaluated on yind
has to be supplied in the hatSigma
-argument.
pffrGLS(
formula,
yind,
hatSigma,
algorithm = NA,
method = "REML",
tensortype = c("te", "t2"),
bs.yindex = list(bs = "ps", k = 5, m = c(2, 1)),
bs.int = list(bs = "ps", k = 20, m = c(2, 1)),
cond.cutoff = 500,
...
)
formula |
a formula with special terms as for |
yind |
a vector with length equal to the number of columns of the matrix of functional responses giving the vector of evaluation points |
hatSigma |
(an estimate of) the within-observation covariance (along the responses' index), evaluated at |
algorithm |
the name of the function used to estimate the model. Defaults to |
method |
See |
tensortype |
See |
bs.yindex |
See |
bs.int |
See |
cond.cutoff |
if the condition number of |
... |
additional arguments that are valid for |
a fitted pffr
-object, see pffr
.
Note that hatSigma
has to be positive definite. If hatSigma
is close to positive semi-definite or badly conditioned,
estimated standard errors become unstable (typically much too small). pffrGLS
will try to diagnose this and issue a warning.
The danger is especially big if the number of functional observations is smaller than the number of gridpoints
(i.e, length(yind)
), since the raw covariance estimate will not have full rank.
Please see pffr
for details on model specification and
implementation.
THIS IS AN EXPERIMENTAL VERSION AND NOT WELL TESTED YET – USE AT YOUR OWN RISK.
Fabian Scheipl
pffr
, fpca.sc
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.