Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

funRsquared

Functional R-squared


Description

Calculates the functional R-squared for a fitted FDboost-object

Usage

funRsquared(object, overTime = TRUE, breaks = object$yind, global = FALSE, ...)

Arguments

object

fitted FDboost-object

overTime

per default the functional R-squared is calculated over time if overTime=FALSE, the R-squared is calculated per curve

breaks

an optional vector or number giving the time-points at which the model is evaluated. Can be specified as number of equidistant time-points or as vector of time-points. Defaults to the index of the response in the model.

global

logical. defaults to FALSE, if TRUE the global R-squared like in a normal linear model is calculated

...

currently not used

Details

breaks should be set to some grid, if there are many missing values or time-points with very few observations in the dataset. Otherwise at these points of t the variance will be almost 0 (or even 0 if there is only one observation at a time-point), and then the prediction by the local means μ(t) is locally very good. The observations are interpolated linearly if necessary.

Formula to calculate R-squared over time, overTime=TRUE:
R^2(t) = 1 - ∑_{i}( Y_i(t) - \hat{Y}_i(t))^2 / ∑_{i}( Y_i(t) - \bar{Y}(t) )^2

Formula to calculate R-squared over subjects, overTime=FALSE:
R^2_i = 1 - \int (Y_i(t) - \hat{Y}_i(t))^2 dt / \int (Y_i(t) - \bar{Y}_i )^2 dt

Value

Returns a vector with the calculated R-squared and some extra information in attributes.

Note

breaks cannot be changed in the case the bsignal() is used over the same domain as the response! In that case you would have to rename the index of the response or that of the covariates.

References

Ramsay, J., Silverman, B. (2006). Functional data analysis. Wiley Online Library. chapter 16.3


FDboost

Boosting Functional Regression Models

v1.0-0
GPL-2
Authors
Sarah Brockhaus [aut], David Ruegamer [aut, cre], Almond Stoecker [aut], Torsten Hothorn [ctb], with contributions by many others (see inst/CONTRIBUTIONS) [ctb]
Initial release
2020-08-31

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.