slooplot: A function to plot outputs of a spatial leave-one-out...

View source: R/slooplot.R

slooplotR Documentation

A function to plot outputs of a spatial leave-one-out cross-validation in R using INLA.

Description

This function plots the output of a spatial leave-one-out cross-validation (SLOO-CV) of one or several models running on INLA.

Usage

slooplot(
  alpha = alpha,
  df = df,
  mae = mae,
  ds = ds,
  family = family,
  ntrials = ntrials,
  sqroot = sqroot
)

Arguments

alpha

Numeric value (0,...,1) giving the threshold for computing confidence intervals (1-alpha) of rmse and mae estimation

df

dataframe (output of inla.sloo), which include the "Observed_response", "Predictions", "Residuals", RMSE, MAE (optional), and DS(optional)

mae

If TRUE, compute the mean absolute error (mae) and the root mean square error (rmse). If FALSE, compute the rmse only.

ds

If TRUE, compute the Dawid-Sebastiani score (ds). If FALSE, does not compute ds.

family

Character string or list of Character string giving the family or families, respectively of the response in INLA format

ntrials

Numeric value (1,2,...) setting the number of trials for a Binomial family

sqroot

If TRUE, compute the square root of the observed and predicted values to generate the rmse and/or mae.

Examples

## Not run: 
 # SLOO function with one model formula (Bernoulli)
 df<-data.frame(Residuals=runif(10, 0.0, 1.0),RMSE=runif(10, 0.0, 2.0),MAE=runif(10, 0.0, 2.0),
 Observed_response= sample(c(0,1), replace=TRUE, size=10),Predictions=runif(10, 0.0, 1.0))
 alpha = 0.05
 family = bernoulli
 slooplot1<-slooplot(df=df, alpha=0.05,mae=TRUE,ds=FALSE,family='bernoulli',sqroot=FALSE)
 
## End(Not run)

timcdlucas/INLAutils documentation built on Nov. 29, 2022, 5:41 a.m.