fn.RF_ZFirst: Estimate joint propensity scores with cross-fitting or single...

View source: R/other-functions.R

fn.RF_ZFirstR Documentation

Estimate joint propensity scores with cross-fitting or single fit

Description

When nodesize = NULL (original data), generates 5-fold assignments, runs fn.RF_tune_nodesize to select min.node.size and obtain out-of-fold propensity scores in one pass. When nodesize is supplied (bootstrap), skips tuning and either cross-fits at that node size, if fold_ids is given, or fits one ranger model on the full data.

Usage

fn.RF_ZFirst(data, svdCutoff, nodesize = NULL, fold_ids = NULL)

Arguments

data

Structured data list

svdCutoff

Proportion of variance to retain in SVD preprocessing

nodesize

Integer min.node.size for ranger, or NULL to tune

fold_ids

Integer vector of fold assignments (length N), or NULL. Supplied during bootstrapping so replicates are cross-fitted like the point estimate; build it with fn.folds_by_observation so duplicate copies of an observation share a fold. When NULL the bootstrap falls back to a single in-sample fit.

Value

Parameter list with propensity scores:

  • e$sz - P(S=s, Z=z | X) after truncation, dim (N, K, J)

  • selected_nodesize - min.node.size used for the final fit

  • diagnostics - List with frac_truncated, prob_quantiles, and crossfit_accuracy


WMAP documentation built on Oct. 6, 2026, 1:07 a.m.