Learn R Programming

refund (version 0.1-40)

pffrSim_formula: Generate data from formula specification

Description

Internal function that generates simulated data based on a pffr formula.

Usage

pffrSim_formula(
  formula,
  n,
  yind,
  xind,
  data = NULL,
  effects = list(),
  intercept = "beta",
  SNR = 10,
  family = gaussian(),
  propmissing = 0,
  limits = NULL,
  wiggliness = 1,
  k_truth = list()
)

Value

A data frame with simulated data and truth attributes.

Arguments

formula

A formula specifying the model structure.

n

Number of observations.

yind

Numeric vector of y (response) evaluation points.

xind

Numeric vector of x (functional covariate) evaluation points.

data

Optional data frame with pre-generated covariates.

effects

Named list mapping term names to effect specifications. For concurrent terms, use list syntax: `list(Xc = list(type = "concurrent", effect = "sine"))`.

intercept

Intercept specification (preset name, function, or numeric).

SNR

Signal-to-noise ratio.

family

A family object for response distribution.

propmissing

Proportion of missing values in response.

limits

Optional limits function for ff terms.

wiggliness

Controls smoothness for "random" preset (default: 1).

k_truth

Named list of basis dimensions for random truth generation.