predict.GP | R Documentation |
Obtain predictions from a fitted GP model. There are several options:
(Default) Use predictmethod="loo"
for leave-one-out prediction using the training data.
Use predictmethod="lto"
for leave-timepoint-out prediction using the training data. This will leave
out values with the same time index across multiple populations, rather than each individual datapoint.
If there is only one population, "lto"
will be equivalent to "loo"
.
Use predictmethod="sequential"
for sequential (leave-future-out) prediction using the training data.
If data frame data
was supplied, supply data frame newdata
containing same column names.
Column for y
is optional, unless E
and tau
were supplied in lieu of x
.
If vectors/matrices were supplied for y
, x
, etc, equivalent vector/matrices xnew
,
popnew
(if pop
was supplied), and timenew
(optional).
ynew
is optional, unless E
and tau
were supplied in lieu of x
.
It should be noted that "loo"
is not a "true" leave-one-out, for although each prediction is
made by removing one of the training points, the hyperparameters are fit using all of the training data.
The same goes for "sequential"
and "lto"
.
## S3 method for class 'GP'
predict(
object,
predictmethod = c("loo", "lto", "sequential"),
newdata = NULL,
xnew = NULL,
popnew = NULL,
timenew = NULL,
ynew = NULL,
returnGPgrad = FALSE,
exclradius = 0,
...
)
object |
Output from |
predictmethod |
Using the training data, |
newdata |
Data frame containing the same columns supplied in the original model. |
xnew |
New predictor matrix or vector. Not required if |
popnew |
New population vector. Not required if |
timenew |
New time vector. Not required if |
ynew |
New response vector. Optional, unless |
returnGPgrad |
Return the gradient (derivative) of the GP model at each time point with
respect to each input. This is only computed for out-of-sample predictions using |
exclradius |
For |
... |
Other args (not used). |
A list (class GPpred) with the following elements:
outsampresults |
Data frame with out-of-sample predictions (if requested). |
outsampfitstats |
Fit statistics for out-of-sample predictions.
Only computed if using a |
outsampfitstatspop |
If >1 population, fit statistics for out-of-sample predictions by population. |
GPgrad |
If |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.