Description Usage Arguments Details Value Author(s) See Also Examples
This function generates posterior predictive samples of latent and response variables for predicting locations.
1 2 3 4 |
res.m |
a list with elements containing the posterior samples of latent variables and parameters for observed locations |
loc |
a matrix which indicates the coordinates of the observed locations |
locp |
a matrix which indicates the coordinates of the predicting locations |
X |
the covariate matrix for observed locations |
Xp |
the covariate matrix for predicting locations |
Lp |
a vector which indicates the time duration during which the Poisson counts are accumulated or the total number of trials for Binomial response; if 0 is found in the vector, 1 will be used to replace all the values in the vector |
k |
a value for fixed κ; ignored if there are posterior samples for κ in "res.m" |
rho.family |
take the value of |
Y.family |
take the value of |
parallel |
the default input |
n.cores |
the number of CPUs that will be used for parallel computing; used only if |
cluster.type |
type of cluster to be used for parallel computing; can be "SOCK", "MPI", "PVM", or "NWS"; used only if |
This function performs parallel computing with the help of {multicore}
or {snowfall}
package. Be aware that {multicore}
package currently is not available in Windows (so set parallel="snowfall"
if you want to do parallel prediction in Windows).
A list with elements:
latent.predict |
a matrix containing the posterior predictive samples for latent variables |
Y.predict |
a matrix containing the posterior predictive samples for response variables |
Liang Jing ljing918@gmail.com
1 2 3 4 5 6 7 8 9 | ## Not run:
Ypred <- predY(res.m, loc, locp, X=loc, Xp=locp, k=1,
rho.family = "rhoPowerExp", Y.family = "Poisson")
# require(multicore)
# Ypred <- predY(res.m, loc, locp, X=loc, Xp=locp,
# parallel="multicore", n.cores = 4)
Ypred.avg <- rowMeans(Ypred$Y); EYpred.avg <- rowMeans(exp(Ypred$latent))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.