Fast bootstrap estimation using matrix multiplication
get_boot_ests_matrix.RdReplaces the wide-dataframe summarize_at + gather/spread approach with direct matrix multiplication. For each cell, computes weighted sums across all M bootstrap replicates simultaneously using BLAS routines, avoiding the creation of 10k-column intermediate dataframes.
Arguments
- ec_dat
ego X cell data from get_ec_reports()
- boot_weights_df
dataframe with .ego.id column and boot_weight_1..M columns
- ego_id_col
name of the ego id column in ec_dat and boot_weights_df
- cell_vars
vector of column names defining cells (age, sex, time period, etc)
- estimator_type
either 'ind' (individual visibility) or 'agg' (aggregate visibility)