data_generator_po_2d: Generate two-dimensional partially observed functional data

View source: R/data_generator.R

data_generator_po_2dR Documentation

Generate two-dimensional partially observed functional data

Description

Simulates a scalar response together with partially observed functional surfaces. The response is built from the integral of each surface against a fixed coefficient surface, and a rectangular region of each surface can be left unobserved.

Usage

data_generator_po_2d(
  n = 100,
  grid_x = 20,
  grid_y = 20,
  intercept = 0.6,
  noise_sd = 0.25,
  response_type = c("binomial", "gaussian"),
  signal_strength = 2.5,
  n_missing = 0,
  min_distance_x = NULL,
  min_distance_y = NULL,
  verbose = FALSE
)

Arguments

n

Number of surfaces to generate.

grid_x, grid_y

Number of grid points along each axis.

intercept

Model intercept. For the binomial response it is used as the target proportion of successes.

noise_sd

Standard deviation of the observation noise, relative to the standard deviation of each surface.

response_type

Response distribution, either "binomial" (the default) or "gaussian".

signal_strength

Multiplier controlling the magnitude of the true coefficient surface.

n_missing

Number of unobserved rectangular regions per surface (default 0, i.e. fully observed surfaces).

min_distance_x, min_distance_y

Minimum size of the unobserved regions along each axis.

verbose

If TRUE, print a short summary of the simulation. Defaults to FALSE.

Value

A list with the true surfaces (surfaces), the noisy surfaces (noisy_surfaces), the partially observed surfaces (noisy_surfaces_miss) together with the missing point information (miss_points, missing_points), the response, the true coefficient surface (beta), the grids (points_x, points_y) and additional simulation details.

Examples

set.seed(123)
sim <- data_generator_po_2d(n = 20, grid_x = 10, grid_y = 10,
                            response_type = "gaussian")
str(sim, max.level = 1)


VDPO documentation built on June 7, 2026, 9:08 a.m.