predict.GP.Rd
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"
.
Output from fitGP
.
Using the training data, loo
does leave-one-out prediction, lto
does
leave-timepoint-out prediction, and sequential
does sequential (leave-future-out)
prediction.
Data frame containing the same columns supplied in the original model.
New predictor matrix or vector. Not required if newdata
is supplied.
New population vector. Not required if newdata
is supplied.
New time vector. Not required if newdata
is supplied.
New response vector. Optional, unless E
and tau
were supplied in
lieu of x
. Not required if newdata
is supplied.
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 newdata
,
loo
, or lto
. If you want the in-sample gradient, pass the original dataset as
newdata
. Defaults to FALSE.
For predictmethod="loo"
and predictmethod="lto"
, the number of points
on either side of the focal point to leave out of the training data. Defaults to 0.
Other args (not used).
A list (class GPpred) with the following elements:
Data frame with out-of-sample predictions (if requested). predfsd
is the standard
deviation of the GP function, predsd
includes process error.
Fit statistics for out-of-sample predictions.
Only computed if using a predictmethod
, if y
is found in newdata
,
or if ynew
supplied (i.e. if the observed values are known).
If >1 population, fit statistics for out-of-sample predictions by population.
If returnGPgrad=T
, a data frame with the partial derivatives of the
function with respect to each input.