Learn R Programming

spconform (version 0.1.1)

coverage_report: Empirical Coverage and Average Interval Width for an spconform Object

Description

Empirical Coverage and Average Interval Width for an spconform Object

Usage

coverage_report(object, y_true)

Value

A named list with coverage (proportion of y_true

falling within [lower, upper]) and mean_width (average interval width).

Arguments

object

An object of class "spconform".

y_true

Numeric vector of true observed values at the prediction locations, same length/order as object$pred.

Examples

Run this code
set.seed(1)
n <- 20
adj <- matrix(0, n, n)
for (i in 1:(n - 1)) { adj[i, i + 1] <- 1; adj[i + 1, i] <- 1 }
y <- cumsum(rnorm(n))
out <- scp_areal(y, adjacency = adj, alpha = 0.2)
coverage_report(out, y)

Run the code above in your browser using DataLab