Defaults API Reference¶
Default configuration values for SciStanPy package components.
This module centralizes default values used across various components of the SciStanPy package, including fitting parameters, naming conventions, and Stan model configuration options, among others.
- The module is organized into logical groups covering:
Model fitting and optimization defaults
Variable and dimension naming conventions
Stan model compilation and execution settings
Diagnostic thresholds for model validation
Default values cannot be programmatically altered. This documentation serves as a reference for users and developers to understand the standard configuration used by SciStanPy.
Default values can be grouped into several categories based on their use within the SciStanPy package. Below is an overview of the default values provided by the module.
Maximum Likelihood Estimation Defaults¶
Default values used in methods that rely on maximum likelihood estimation for fitting models.
- scistanpy.defaults.DEFAULT_N_EPOCHS: int = 100000¶
Default number of training epochs for model fitting.
- Type:
int
- scistanpy.defaults.DEFAULT_EARLY_STOP: int = 10¶
Default number of epochs to wait before early stopping.
Controls how many epochs without improvement to wait before terminating training early to prevent overfitting.
- Type:
int
- scistanpy.defaults.DEFAULT_LR: float = 0.001¶
Default learning rate for optimization algorithms.
- Type:
float
Stan Variable Naming Defaults¶
Default values for index variable names in autogenerated Stan code.
- scistanpy.defaults.DEFAULT_INDEX_ORDER: tuple[str, ...] = ('i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't')¶
Default ordering for index variable names in mathematical expressions.
Provides a consistent sequence of variable names for indexing operations, following mathematical conventions starting with ‘i’, ‘j’, ‘k’, etc.
- Type:
tuple[str, …]
XArray Dimension Naming Defaults¶
Default dimension names used when converting SciStanPy objects to XArray data structures.
- scistanpy.defaults.DEFAULT_DIM_NAMES: tuple[str, ...] = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')¶
Default names for data dimensions, excluding ‘n’.
Generates dimension names from lowercase ASCII letters, excluding ‘n’ which is typically reserved for sample size notation.
- Type:
tuple[str, …]
Stan Compilation Defaults¶
Default values related to the compilation of Stan models.
- scistanpy.defaults.DEFAULT_FORCE_COMPILE: bool = False¶
Default setting for forcing Stan model recompilation.
When False, uses cached compiled models when available. When True, forces recompilation even if a cached version exists.
- Type:
bool
- scistanpy.defaults.DEFAULT_CPP_OPTIONS: dict[str, Any] = {'STAN_THREADS': True}¶
Default C++ compilation options for Stan models.
Enables threading support in compiled Stan models for improved performance on multi-core systems.
- Type:
dict[str, bool]
- scistanpy.defaults.DEFAULT_USER_HEADER: str | None = None¶
Default user header content for Stan models.
Custom C++ code that can be included in Stan model compilation. None indicates no custom header by default.
- Type:
str | None
- scistanpy.defaults.DEFAULT_MODEL_NAME: str = 'model'¶
Default name for generated Stan models.
- Type:
str
Diagnostic Threshold Defaults¶
Default thresholds used for model diagnostics.
- scistanpy.defaults.DEFAULT_EBFMI_THRESH: float = 0.2¶
Default threshold for Energy Bayesian Fraction of Missing Information (E-BFMI).
Values below this threshold may indicate inefficient sampling and potential bias in MCMC results.
- Type:
float
- scistanpy.defaults.DEFAULT_ESS_THRESH: int = 100¶
Default threshold for Effective Sample Size (ESS) per chain.
Minimum effective sample size considered adequate for reliable posterior inference from each MCMC chain.
- Type:
int
- scistanpy.defaults.DEFAULT_RHAT_THRESH: float = 1.01¶
Default threshold for R-hat convergence diagnostic.
Values above this threshold indicate potential convergence issues in MCMC sampling across chains.
- Type:
float