Learn R Programming

topolow (version 1.0.0)

adaptive_MC_sampling: Perform Adaptive Monte Carlo Sampling

Description

Main function implementing adaptive Monte Carlo sampling to explore parameter space. Updates sampling distribution based on evaluated likelihoods. This is an internal function called by run_adaptive_sampling.

Usage

adaptive_MC_sampling(
  samples_file,
  distance_matrix,
  iterations = 1,
  batch_size = 1,
  mapping_max_iter,
  relative_epsilon,
  folds = 20,
  num_cores = 1,
  scenario_name,
  verbose = FALSE
)

Value

A data.frame containing all samples (initial and newly generated) with their parameters and evaluated performance metrics. The data frame includes columns for the log-transformed parameters, Holdout_MAE, and NLL. Returns NULL if the results file was not created.

Arguments

samples_file

Path to CSV with initial samples for this job.

distance_matrix

Distance matrix to fit

iterations

Number of sampling iterations per job

batch_size

Samples per iteration (fixed to 1)

mapping_max_iter

Maximum map optimization iterations

relative_epsilon

Convergence threshold

folds

Number of CV folds

num_cores

Number of cores for parallel processing

scenario_name

Name for output files

verbose

Logical. Whether to print progress messages. Default: FALSE