Skip to contents

Simulate interval Beta-regression data (flexible)

Usage

simulation_DATA.beta(
  n,
  p,
  s = min(5L, p),
  beta_size = 1,
  a0 = 0,
  X_dist = c("gaussian", "t", "bernoulli"),
  corr = c("indep", "ar1", "block"),
  rho = 0,
  block_size = 5L,
  df = 5,
  prob = 0.5,
  active_idx = NULL,
  phi = 20,
  mechanism = c("jitter", "quantile", "mixed"),
  mix_prob = 0.5,
  delta = 0.05,
  delta_low = NULL,
  delta_high = NULL,
  alpha = 0.1,
  alpha_low = NULL,
  alpha_high = NULL,
  na_rate = 0,
  na_side = c("random", "left", "right"),
  centerX = FALSE,
  scaleX = FALSE,
  seed = NULL
)

Arguments

n, p

Sample size and number of predictors.

s

Number of active (nonzero) coefficients.

beta_size

Scalar (alternating ±) or numeric vector of length greater then equal s.

a0

Intercept (logit scale).

X_dist

Distribution for X: "gaussian", "t", or "bernoulli".

corr

Correlation structure: "indep", "ar1", or "block".

rho

AR(1) correlation or within-block correlation.

block_size

Block size when corr = "block" (default 5).

df

Degrees of freedom for X_dist = "t" (default 5).

prob

Success prob for X_dist = "bernoulli" (default 0.5).

active_idx

Optional integer vector of active feature indices (length s). If NULL, uses 1:s.

phi

Precision parameter: scalar, length-n vector, or function (mu, X) -> length-n.

mechanism

Interval mechanism per row: "jitter", "quantile", or "mixed".

mix_prob

Probability of jitter when mechanism = "mixed".

delta

Symmetric jitter half-width (scalar / vector / function).

delta_low, delta_high

Asymmetric jitter widths (override delta if set).

alpha

Miscoverage for quantile intervals (scalar / vector / function).

alpha_low, alpha_high

Asymmetric miscoverage (override alpha if set).

na_rate

Fraction of rows with a missing bound (default 0).

na_side

Which bound to drop: "left", "right", or "random".

centerX, scaleX

Whether to center/scale X before returning.

seed

RNG seed.

Value

list with X, Y, Y_low, Y_high, mu, beta, a0, phi, info, settings.