Learn R Programming

refund (version 0.1-40)

pffrSim: Simulate example data for pffr (deprecated)

Description

**Deprecated**

`pffrSim()` was renamed to [pffr_simulate()] for consistency with the package naming conventions.

Usage

pffrSim(
  formula = NULL,
  scenario = NULL,
  n = 100,
  nxgrid = 40,
  nygrid = 60,
  yind = NULL,
  xind = NULL,
  data = NULL,
  effects = list(),
  intercept = "beta",
  SNR = 10,
  family = gaussian(),
  propmissing = 0,
  limits = NULL,
  seed = NULL,
  wiggliness = 1,
  k_truth = list()
)

Value

Same as pffr_simulate.

Arguments

formula

A formula specifying the model structure (e.g., Y ~ ff(X1) + xlin). If provided, the scenario argument is ignored.

scenario

Deprecated. Character string or vector specifying predefined scenarios. Use the formula argument instead.

n

Number of observations.

nxgrid

Number of evaluation points for functional covariates. Ignored if xind is provided.

nygrid

Number of evaluation points for the functional response. Ignored if yind is provided.

yind

Numeric vector of evaluation points for the response. Defaults to seq(0, 1, length.out = nygrid).

xind

Numeric vector of evaluation points for functional covariates. Defaults to seq(0, 1, length.out = nxgrid).

data

Optional data frame with pre-generated covariates.

effects

Named list mapping term labels to effect specifications. Each entry can be a preset name (e.g., "cosine"), a function, or a numeric value. See Details.

intercept

Intercept specification: preset name ("beta", "constant", "sine", "zero"), a function of t, or a numeric value.

SNR

Signal-to-noise ratio: var(eta) / var(epsilon).

family

A family object for the response distribution. Defaults to gaussian().

propmissing

Proportion of missing data in the response (0 to 1).

limits

A function defining integration limits for ff() terms, e.g., function(s, t) s < t.

seed

Optional random seed for reproducibility.

wiggliness

Controls smoothness for the "random" preset (default: 1). Higher values produce more wiggly truth functions. Typical range: 0.001 (very smooth) to 10 (very wiggly).

k_truth

Named list of basis dimensions for random truth generation. Defaults: list(ff_s = 8, ff_t = 8, smooth_z = 8, smooth_t = 8, linear = 8, intercept = 8, concurrent = 8).