Learn R Programming

ldmppr (version 1.1.3)

ldmppr_grids: Create a grid schedule for estimate_process_parameters()

Description

ldmppr_grids() constructs a multi-resolution grid schedule used by estimate_process_parameters. The returned object is an S3 class with helper methods; see ldmppr_grids-class.

Usage

ldmppr_grids(upper_bounds, levels, labels = NULL, include_endpoints = TRUE)

Value

an object of class "ldmppr_grids".

Arguments

upper_bounds

a vector c(b_t, b_x, b_y) giving the maximum bounds for time and the spatial domain. Grids must lie within these.

levels

a list describing the grid schedule. Each entry can be either:

  • a numeric length-3 vector c(nx, ny, nt) (number of points per dimension),

  • a list with elements nx, ny, nt,

  • a list with explicit vectors x, y, t.

labels

(optional) character vector of length equal to levels, used only for printing.

include_endpoints

TRUE or FALSE indicating; if TRUE (default) each generated grid uses seq(0, bound, length.out = n) including endpoints.

See Also

ldmppr_grids-class for methods and details.

Examples

Run this code
# A 3-level coarse-to-fine schedule (counts per dimension)
g <- ldmppr_grids(
  upper_bounds = c(1, 50, 50),
  levels = list(
    c(25, 25, 25),
    c(75, 75, 75),
    c(100, 100, 100)
  )
)
g
length(g)
summary(g)

# Explicit vectors (single level)
g2 <- ldmppr_grids(
  upper_bounds = c(1, 50, 50),
  levels = list(list(
    x = seq(0, 50, by = 2),
    y = seq(0, 50, by = 2),
    t = seq(0, 1,  length.out = 30)
  ))
)
as.data.frame(g2)

Run the code above in your browser using DataLab