ppi_scale: Simulate and Compare Index Scale on Structured vs Noisy Data

View source: R/index_scale.R

ppi_scaleR Documentation

Simulate and Compare Index Scale on Structured vs Noisy Data

Description

Performs simulations to compute a projection pursuit index on structured (sampled) data and on random noise, allowing a comparison of index scale across contexts.

Usage

ppi_scale(data, index_fun, n_sim = 100, n_obs = 500, seed = NULL)

Arguments

data

A data frame or tibble with at least two numeric columns.

index_fun

A function that takes two numeric vectors (x, y) and returns a numeric scalar index.

n_sim

Integer. Number of simulations. Default is 100.

n_obs

Integer. Number of observations per simulation. Default is 500.

seed

Optional integer seed for reproducibility.

Value

A tibble with columns:

  • simulation: simulation number

  • var_i, var_j: variable names

  • var_pair: pair name as a string

  • sigma: 0 for structured data, 1 for noisy data

  • index: index value returned by index_fun

Examples

ppi_scale(data_gen("polynomial", degree = 3), scag_index("stringy"), n_sim = 2)


spinebil documentation built on Nov. 5, 2025, 7:35 p.m.