View source: R/predictLatentFactor.R
predictLatentFactor | R Documentation |
Draws samples from the conditional predictive distribution of latent factors
predictLatentFactor( unitsPred, units, postEta, postAlpha, rL, predictMean = FALSE, predictMeanField = FALSE )
unitsPred |
a factor vector with random level units for which predictions are to be made |
units |
a factor vector with random level units that are conditioned on |
postEta |
a list containing samples of random factors at conditioned units |
postAlpha |
a list containing samples of range (lengthscale) parameters for latent factors |
rL |
a |
predictMean |
a boolean flag indicating whether to return the mean of the predictive Gaussian process distribution |
predictMeanField |
a boolean flag indicating whether to return the samples from the mean-field distribution of the predictive Gaussian process distribution |
Length of units
vector and number of rows in
postEta
matrix shall be equal. The method assumes that
the i-th row of postEta
correspond to i-th element of
units
.
This method uses only the coordinates rL$s
field of the
rL$s
argument. This field shall be a matrix with rownames
covering the union of unitsPred
and units
factors. Alternatively, it can use distance matrix
rL$distMat
which is a symmetric square matrix with similar
row names as the coordinate data (except for the GPP models that
only can use coordinates).
In case of spatial random level, the computational complexity of
the generic method scales cubically as the number of unobserved
units to be predicted. Both predictMean=TRUE
and
predictMeanField=TRUE
options decrease the asymptotic
complexity to linear. The predictMeanField=TRUE
option
also preserves the uncertainty in marginal distribution of
predicted latent factors, but neglects the inter-dependece
between them.
a list of length length(postEta)
containing samples
of random factors at unitsPred
from their predictive
distribution conditional on the values at units
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.