Skip to contents

Creates synthetic 1D functional data with optional noise components and different coefficient patterns. Uses trapezoidal rule for integration.

Usage

generate_1d_po_functional_data(
  n = 100,
  grid_points = 100,
  noise_sd = 0.015,
  rsq = 0.95,
  beta_type = c("sin", "gaussian"),
  n_missing = 1,
  min_distance = NULL
)

Arguments

n

Number of samples to generate

grid_points

Number of points in the grid. Default is 100

noise_sd

Standard deviation of measurement noise. Default is 0.015

rsq

Desired R-squared value for the response. Default is 0.95

beta_type

Type of coefficient function ("sin" or "gaussian"). Default is "sin"

n_missing

Number of missing segments per curve. Default is 1

min_distance

Minimum length of missing segments. Default is NULL (auto-calculated)

Value

A list containing:

  • curves: List of n true (noiseless) curves

  • noisy_curves: List of n observed (noisy) curves

  • noisy_curves_miss: List containing curves with missing values

  • response: Vector of n response values

  • grid: Grid points

  • beta: True coefficient function

  • stochastic_components: Vector of a values used for each curve