tulpa_hyper_grid_supports: Per-axis integrated support of an outer grid

View source: R/hyper_quadrature.R

tulpa_hyper_grid_supportsR Documentation

Per-axis integrated support of an outer grid

Description

The natural-scale support of every axis in specs that carries one, as a named list of intervals – the region each axis's outer-grid measure actually integrates, including levels a refinement pass added. Intended for recovering an axis's integrated span from a settled grid, e.g. so a sampled-hyperparameter prior can be derived from what the outer integration used rather than restated alongside it.

Usage

tulpa_hyper_grid_supports(theta_grid, specs, refining = NULL)

Arguments

theta_grid

A named ⁠[n_cells x n_axes]⁠ matrix (see tulpa_theta_matrix()).

specs

Per-axis spec list, e.g. from tulpa_joint_axis_specs_from_grid().

refining

Optional per-cell refinement tag vector (see tulpa_hyper_slice_home()).

Value

A named list of natural-scale c(lo, hi) intervals, one per axis in specs that carries a declared coordinate, or NULL if theta_grid or specs is NULL.

See Also

tulpa_joint_axis_specs_from_grid(), tulpa_hyper_slice_home()

Examples


set.seed(1)
S <- 30L                                   # spatial units in a chain
nb <- lapply(seq_len(S), function(s) setdiff(c(s - 1L, s + 1L), c(0L, S + 1L)))
nn <- lengths(nb)
field <- as.numeric(scale(cumsum(rnorm(S, 0, 0.4))))
idx <- rep(seq_len(S), each = 6L); n <- length(idx); x <- rnorm(n)
y <- rbinom(n, 1L, plogis(-0.2 + 0.6 * x + field[idx]))
prior <- list(type = "icar", n_spatial_units = S, spatial_idx = idx,
              adj_row_ptr = c(0L, cumsum(nn)), adj_col_idx = unlist(nb) - 1L,
              n_neighbors = nn, tau_grid = c(0.5, 1, 2, 4, 8))
fit <- tulpa_nested_laplace(y, rep(1L, n), cbind(1, x), prior = prior,
                            family = "binomial",
                            control = list(progress = FALSE))
tg <- tulpa_theta_matrix(fit)
tulpa_hyper_grid_supports(tg, tulpa_joint_axis_specs_from_grid(tg))


tulpa documentation built on Oct. 19, 2026, 5:09 p.m.