rgiordan / zaminfluence

Tools in R for computing and using Z-estimator approximate influence functions.
Apache License 2.0
94 stars 10 forks source link

Replace the nested lists of reruns and signals with list-column tibbles #30

Open rgiordan opened 2 years ago

rgiordan commented 2 years ago

The nested list structure returned by GetInferenceSignals and RerunForSignals is unnecessarily complicated. Replace it with tibbles with a list-valued column, e.g.:

these_signals <- GetInferenceSignalsForParameter(model_grads$param_infls[[param_name]])

signals_df <- tibble()
for (qoi_name in names(this_signals)) {
    signals_df <- bind_rows(
        signals_df,
        tibble(param=param_name, qoi_name=qoi_name) %>%
            mutate(signal=list(this_signals[[qoi_name]])))
}