predict_sof_pc | R Documentation |
Predict new observations of the scalar response variable and calculate the corresponding prediction error, with prediction interval limits, given new observations of functional covariates and a fitted scalar-on-function linear regression model
predict_sof_pc(
object,
y_new = NULL,
mfdobj_x_new = NULL,
alpha = 0.05,
newdata
)
object |
A list obtained as output from |
y_new |
A numeric vector containing the new observations of the scalar response variable to be predicted. |
mfdobj_x_new |
An object of class |
alpha |
A numeric value indicating the Type I error
for the regression control chart
and such that this function returns the |
newdata |
Deprecated, use |
A data.frame
with as many rows as the
number of functional replications in newdata
,
with the following columns:
fit
: the predictions of the response variable
corresponding to new_data
,
lwr
:
lower limit of the 1-alpha
prediction interval
on the response, based on the assumption that it is normally distributed.
upr
:
upper limit of the 1-alpha
prediction interval
on the response, based on the assumption that it is normally distributed.
res
:
the residuals obtained as the values of y_new
minus their
fitted values. If the scalar-on-function model has been fitted with
type_residual == "studentized"
, then the studentized residuals
are calculated.
C. Capezza
library(funcharts)
data("air")
air <- lapply(air, function(x) x[1:10, , drop = FALSE])
fun_covariates <- c("CO", "temperature")
mfdobj_x <- get_mfd_list(air[fun_covariates], lambda = 1e-2)
y <- rowMeans(air$NO2)
mod <- sof_pc(y, mfdobj_x)
predict_sof_pc(mod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.