plot.glmmfields: Plot predictions from an glmmfields model

View source: R/plot.R

plot.glmmfieldsR Documentation

Plot predictions from an glmmfields model

Description

Plot predictions from an glmmfields model

Usage

## S3 method for class 'glmmfields'
plot(
  x,
  type = c("prediction", "spatial-residual", "residual-vs-fitted"),
  link = TRUE,
  ...
)

Arguments

x

An object returned by glmmfields

type

Type of plot

link

Logical: should the plots be made on the link scale or on the natural scale?

...

Other arguments passed to predict.glmmfields

Examples


# Spatiotemporal example:
set.seed(1)
s <- sim_glmmfields(n_draws = 12, n_knots = 12, gp_theta = 1.5,
gp_sigma = 0.2, sd_obs = 0.1)
# options(mc.cores = parallel::detectCores()) # for parallel processing
m <- glmmfields(y ~ 0, time = "time",
 lat = "lat", lon = "lon", data = s$dat,
 nknots = 12, iter = 600, chains = 1)
x <- plot(m, type = "prediction")
x
x + ggplot2::scale_color_gradient2()
plot(m, type = "spatial-residual")
plot(m, type = "residual-vs-fitted")


glmmfields documentation built on Oct. 21, 2023, 1:06 a.m.