gpfrPredict: Prediction of GPFR model

Description Usage Arguments Details Value References Examples

View source: R/gpfr.functions6.R

Description

Make predictions for test input data based on the GPFR model learnt by the 'gpfr' function. Both Type I and Type II predictions can be made.

Usage

1
2
3
4
5
6
7
8
9
gpfrPredict(
  train,
  testInputGP,
  testTime = NULL,
  uReg = NULL,
  fxReg = NULL,
  gpReg = NULL,
  GPpredict = TRUE
)

Arguments

train

An object of class 'gpfr' obtained by the the 'gpfr' function.

testInputGP

Test input data for the GP prediction. It must be a numeric vector, a matrix or an 'fd' object.

testTime

Test time points for prediction. If NULL, default settings will be applied.

uReg

Scalar covariates data of a new batch for the FR model.

fxReg

Functional covariates data of a new batch for the FR model.

gpReg

Input data for the GP part used for Type I prediction. It must be a list of three items. The names of the items must be 'response', 'input', and 'time'. The item 'response' is the observed response for a new batch; 'input' is the observed functional covariates for a new batch,;'time' is the observed time for the previous two. If NULL (default), Type II prediction is carried out.

GPpredict

Logical. If TRUE (default), GPFR prediction is carried out; otherwise only predictions based on the FR model is carried out.

Details

If 'gpReg' is provided, then Type I prediction is made. Otherwise, Type II prediction is made.

Value

A list containing:

ypred.mean

The mean values of the prediction.

ypred.sd

The standard deviation of the predictions.

predictionType

Prediction type if GPFR prediction is carried out.

train

All items trained by 'gpfr'.

References

Examples

1
2
## See examples in vignette:
# vignette("gpfr", package = "GPFDA")

Example output

Loading required package: fda.usc
Loading required package: fda
Loading required package: splines
Loading required package: Matrix
Loading required package: fds
Loading required package: rainbow
Loading required package: MASS
Loading required package: pcaPP
Loading required package: RCurl

Attaching package:fdaThe following object is masked frompackage:graphics:

    matplot

Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-33. For overview type 'help("mgcv-package")'.
----------------------------------------------------------------------------------
 Functional Data Analysis and Utilities for Statistical Computing
 fda.usc version 2.0.2 (built on 2020-02-17) is now loaded
 fda.usc is running sequentially usign foreach package
 Please, execute ops.fda.usc() once to run in local parallel mode
 Deprecated functions: min.basis, min.np, anova.hetero, anova.onefactor, anova.RPm
 New functions: optim.basis, optim.np, fanova.hetero, fanova.onefactor, fanova.RPm
----------------------------------------------------------------------------------

Loading required package: spam
Loading required package: dotCall64
Loading required package: grid
Spam version 2.5-1 (2019-12-12) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package:spamThe following object is masked frompackage:Matrix:

    det

The following objects are masked frompackage:base:

    backsolve, forwardsolve

GPFDA documentation built on Jan. 29, 2021, 5:14 p.m.