Create a simulator function from a fitted Single-index outcome model
Source:R/simulator_factory.R
make_single_index_simulator.RdThis factory builds a closure that can be used to simulate outcome values
from a fitted SensIAT::Single-index-outcome-model. The returned function
samples from the estimated conditional distribution of the outcome given
covariates using the Nadaraya-Watson estimator implemented in
pcoriaccel_NW.
Arguments
- outcome_model
A fitted object of class
SensIAT::Single-index-outcome-model.- covariate_mapping
Optional named character vector mapping expected covariate names (e.g.
prev_outcome,time,delta_time) to the names used in the original model formula. IfNULL, the factory will attempt to useprev_outcome,time, anddelta_timedirectly.