predict.ngme.spatial: Prediction.

View source: R/predict.ngme.spatial.R

predict.ngme.spatialR Documentation

Prediction.

Description

Spatial prediction and cross-validation.

Usage

## S3 method for class 'ngme.spatial'
predict(
  object,
  id = NULL,
  type = "Smoothing",
  data = NULL,
  quantiles = c(0.025, 0.975),
  controls = list(return.samples = FALSE, excursions = NULL, crps = TRUE, nSim = 1000,
    nBurnin = 100, silent = TRUE, seed = NULL, n.cores = 1)
)

Arguments

object

A fitted object obtained by calling "ngme.spatial".

id

A numeric vector containing the ID's of the replicates for whom predictions are to be obtained. Default is set to "NULL" indicating perform predictions for all replicates.

type

A character string for the type of prediction: "Smoothing" gives spatial prediction based on all available data, "LOOCV" gives leave-one-out crossvalidation where also a number of accuracy measures are calculated. For multivariate models, "LOOCV" gives cross-validation over observation locations (so the data for all dimensions are removed and predicted), whereas "LOOCV" gives crossvalidation over univariate observations.

quantiles

A two-element vector that contains the quantiles of the predictions to be calculated.

controls

A list of control variables.

  • "return.samples" A logical variable for returning the Monte Carlo samples used to compute the predictions; "TRUE" indicates return, "FALSE" do not return.

  • "excursions" A list of excursion probabilities to compute. Each list should contain:

    • "type" Type of excursion for indicating calculation of the probabilities, greater than or less than a threshol. User should specify "greater than" by ">" "less than" by "<".

    • "level" A numeric value for the threshold compute excursion probability for.

    • "process" A character string that for which component of the model the excursion probabilities to be calculated.

      • 'X' for latent process plus fixed and random effects,

      • 'W' for latent process,

      • 'Y' for data,

  • "crps" A logical variable for calculating continuous ranked probability score (CRPS); "TRUE" indicates calculate, "FALSE" do not calculate.

  • "nSim" A numerical value for the number of samples for the Gibbs sampler to obtain the predictions.

  • "nBurnin" A numeric value for the number of samples that are discarded as burn-in whilst calculating the predictions.

  • silent A logical value for printing the details; "TRUE" indicates do not print, "FALSE" indicates print.

  • n.cores Number of cores to use for paralell computations, default is set to 1. If larger than one, predictions over different replicates are computed in paralell.

Value

A list of output.

See Also

ngme.spatial

Examples

  ## Not run: 
  fit <- ngme.spatial(...)
  predict(fit, ...)
  
## End(Not run)

davidbolin/ngme documentation built on Dec. 5, 2023, 11:48 p.m.