Learn R Programming

topolow (version 2.0.1)

adaptive_MC_sampling: Perform Adaptive Monte Carlo Sampling (Internal)

Description

Core implementation of the adaptive Monte Carlo sampling algorithm. This internal function explores the parameter space by updating the sampling distribution based on evaluated likelihoods. It is called by the main run_adaptive_sampling function.

Usage

adaptive_MC_sampling(
  samples_file,
  dissimilarity_matrix,
  iterations = 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 the CSV file with samples for the current job.

dissimilarity_matrix

The dissimilarity matrix to be fitted.

iterations

Number of sampling iterations per job.

mapping_max_iter

Maximum optimization iterations for the embedding.

relative_epsilon

Convergence threshold for the optimization.

folds

Number of cross-validation folds.

num_cores

Number of cores for parallel processing.

scenario_name

Name for output files, used for context.

verbose

Logical. If TRUE, prints progress messages.