| ppi_scale | R Documentation |
Performs simulations to compute a projection pursuit index on structured (sampled) data and on random noise, allowing a comparison of index scale across contexts.
ppi_scale(
data,
index_fun,
noise_fun = NULL,
n_sim = 100,
n_obs = 500,
index_args = list(),
seed = NULL,
workers = 1
)
data |
A data frame or tibble with at least two numeric columns. |
index_fun |
A function returning a numeric scalar index. It may accept
either a 2-column matrix/data frame, or two numeric vectors ( |
noise_fun |
Optional function for generating noise data. It should take
|
n_sim |
Integer. Number of simulations. Default is 100. |
n_obs |
Integer. Number of observations per simulation. Default is 500. |
index_args |
A named list of additional arguments passed to |
seed |
Optional integer seed for reproducibility. |
workers |
Integer. Number of parallel workers to use. Default is 1. |
A tibble with columns:
simulation: simulation number
var_i, var_j: variable names
var_pair: pair name as a string
sigma: "structure" for structured data, "noise" for noisy data
index: index value returned by index_fun
ppi_scale(
data_gen("polynomial", degree = 3),
cassowaryr::sc_stringy,
n_sim = 2,
index_args = list(binner = "hex"),
workers = 2
)
ppi_scale(
data_gen("polynomial", degree = 3),
scag_index("stringy"),
n_sim = 2
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.