-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Summary
When calling bcf() with a user-specified num_burnin (e.g., 1000) but leaving propensity_train = NULL (to have it estimated internally), the num_burnin parameter is overridden to 10.
Problem Details
This appears to be caused by a variable scope issue in R/bcf.R.
- A user calls
bcf(..., num_burnin = 1000, propensity_train = NULL). - The code enters the
if (is.null(propensity_train))block here. - Inside this block, the assignment
num_burnin <- 10is made here. - This assignment overwrites the
num_burninvariable for the entire function scope, not just for the internal propensity model. - As a result, the main BCF sampling loop incorrectly uses
num_burnin = 10instead of the user's intended1000.
Expected Behavior
The user-supplied num_burnin value should be used for the main BCF model's burn-in phase. The num_burnin <- 10 assignment was likely intended to be a local variable (e.g., propensity_burnin) used only for the internal GFR propensity score estimation.
Suggested Fix
Possibly rename the variable at R/bcf.R to a new, local variable (e.g., prop_num_burnin <- 10) and use that new variable for the GFR sampling within that if block.
Metadata
Metadata
Assignees
Labels
No labels