Public API
This page inventories the symbols currently exported by Epsilon. It is a support-status map for a pre-release library, not a promise that every exported symbol has the same stability level.
Support bands:
core: stable supported Epsilon surface.bounded: supported for the documented bounded slice only.compatibility: retained for migration, legacy naming, or Julia package conventions.scaffolded: public because implementation exists, but broader support or API stability is still being reviewed.
Support status is the current documented scope, not a v1 API freeze.
Inventory
The table between the markers below is checked by the test suite. Every current export must appear exactly once.
Plotting exports are part of the public API, but their concrete CairoMakie methods are loaded through the optional EpsilonCairoMakieExt extension. Use using Epsilon, CairoMakie before calling plotting functions or write_plot_bundle(run).
<!– BEGIN PUBLIC API INVENTORY –> | Symbol | Domain | Support | |–-|–-|–-| | AbstractMMMModel | Model core | scaffolded | | AbstractModel | Model core | scaffolded | | AbstractRegressionModel | Model core | scaffolded | | AbstractScenarioSpec | Scenario planning | bounded | | AdstockCurveResults | Post-model results | core | | After | Event windows | scaffolded | | Before | Event windows | scaffolded | | BudgetOptimizationResult | Budget optimization | scaffolded | | CalibrationStepConfig | Calibration | scaffolded | | ContributionResults | Post-model results | core | | ConvMode | Transforms | core | | ConvergenceIssue | Diagnostics | scaffolded | | ConvergenceReport | Diagnostics | scaffolded | | ConvergenceWarning | Diagnostics | scaffolded | | ConvergenceWarnings | Diagnostics | scaffolded | | CostPerTargetCalibrationPayload | Calibration | scaffolded | | CostPerTargetCalibrationRows | Calibration | scaffolded | | CurrentScenarioSpec | Scenario planning | bounded | | DecompositionResults | Post-model results | core | | EpsilonPrior | Priors and distributions | scaffolded | | FinnishHorseshoePrior | Priors and distributions | scaffolded | | FixedBudgetOptimizedScenarioSpec | Scenario planning | bounded | | HorseshoePrior | Priors and distributions | scaffolded | | InferenceResults | Inference | scaffolded | | InferenceSampleStats | Inference | scaffolded | | LaplacePrior | Priors and distributions | scaffolded | | LiftTestCalibrationPayload | Calibration | scaffolded | | LiftTestCalibrationRows | Calibration | scaffolded | | LogNormalPrior | Priors and distributions | scaffolded | | MMMCalibrationSpec | Calibration | scaffolded | | MMMData | Model data | scaffolded | | MMMModelSpec | Model specification | scaffolded | | ManualAllocationScenarioSpec | Scenario planning | bounded | | ManualScenarioEvaluationResult | Scenario planning | bounded | | MaskedPrior | Priors and distributions | scaffolded | | MaxAbsScaleChannels | Transforms | core | | MaxAbsScaleTarget | Transforms | core | | MaxAbsScaler | Transforms | core | | MetricResults | Post-model results | core | | ModelArtifactMetadata | Model artifacts | scaffolded | | ModelConfig | Configuration | scaffolded | | ModelConfigError | Configuration | scaffolded | | ModelCoordinateMetadata | Model artifacts | scaffolded | | ModelDiagnostics | Diagnostics | scaffolded | | ModelFitState | Model lifecycle | scaffolded | | ModelResults | Model lifecycle | scaffolded | | NonMonotonicError | Calibration | scaffolded | | Overlap | Event windows | scaffolded | | PanelAxis | Panel metadata | bounded | | PanelBudgetOptimizationResult | Budget optimization | bounded | | PanelCoordinate | Panel metadata | bounded | | PanelMMM | Model core | bounded | | PanelMMMData | Model data | bounded | | ParameterDiagnostics | Diagnostics | scaffolded | | PipelineRunConfig | Pipeline | scaffolded | | PipelineRunResult | Pipeline | scaffolded | | PipelineStageRecord | Pipeline | scaffolded | | PipelineValidationResult | Pipeline | scaffolded | | R2D2Prior | Priors and distributions | scaffolded | | ResponseCurveResults | Post-model results | core | | SamplerConfig | Inference | scaffolded | | SamplerDiagnostics | Diagnostics | scaffolded | | SamplerWarning | Diagnostics | scaffolded | | SamplerWarnings | Diagnostics | scaffolded | | SaturationCurveResults | Post-model results | core | | Scaled | Transforms | core | | ScenarioDataArraySpec | Scenario planning | bounded | | ScenarioPlanResult | Scenario planning | bounded | | ScenarioStoreArtifact | Scenario planning | bounded | | SkewStudentT | Priors and distributions | scaffolded | | StandardScaler | Transforms | core | | StandardizeControls | Transforms | core | | TimeSeriesCalibrationInput | Calibration | scaffolded | | TimeSeriesMMM | Model core | bounded | | TimeVaryingMediaConfig | Configuration | bounded | | UnalignedValuesError | Calibration | scaffolded | | WeibullType | Transforms | core | | active_count | Priors and distributions | scaffolded | | adstock_curve_plot | Plotting | bounded | | adstock_curve_results | Post-model results | core | | assert_monotonic_lift | Calibration | scaffolded | | assert_scenario_store_compatible | Scenario planning | bounded | | batched_convolution | Transforms | core | | binomial_adstock | Transforms | core | | budget_audit_table | Budget optimization | scaffolded | | budget_impact_table | Budget optimization | scaffolded | | budget_optimization_plot | Plotting | bounded | | build_cost_per_target_calibration_payload | Calibration | scaffolded | | build_lift_test_calibration_payload | Calibration | scaffolded | | build_model | Model builders | scaffolded | | centered_logistic_saturation | Transforms | bounded | | contribution_area_plot | Plotting | bounded | | contribution_plot | Plotting | bounded | | contribution_results | Post-model results | core | | convergence_report | Diagnostics | scaffolded | | convergence_warnings | Diagnostics | scaffolded | | cost_per_target_penalties | Calibration | scaffolded | | cost_per_target_total_penalty | Calibration | scaffolded | | decomposition_plot | Plotting | bounded | | decomposition_results | Post-model results | core | | delayed_adstock | Transforms | core | | deserialize_model_config | Serialization | scaffolded | | deserialize_prior | Priors and distributions | scaffolded | | epsilon_theme | Plotting | bounded | | epsilon_version | Package identity | compatibility | | evaluate_manual_scenario | Scenario planning | bounded | | exact_row_indices | Calibration | scaffolded | | expand_masked_values | Priors and distributions | scaffolded | | finnish_horseshoe_coefficients | Priors and distributions | scaffolded | | fit! | Model lifecycle | scaffolded | | fit_transform! | Transforms | core | | fourier_features | Seasonality | scaffolded | | gamma_shape_scale | Calibration | scaffolded | | geometric_adstock | Transforms | core | | has_convergence_issues | Diagnostics | scaffolded | | has_convergence_warnings | Diagnostics | scaffolded | | has_numerical_errors | Diagnostics | scaffolded | | has_sampler_warnings | Diagnostics | scaffolded | | hill_function | Transforms | core | | horseshoe_coefficients | Priors and distributions | scaffolded | | inference_results | Inference | scaffolded | | instantiate_distribution | Priors and distributions | scaffolded | | inverse_transform | Transforms | core | | lift_test_estimated_lift | Calibration | scaffolded | | lift_test_estimated_lift_ad | Calibration | scaffolded | | lift_test_gamma_distribution | Calibration | scaffolded | | lift_test_likelihood_terms | Calibration | scaffolded | | lift_test_log_density | Calibration | scaffolded | | lift_test_payload_log_density | Calibration | scaffolded | | load_inference_results | Serialization | scaffolded | | load_model | Serialization | scaffolded | | load_model_config | Configuration | scaffolded | | load_public_config | Configuration | scaffolded | | load_results | Serialization | scaffolded | | load_sampler_config | Inference | scaffolded | | load_scenario_store | Scenario planning | bounded | | logistic_saturation | Transforms | compatibility | | max_abs_scale_channel_data | Transforms | core | | max_abs_scale_target_data | Transforms | core | | metric_results | Post-model results | core | | michaelis_menten | Transforms | core | | model_config_from_dict | Configuration | scaffolded | | model_diagnostics | Diagnostics | scaffolded | | model_results | Model lifecycle | scaffolded | | nobs | Model data | compatibility | | normalize_channel_columns | Model data | scaffolded | | npanel_observations | Model data | bounded | | npanels | Model data | bounded | | ntime | Model data | bounded | | observed_fitted_plot | Plotting | bounded | | optimize_budget | Budget optimization | scaffolded | | panel_axes | Panel metadata | bounded | | panel_axis | Panel metadata | bounded | | panel_coordinate | Panel metadata | bounded | | panel_coordinates | Panel metadata | bounded | | pipeline_main | Pipeline | scaffolded | | posterior_density_plot | Plotting | bounded | | predict | Model lifecycle | scaffolded | | prior_posterior_plot | Plotting | bounded | | prior_predict | Model lifecycle | scaffolded | | r2d2_coefficients | Priors and distributions | scaffolded | | r2d2_variance_weights | Priors and distributions | scaffolded | | regularized_local_scales | Priors and distributions | scaffolded | | residual_diagnostics_plot | Plotting | bounded | | response_curve_plot | Plotting | bounded | | response_curve_results | Post-model results | core | | run_pipeline | Pipeline | scaffolded | | sampler_config_from_dict | Inference | scaffolded | | sampler_diagnostics | Diagnostics | scaffolded | | sampler_warnings | Diagnostics | scaffolded | | saturation_curve_plot | Plotting | bounded | | saturation_curve_results | Post-model results | core | | save_inference_results | Serialization | scaffolded | | save_model | Serialization | scaffolded | | save_results | Serialization | scaffolded | | scale_channel_lift_measurements | Calibration | scaffolded | | scale_lift_measurements | Calibration | scaffolded | | scale_target_for_lift_measurements | Calibration | scaffolded | | scenario_plan | Scenario planning | bounded | | scenario_store_plan | Scenario planning | bounded | | standardize_control_data | Transforms | core | | summary_table | Post-model results | bounded | | tanh_saturation | Transforms | core | | trace_plot | Plotting | bounded | | transform | Transforms | core | | validate_calibration_step_config | Calibration | scaffolded | | validate_channel_values | Validation | bounded | | validate_column_indices | Validation | scaffolded | | validate_cost_per_target_calibration_payload | Calibration | scaffolded | | validate_lift_test_calibration_payload | Calibration | scaffolded | | validate_lift_test_columns | Calibration | scaffolded | | validate_mmm_data | Model data | scaffolded | | validate_model_config | Configuration | scaffolded | | validate_panel_mmm_data | Model data | bounded | | validate_sampler_config | Inference | scaffolded | | validate_target_data | Model data | scaffolded | | weibull_adstock | Transforms | core | | write_plot_bundle | Plotting | bounded | | write_scenario_store | Scenario planning | bounded | <!– END PUBLIC API INVENTORY –>
Reading The Table
Several domains are intentionally still scaffolded. That label means the symbol is exported today and has implementation behind it, but the API may still change before a stable release.
Panel, calibration, scenario-planner, pipeline, optimization, inference, and configuration entries should be read with the scope limits documented in Support Boundaries.
Docstring Reference
Epsilon.After — Constant
Trailing carryover mode for batched_convolution.
Epsilon.Before — Constant
Leading carryover mode for batched_convolution.
Epsilon.Overlap — Constant
Parity-preserving overlap mode for batched_convolution.
Epsilon.AbstractMMMModel — Type
AbstractMMMModel <: AbstractRegressionModelBase abstract type for marketing mix models in Epsilon.
Epsilon.AbstractModel — Type
AbstractModelBase abstract type for typed Epsilon model objects.
Epsilon.AbstractRegressionModel — Type
AbstractRegressionModel <: AbstractModelBase abstract type for regression-style model objects.
Epsilon.AbstractScenarioSpec — Type
AbstractScenarioSpecAbstract supertype for bounded non-UI scenario-planner specifications.
Epsilon.AdstockCurveResults — Type
AdstockCurveResultsTyped draw-level adstock-only surface for one media channel derived from grouped InferenceResults.
For time-series models, values has dimensions (draw, spend_point). For bounded panel replay, values has dimensions (draw, panel, spend_point) and uses the same shared historical-scaling delta grid as ResponseCurveResults. The panel spend_grid axis order is always (panel, spend_point).
Epsilon.BudgetOptimizationResult — Type
BudgetOptimizationResultTyped canonical result surface for the public Phase 8 optimizer.
This typed artifact preserves the bounded optimizer output without exposing solver-specific details in the public API. current_spend, optimized_spend, and nested constraint audit spend values are reported in the same original channel units and time aggregation level as the fitted input data.
Epsilon.CalibrationStepConfig — Type
CalibrationStepConfig(; method, params=Dict())Typed mirror of the Abacus public YAML calibration step schema (abacus/mmm/builders/schema.py::CalibrationStepConfig): one step is a method name drawn from the supported calibration methods plus a free-form params mapping. params.dist is rejected, matching Abacus's current YAML restriction that custom likelihood distributions cannot be configured through YAML.
Applying a configured step to a model is a separate, not-yet-implemented model-integration concern.
Epsilon.ContributionResults — Type
ContributionResultsTyped draw-level additive contribution surface derived from grouped InferenceResults.
For time-series models, values has dimensions (draw, observation, component). For bounded panel replay, values has dimensions (draw, time, panel, component), where multidimensional panels are represented on the deterministic flat panel-cell axis. Panel summaries always expose the fixed panel_cell axis plus the declared coordinate columns carried by ModelCoordinateMetadata.panel_axes.
Epsilon.ConvMode — Type
ConvModeBoundary handling modes for batched_convolution.
Epsilon.ConvergenceIssue — Type
ConvergenceIssueTyped convergence-threshold breach for one parameter and one metric.
Epsilon.ConvergenceReport — Type
ConvergenceReportTyped convergence report derived from chain diagnostics and threshold rules.
Epsilon.ConvergenceWarning — Type
ConvergenceWarningTyped user-facing warning derived from one convergence issue.
Epsilon.ConvergenceWarnings — Type
ConvergenceWarningsTyped warning bundle derived from a convergence report.
Epsilon.CostPerTargetCalibrationPayload — Type
CostPerTargetCalibrationPayload(gathered_cpt, targets, sigma)Typed, already-scaled cost-per-target calibration observations ready for the model runtime, matching Abacus's explicit gathered/target/sigma soft-penalty semantics: gathered_cpt is the observed (gathered) cost-per-target value, targets is the target cost-per-target value, and sigma is the strictly positive soft-penalty scale, all in scaled model space.
Use build_cost_per_target_calibration_payload to construct one of these from plain columnar input plus a fitted target scaler; this struct's own positional constructor performs no scaling and should generally not be called directly outside tests.
Epsilon.CostPerTargetCalibrationRows — Type
CostPerTargetCalibrationRows(gathered_cpt, targets, sigma)Plain, unscaled columnar cost-per-target row data supplied by a caller, in the model's original (unscaled) units. This is the raw companion input accepted by TimeSeriesMMM's calibration constructor arguments; it is resolved into a scaled CostPerTargetCalibrationPayload internally once the fitted target scale is known.
Use the keyword constructor to build one of these from plain vectors; it validates matching lengths, finite gathered_cpt/targets, and positive sigma eagerly.
Epsilon.CurrentScenarioSpec — Type
CurrentScenarioSpec(; name, start_date=nothing, end_date=nothing, scenario_id=nothing)Describe the baseline/current scenario in a non-UI scenario-planner comparison.
Dates may be Date, ISO date strings, or nothing. When scenario_id is not provided it is deterministically slugified from name, matching Abacus's scenario-store convention.
Epsilon.DecompositionResults — Type
DecompositionResultsTyped draw-level additive decomposition surface derived from ContributionResults.
totals and shares are two-dimensional arrays with dimensions (draw, component). Time-series and panel decomposition artifacts intentionally share this axis order because panel contributions are aggregated over time and flat panel cells before component shares are computed.
Epsilon.EpsilonPrior — Type
EpsilonPrior(distribution; dims=nothing, centered=true, transform=nothing, kwargs...)Store a config-defined prior specification in a Julia-native form.
Epsilon.FinnishHorseshoePrior — Type
FinnishHorseshoePrior(; scale=1.0, slab_scale=2.5, slab_df=4.0, dims=nothing, centered=true)Regularized horseshoe prior recipe with finite slab control. scale, slab_scale, and slab_df are stored on the typed prior so the later model layer can build the full regularized horseshoe hierarchy. The deterministic helper functions in this file use only scale and slab_scale; slab_df remains model-layer metadata.
Epsilon.FixedBudgetOptimizedScenarioSpec — Type
FixedBudgetOptimizedScenarioSpec(; name, total_budget, ...)Describe an optimized fixed-budget scenario for comparison/reporting.
The actual allocation is supplied by an existing BudgetOptimizationResult or PanelBudgetOptimizationResult passed to scenario_plan. The spec preserves planner metadata such as the requested budget, response variable, and optional constraint dictionaries without re-solving the optimization problem. total_budget and any spend-like constraint dictionaries must use the same original channel units and time aggregation level as the fitted model data and optimizer result.
Epsilon.HorseshoePrior — Type
HorseshoePrior(; scale=1.0, dims=nothing, centered=true)Global-local shrinkage prior recipe for sparse coefficients.
Epsilon.InferenceResults — Type
InferenceResults(metadata, spec; posterior=nothing, prior=nothing, posterior_predictive=nothing, prior_predictive=nothing, sample_stats=InferenceSampleStats(), observed_data=nothing)Canonical grouped inference-artifact surface for fitted MMM models.
ModelResults remains the lighter flat convenience container. InferenceResults is the richer grouped surface that preserves posterior draws, optional prior draws, predictive draws, sampler statistics, observed data, and coordinate metadata together.
Epsilon.InferenceSampleStats — Type
InferenceSampleStats(; internals=nothing, diagnostics=nothing, sampler_diagnostics=nothing, sampler_warnings=nothing, convergence_report=nothing, convergence_warnings=nothing)Typed grouped sample-statistics bundle for the canonical InferenceResults surface.
Epsilon.LaplacePrior — Type
LaplacePrior(; mu, b, dims=nothing, centered=true)Laplace prior with optional non-centered bookkeeping metadata.
Epsilon.LiftTestCalibrationPayload — Type
LiftTestCalibrationPayload(channel_index, x, delta_x, delta_y, sigma)Typed, row-aligned, already-scaled lift-test calibration observations ready for the model runtime. channel_index is the 1-based index into the model's channel axis for each row; x, delta_x, delta_y, and sigma are all in scaled model space (the same space as the fitted media and target likelihood). sigma must be strictly positive.
Use build_lift_test_calibration_payload to construct one of these from plain columnar lift-test input plus fitted channel/target scalers; this struct's own positional constructor performs no scaling or alignment and should generally not be called directly outside tests.
Epsilon.LiftTestCalibrationRows — Type
LiftTestCalibrationRows(channel, x, delta_x, delta_y, sigma)Plain, unscaled columnar lift-test row data supplied by a caller, in the model's original (unscaled) units. This is the raw companion input accepted by TimeSeriesMMM's calibration constructor arguments; it is resolved into a scaled LiftTestCalibrationPayload internally once the fitted channel/target scales are known.
Use the keyword constructor to build one of these from plain vectors; it validates matching lengths, finite x/delta_x/delta_y, positive sigma, and lift-test monotonicity via assert_monotonic_lift eagerly, so malformed calibration data fails at TimeSeriesMMM construction time rather than at fit time.
Epsilon.LogNormalPrior — Type
LogNormalPrior(; mean, std, dims=nothing, centered=true)
LogNormalPrior(; mu, sigma, dims=nothing, centered=true)Log-normal prior parameterized by positive-scale mean and standard deviation.
Epsilon.MMMCalibrationSpec — Type
MMMCalibrationSpec(steps, lift_test, cost_per_target)Resolved calibration metadata attached to a time-series MMMModelSpec: the configured calibration steps plus already-scaled LiftTestCalibrationPayload and/or CostPerTargetCalibrationPayload observations, ready for the model runtime. PanelMMM specs must never carry a non-nothing value here.
Epsilon.MMMData — Type
MMMData(; dates, target, channels, channel_names, controls=nothing, control_names=String[], events=nothing, event_names=String[])Typed container for the arrays that define one MMM training dataset.
target and channels are stored in the caller's original measurement units. Downstream spend-like arguments, including optimizer total_budget and bounds, must use the same channel units and time aggregation level.
Epsilon.MMMModelSpec — Type
MMMModelSpecResolved model-building payload before a sampling backend is attached, including coordinate metadata for the current typed model surface.
For time-series models channel_scale is a channel vector and target_scale is a scalar. For panel models channel_scale is a channel-by-flattened-panel matrix and target_scale is a flattened-panel vector. For panel specs, nobs currently stores flattened panel-cell observations to preserve artifact contracts; use ntime(data) and npanels(data) at the data boundary when the shared time and flat panel axes must remain separate.
Epsilon.ManualAllocationScenarioSpec — Type
ManualAllocationScenarioSpec(; name, allocation, start_date=nothing, end_date=nothing, scenario_id=nothing)Describe a manually specified channel-allocation scenario.
allocation may be a dictionary mapping channel names to nonnegative spend, or a one-dimensional ScenarioDataArraySpec whose only dimension is channel. This type records validated planner intent; it does not fit or optimize a model by itself. Allocation values must use the same original channel units and time aggregation level as the fitted model data and response surfaces.
Epsilon.ManualScenarioEvaluationResult — Type
ManualScenarioEvaluationResultTyped result returned by evaluate_manual_scenario.
The result compares observed/current spend against one evaluated ManualAllocationScenarioSpec. Manual evaluation is bounded to time-series grouped InferenceResults and reuses the same response-surface interpolation machinery as optimize_budget; it does not refit a model, run a new optimizer, simulate a future spend path, or evaluate panel allocation semantics.
current_spend and manual_spend are reported in the same original channel units and time aggregation level as the fitted model data.
Epsilon.MaskedPrior — Type
MaskedPrior(prior, mask; mask_dims=prior.dims, active_dim=nothing)Represent a prior defined only on the active entries of a boolean mask.
Epsilon.MaxAbsScaleChannels — Type
MaxAbsScaleChannels(channel_columns)Wrapper that stores the fitted channel scaler for selected columns.
Epsilon.MaxAbsScaleTarget — Type
MaxAbsScaleTarget()Wrapper that stores the fitted target scaler.
Epsilon.MaxAbsScaler — Type
MaxAbsScaler()Scale each feature by its maximum absolute value.
Epsilon.MetricResults — Type
MetricResultsTyped draw-level marketing-metric surface derived from ResponseCurveResults.
For time-series curves, values has dimensions (draw, spend_point, metric). For bounded panel curves, values has dimensions (draw, panel, spend_point, metric). Panel metrics inherit the response-curve spend_grid axis order: (panel, spend_point).
Epsilon.ModelArtifactMetadata — Type
ModelArtifactMetadataSerializable metadata attached to saved and fitted model artifacts.
Epsilon.ModelConfig — Type
ModelConfig(; ...)Typed MMM model configuration assembled from dict or YAML input.
target_type currently supports only "revenue" and "conversion".
Epsilon.ModelConfigError — Type
ModelConfigErrorRaised when one or more model configuration entries cannot be deserialized into prior objects.
Epsilon.ModelCoordinateMetadata — Type
ModelCoordinateMetadataSerializable coordinate and named-dimension metadata resolved during typed model building.
Epsilon.ModelDiagnostics — Type
ModelDiagnosticsTyped diagnostic summary extracted from fitted posterior chains.
Epsilon.ModelFitState — Type
ModelFitState(status, backend; artifact=nothing, message="")Track the current fit lifecycle state for a model object.
Epsilon.ModelResults — Type
ModelResults(metadata, spec, chain; posterior_predictive=nothing, prior_predictive=nothing)Typed flat fitted-results container for the current MMM model path.
ModelResults remains the lighter convenience surface. For the richer grouped artifact introduced in Phase 6, use InferenceResults via inference_results(model; ...).
Epsilon.NonMonotonicError — Type
NonMonotonicError(message)Raised by assert_monotonic_lift when lift-test delta_x/delta_y pairs disagree in sign, mirroring Abacus abacus.mmm.calibration.alignment.NonMonotonicError.
Epsilon.PanelAxis — Type
PanelAxisOrdered metadata for one flattened panel-cell axis.
name is the analyst-facing flat panel-cell column name, currently "panel_cell". values stores the flat panel-cell labels in model order, and coordinate_columns stores declared panel-dimension coordinate columns in the same order as ModelCoordinateMetadata.panel_dims.
Epsilon.PanelBudgetOptimizationResult — Type
PanelBudgetOptimizationResultTyped canonical result surface for panel budget optimization.
Panel optimization preserves the Stage 60 panel response-curve contract by optimizing channel-level budget totals and applying each channel's historical panel-cell spend shares to the optimized total. The result therefore exposes the same channel-level allocation fields as BudgetOptimizationResult plus panel-cell audit matrices for downstream reporting.
Channel-level and panel-cell spend fields use the same original channel units and time aggregation level as the fitted PanelMMMData channels. Historical panel shares distribute those channel totals; they do not perform currency, calendar aggregation, or unit conversion.
Epsilon.PanelCoordinate — Type
PanelCoordinateNamed coordinate mapping for one flattened panel-cell index.
flat_index is the one-based index used on Epsilon's internal flat panel axis, panel_name is the corresponding flat panel label, and values stores the declared panel-dimension coordinates as a NamedTuple, for example (geo = "UK", brand = "Alpha").
Epsilon.PanelMMM — Type
PanelMMM(config, sampler_config, data)Container for the bounded panel MMM path, with a shared time axis and one or more declared panel dimensions represented internally by a flattened panel-cell axis.
Epsilon.PanelMMMData — Type
PanelMMMData(; dates, target, channels, panel_names, channel_names, panel_coordinates=Dict())Typed container for a bounded panel MMM dataset with a shared time axis.
target is stored as (time, panel) and channels as (time, channel, panel). For multi-dimensional panel configs, panel is the deterministic flattened panel-cell axis and panel_coordinates can carry the original coordinate value for each declared panel dimension. Use ntime, npanels, and npanel_observations when code needs to distinguish the shared time axis from flattened panel-cell observations.
target and channels are stored in the caller's original measurement units. Downstream spend-like arguments, including optimizer total_budget and bounds, must use the same channel units and time aggregation level.
Epsilon.ParameterDiagnostics — Type
ParameterDiagnosticsTyped convergence and Monte Carlo error diagnostics for one parameter.
Epsilon.PipelineRunConfig — Type
PipelineRunConfig(; config_path, output_dir="results", run_name=nothing, dataset_path=nothing, prior_samples=20, curve_points=100, draws=nothing, tune=nothing, chains=nothing, cores=nothing, random_seed=nothing)Bounded runtime configuration for the Phase 9 pipeline runner.
PipelineRunConfig owns the CLI/API override surface that may be merged onto a YAML pipeline config at runtime without widening the underlying MMM contract. The closed Phase 9 runtime contract freezes the keyword shape, runner-only YAML stripping, and bounded stage-execution override surface without widening the underlying MMM API.
Epsilon.PipelineRunResult — Type
PipelineRunResult(run_name, run_dir, manifest_path; status=:pending, config_path, started_at_utc, finished_at_utc=nothing, stage_records=PipelineStageRecord[], warnings=String[], error=nothing)Typed run-level summary for the bounded Phase 9 pipeline runner.
PipelineRunResult is the canonical Julia-native summary of one bounded Phase 9 pipeline execution, including stage status, artifact ownership, warnings, and failure metadata.
Epsilon.PipelineStageRecord — Type
PipelineStageRecord(key, directory; status=:pending, started_at_utc=nothing, finished_at_utc=nothing, artifact_paths=Dict(), warnings=String[], error=nothing)Typed per-stage manifest record for the bounded Phase 9 pipeline runner.
Epsilon.PipelineValidationResult — Type
PipelineValidationResult(; holdout_rows, train_date_start, train_date_end, holdout_date_start, holdout_date_end, observed, fitted_mean, residuals, metrics)Typed blocked-holdout artifact surface reserved for Phase 9 validation stage outputs.
Epsilon.R2D2Prior — Type
R2D2Prior(; mean_R2=0.5, concentration=1.0, scale=1.0, dims=nothing, centered=true)R2D2 shrinkage prior recipe using variance allocation weights. mean_R2, concentration, and scale are stored on the typed prior so the later model layer can build the full R2D2 hierarchy. The deterministic helper functions in this file consume scale once phi and tau2 are already given; mean_R2 and concentration remain model-layer metadata.
Epsilon.ResponseCurveResults — Type
ResponseCurveResultsTyped draw-level counterfactual response surface for one media channel derived from grouped InferenceResults.
For time-series models, values has dimensions (draw, spend_point) and stores total channel contribution in observed target units for each requested total-spend point. For bounded panel replay, values has dimensions (draw, panel, spend_point); the spend grid is a panel-by-spend-point matrix generated from a shared historical-scaling delta_grid. The delta_grid values are historical spend multipliers, not absolute spend values.
Epsilon.SamplerConfig — Type
SamplerConfig(; draws=1000, tune=1000, chains=4, cores=chains, target_accept=0.8, random_seed=nothing, progressbar=true, compute_convergence_checks=true)Typed sampler settings for model fitting.
Epsilon.SamplerDiagnostics — Type
SamplerDiagnosticsTyped summary of HMC/NUTS sampler internals extracted from fitted chains.
Epsilon.SamplerWarning — Type
SamplerWarningTyped user-facing warning derived from sampler internals.
Epsilon.SamplerWarnings — Type
SamplerWarningsTyped warning bundle derived from sampler diagnostics.
Epsilon.SaturationCurveResults — Type
SaturationCurveResultsTyped draw-level saturation-only surface for one media channel derived from grouped InferenceResults.
For time-series models, values has dimensions (draw, spend_point). For bounded panel replay, values has dimensions (draw, panel, spend_point) and uses the same shared historical-scaling delta grid as ResponseCurveResults. The panel spend_grid axis order is always (panel, spend_point).
Epsilon.Scaled — Type
Scaled(base, scale)Continuous distribution obtained by scaling draws from base by a positive constant scale.
Epsilon.ScenarioDataArraySpec — Type
ScenarioDataArraySpec(values; dims, coords)Dimension-labelled numeric scenario input used by the bounded non-UI scenario planner surface.
The v1 planner accepts this type for channel-level manual allocations when the spec has exactly one channel dimension. Richer multi-dimensional allocation execution is intentionally deferred until the response-curve contract supports that policy directly. Allocation values must use the same original channel units and time aggregation level as the fitted model data and response surfaces.
Epsilon.ScenarioPlanResult — Type
ScenarioPlanResultAbacus-like non-UI scenario comparison tables derived from a solved Epsilon budget optimization result.
totals, channels, allocations, and metadata mirror the reusable business-planning store shape from Abacus. channel_panel_allocations is empty for time-series results and populated for bounded panel historical-share optimization results.
Spend and allocation table columns are copied from existing optimizer or manual evaluation artifacts and remain in the fitted model's original channel units and time aggregation level.
Epsilon.ScenarioStoreArtifact — Type
ScenarioStoreArtifact(plan; metadata, spec, coordinate_metadata)Typed local scenario-store artifact for a validated ScenarioPlanResult.
The serialized store is a local Epsilon/Julia artifact. CSV sidecars written by write_scenario_store are for inspection only; loads use the typed payload as the source of truth.
Epsilon.SkewStudentT — Type
SkewStudentT(; nu, mu=0, sigma=1, alpha=0)Skew-Student-t distribution using the Azzalini-Capitanio parameterization. When alpha == 0, this reduces to a location-scale Student-t distribution.
Epsilon.StandardScaler — Type
StandardScaler()Standardize each feature to zero mean and unit variance.
Epsilon.StandardizeControls — Type
StandardizeControls(control_columns)Wrapper that stores the fitted control scaler for selected columns.
Epsilon.TimeSeriesCalibrationInput — Type
TimeSeriesCalibrationInput(steps, lift_test, cost_per_target)Companion internal payload attached to a TimeSeriesMMM, bundling the raw (unscaled) calibration steps and row data supplied at construction time. Build one of these indirectly through TimeSeriesMMM's calibration_steps, lift_test_data, and cost_per_target_data constructor arguments rather than calling this constructor directly.
Epsilon.TimeSeriesMMM — Type
TimeSeriesMMM(config, sampler_config, data)Container that ties together typed config, sampler settings, and one MMM dataset for the base time-series model path.
Epsilon.TimeVaryingMediaConfig — Type
TimeVaryingMediaConfig(; m, L, time_resolution, covariance=:expquad, eta_prior, lengthscale_prior)Programmatic-only configuration for the bounded time-series shared media HSGP multiplier. m, L, and lengthscale_prior are measured in integer cadence-index units, while time_resolution is measured in days. Only scalar, dimensionless Exponential, Gamma, HalfNormal, and LogNormal EpsilonPrior values are accepted for the positive HSGP priors.
This bounded configuration enables a shared, strictly positive, mean-one HSGP multiplier for programmatic TimeSeriesMMM MCMC fitting and prediction only. YAML/pipeline configuration, panels, VI, calibration, Michaelis-Menten, channel-specific, intercept, multidimensional, periodic HSGP, TVP, and HSGP postmodel calculation routes remain unsupported.
Epsilon.UnalignedValuesError — Type
UnalignedValuesError(unaligned_values)Raised by exact_row_indices when one or more rows of calibration data cannot be exactly matched to a single coordinate value, mirroring Abacus abacus.mmm.calibration.alignment.UnalignedValuesError. unaligned_values maps each affected column name to the 1-based row indices that failed to align.
Epsilon.WeibullType — Type
WeibullTypeKernel variants for weibull_adstock.
Epsilon.active_count — Method
active_count(prior)Return the number of active entries in a masked prior.
Epsilon.adstock_curve_plot — Method
adstock_curve_plot(results::AdstockCurveResults)Render the bounded adstock-only curve surface from AdstockCurveResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.adstock_curve_results — Method
adstock_curve_results(results::InferenceResults; channel, grid=nothing, delta_grid=nothing)Compute a draw-level adstock-only curve for one supported media channel from grouped InferenceResults.
For time-series results, grid uses the same original-unit total-spend contract as the other Stage 60 curve families. For panel results, pass delta_grid to apply the same panel-cell historical-scaling contract as response_curve_results. The replay path bypasses saturation and downstream target coefficienting. Returned values stay in original channel-spend-equivalent units.
Epsilon.assert_monotonic_lift — Method
assert_monotonic_lift(delta_x, delta_y)Require that delta_x and delta_y agree in sign (or are zero) elementwise, mirroring Abacus abacus.mmm.calibration.alignment.assert_monotonic. Throws NonMonotonicError otherwise.
Epsilon.assert_scenario_store_compatible — Method
assert_scenario_store_compatible(lhs, rhs)Reject scenario stores that cannot be compared under the same model, coordinate, objective, channel-order, and current-baseline contract.
Epsilon.batched_convolution — Function
batched_convolution(x, w, axis=1, mode=After)Apply a 1D convolution across axis while broadcasting any leading batch dimensions in w against the non-convolved dimensions of x.
mode controls boundary handling:
After: trailing carryoverBefore: leading carryoverOverlap: parity-preserving overlap orientation. With source indext + ((lag_length - 1) ÷ 2) - lag + 1, an impulse at index 3 with weights[10, 20, 30]returns[0, 10, 20, 30, 0]; with weights[10, 20, 30, 40]it returns[0, 10, 20, 30, 40]. The even-length case preserves Epsilon's reference-locked orientation, not the opposite half-sample shift.
Epsilon.binomial_adstock — Function
binomial_adstock(x, alpha=0.5, l_max=12; normalize=false, axis=1, mode=After)Apply binomial adstock along axis.
alpha may be a scalar or a batch-shaped array that broadcasts against the non-convolved dimensions of x, and must satisfy 0 < alpha <= 1.
For zero-based lag l = 0, ..., l_max - 1, the unnormalized lag weight is w_l = (1 - l / (l_max + 1))^(1 / alpha - 1). When normalize=true, Epsilon normalizes those lag weights after constructing the kernel.
Epsilon.budget_audit_table — Method
budget_audit_table(result::BudgetOptimizationResult)Project the normalized bounded optimization constraints plus the solved spend allocation into an analyst-facing audit table.
The returned DataFrame covers only the optimized channel subset because the bounded Phase 8 constraint contract applies there; held channels are exposed through budget_impact_table(result) and remain fixed at observed spend.
Epsilon.budget_impact_table — Method
budget_impact_table(result::BudgetOptimizationResult)Project a bounded optimization result into a channel-level current-versus- optimized spend comparison table.
The returned DataFrame spans all modeled channels in canonical model-spec order. Optimized channels show the solver-backed spend change, while fixed channels remain unchanged so the comparison surface stays truthful for subset optimization runs.
Epsilon.budget_optimization_plot — Method
budget_optimization_plot(result)Render a bounded current-versus-optimized budget comparison figure from a budget optimization result.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.build_cost_per_target_calibration_payload — Method
build_cost_per_target_calibration_payload(; gathered_cpt, targets, sigma, transform)Build a validated CostPerTargetCalibrationPayload from plain columnar cost-per-target input, rescaling each of gathered_cpt, targets, and sigma through transform via scale_target_for_lift_measurements.
Epsilon.build_lift_test_calibration_payload — Method
build_lift_test_calibration_payload(; channel, x, delta_x, delta_y, sigma, channel_columns, channel_transform, target_transform)Build a validated LiftTestCalibrationPayload from plain columnar lift-test input. Reuses assert_monotonic_lift and scale_lift_measurements for monotonicity checking and scaling, then resolves each row's channel label into a 1-based index into channel_columns.
Epsilon.build_model — Method
build_model(model)Resolve one typed MMM object into a backend-agnostic model specification that the later Turing model layer can consume.
Epsilon.centered_logistic_saturation — Function
centered_logistic_saturation(x, lam=0.5)Apply centered logistic saturation elementwise.
This curve is 2 / (1 + exp(-lam * x)) - 1, computed as the numerically stable equivalent tanh(lam * x / 2). It maps zero input to zero output and approaches one for large nonnegative input.
x is interpreted as media spend or exposure and must be nonnegative. Use tanh_saturation only when a signed low-level transform is required.
lam may be a scalar or an array that broadcasts against x.
Epsilon.contribution_area_plot — Method
contribution_area_plot(results::ContributionResults; channels=nothing)Render a stacked additive contribution breakdown through time from ContributionResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.contribution_plot — Method
contribution_plot(results::ContributionResults; channels=nothing)Render HDI-aware time-series media contribution plots from a bounded ContributionResults surface.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.contribution_results — Method
contribution_results(results::InferenceResults)Compute draw-level additive contributions from grouped InferenceResults.
The returned ContributionResults surface preserves canonical draw-level values. Time-series results use dimensions (draw, observation, component); bounded panel results use (draw, time, panel, component), where multidimensional panels are represented on the deterministic flat panel-cell axis carried by the model spec.
Epsilon.convergence_report — Method
convergence_report(results; rhat_threshold=1.05, ess_threshold=100.0)
convergence_report(model; rhat_threshold=1.05, ess_threshold=100.0)Build a typed threshold-based convergence report from fitted model results or a fitted model.
Epsilon.convergence_warnings — Method
convergence_warnings(report)
convergence_warnings(results; rhat_threshold=1.05, ess_threshold=100.0)
convergence_warnings(model; rhat_threshold=1.05, ess_threshold=100.0)Build typed user-facing warnings from a convergence report, fitted results, or fitted model.
Epsilon.cost_per_target_penalties — Method
cost_per_target_penalties(gathered_cpt, targets, sigma)Compute the Abacus cost-per-target Gaussian soft-penalty term elementwise, -(|gathered_cpt - targets|)^2 / (2 * sigma^2), mirroring abacus.mmm.calibration.graph.add_cost_per_target_potentials.
Epsilon.cost_per_target_total_penalty — Method
cost_per_target_total_penalty(gathered_cpt, targets, sigma)Sum cost_per_target_penalties into the scalar value Abacus passes to pm.Potential.
Epsilon.decomposition_plot — Method
decomposition_plot(results::DecompositionResults)Render a bounded decomposition figure in observed target units from DecompositionResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.decomposition_results — Method
decomposition_results(results::InferenceResults)Aggregate time-indexed additive contributions into draw-level component totals and shares.
The returned DecompositionResults surface preserves canonical draw-level component totals and shares with dimensions (draw, component) for bounded time-series and panel contribution surfaces.
Epsilon.delayed_adstock — Function
delayed_adstock(x, alpha=0.0, theta=0, l_max=12; normalize=false, axis=1, mode=After)Apply delayed adstock along axis.
alpha and theta may be scalars or batch-shaped arrays that broadcast against the non-convolved dimensions of x.
Epsilon.deserialize_model_config — Method
deserialize_model_config(model_config; non_distributions=())Walk a model configuration dictionary and convert prior-like mappings into EpsilonPrior values. Non-prior entries are preserved.
Epsilon.deserialize_prior — Method
deserialize_prior(value)Deserialize a dictionary-based prior specification into an EpsilonPrior. Supports both distribution: ... and legacy dist / kwargs shapes.
Epsilon.epsilon_theme — Method
epsilon_theme()Return the optional CairoMakie-backed Epsilon plotting theme.
Plotting is an optional extension. Load CairoMakie alongside Epsilon before calling plotting APIs:
using Epsilon, CairoMakieEpsilon.epsilon_version — Method
epsilon_version()Return the installed Epsilon package version.
Epsilon.evaluate_manual_scenario — Method
evaluate_manual_scenario(results, scenario; objective=:total_response, grid=nothing)Evaluate one manually specified channel allocation against existing fitted time-series response surfaces.
results must be grouped time-series InferenceResults. The supplied ManualAllocationScenarioSpec may allocate all channels or a subset of channels; omitted channels are held at observed spend. The function computes a deterministic posterior-mean response comparison using the same bounded response-surface interpolation path as optimize_budget. It does not refit the model, solve an optimization problem, simulate future spend paths, or support panel manual allocation.
Epsilon.exact_row_indices — Method
exact_row_indices(coords, df) -> Dict{String, Vector{Int}}Return, for each column shared between df and coords, the 1-based index into the corresponding coordinate vector for every row of df.
coords and df are both column-name-to-vector mappings. Every value in a shared column must match exactly one coordinate value; throws UnalignedValuesError listing the offending rows otherwise, and throws ArgumentError when a df column has no matching coords entry. This mirrors Abacus abacus.mmm.calibration.alignment.exact_row_indices, adapted to Julia's native 1-based indexing.
Epsilon.expand_masked_values — Method
expand_masked_values(prior, active_values; fill=0.0)Expand active-subset values back to the full masked shape.
Epsilon.finnish_horseshoe_coefficients — Method
finnish_horseshoe_coefficients(prior, z, local_scales, global_scale)Apply the regularized horseshoe coefficient construction.
This helper uses the prior's scale and slab_scale terms after the required latent draws have already been supplied. It does not sample or otherwise consume slab_df.
Epsilon.fit! — Function
fit!(model::TimeSeriesMMM)
fit!(model::PanelMMM)
fit!(scaler::Union{MaxAbsScaler, StandardScaler}, data)Fit an MMM model or preprocessing scaler in-place.
fit!(model::TimeSeriesMMM)runs the configured sampling backend and stores the resulting fit artifact onmodel.fit!(model::PanelMMM)runs the bounded hierarchical panel sampling backend and stores the resulting fit artifact onmodel.fit!(scaler, data)estimates scaling parameters from vector or matrix data for latertransformorinverse_transformcalls.
Epsilon.fit_transform! — Method
fit_transform!(scaler, data)Fit a scaler and immediately transform the same data.
Epsilon.fourier_features — Method
fourier_features(dayofperiod, period, n_order)Construct a Fourier design matrix with n_order sine modes followed by n_order cosine modes for the provided within-period positions.
This ordering matches Abacus's retained Fourier helpers: sin_1, sin_2, ..., cos_1, cos_2, ....
Epsilon.gamma_shape_scale — Method
gamma_shape_scale(mu, sigma)Convert a PyMC-style Gamma(mu, sigma) mean/standard-deviation parameterization into the (shape, scale) parameterization used by Distributions.Gamma. mu and sigma must both be strictly positive.
Epsilon.geometric_adstock — Function
geometric_adstock(x, alpha=0.0, l_max=12; normalize=false, axis=1, mode=After)Apply geometric adstock along axis.
alpha may be a scalar or a batch-shaped array that broadcasts against the non-convolved dimensions of x.
Epsilon.has_convergence_issues — Method
has_convergence_issues(report)Return true when a convergence report contains any flagged metrics.
Epsilon.has_convergence_warnings — Method
has_convergence_warnings(warnings)Return true when a convergence warning bundle contains any warnings.
Epsilon.has_numerical_errors — Method
has_numerical_errors(diagnostics)Return true when sampler diagnostics record any numerical-error transitions.
Epsilon.has_sampler_warnings — Method
has_sampler_warnings(warnings)Return true when a sampler warning bundle contains any warnings.
Epsilon.hill_function — Method
hill_function(x, slope, kappa)Apply the Hill saturation curve elementwise.
slope and kappa may be scalars or arrays that broadcast against x.
Epsilon.horseshoe_coefficients — Method
horseshoe_coefficients(prior, z, local_scales, global_scale)Apply the horseshoe coefficient construction to latent standard-normal draws and shrinkage scales.
Epsilon.inference_results — Method
inference_results(model; new_data=model.data, include_prior=true, include_posterior_predictive=true, include_prior_predictive=true)Extract the canonical grouped inference-results artifact from a fitted model.
This grouped surface is additive to model_results(model; ...): the existing ModelResults container remains the flatter convenience view, while InferenceResults preserves grouped posterior, prior, predictive, sample-stat, and observed-data content together for supported Turing-backed fits.
Epsilon.instantiate_distribution — Method
instantiate_distribution(prior)Build a Distributions.jl distribution from an EpsilonPrior whose parameters are concrete scalar values.
Epsilon.inverse_transform — Method
inverse_transform(scaler, data)Undo a fitted scaling transform.
Epsilon.lift_test_estimated_lift — Method
lift_test_estimated_lift(saturation_fn, x, delta_x)Compute the model-estimated lift saturation_fn(x + delta_x) - saturation_fn(x) for a lift-test row, mirroring the core computation in Abacus abacus.mmm.calibration.graph.add_saturation_observations. saturation_fn must accept and return a vector (for example x -> centered_logistic_saturation(x, lam)).
Epsilon.lift_test_estimated_lift_ad — Method
lift_test_estimated_lift_ad(saturation_fn, x, delta_x)AD-compatible variant of lift_test_estimated_lift for use on the Turing sampling path, where saturation_fn may close over sampled saturation parameters and therefore return AD numeric types (for example ForwardDiff.Dual or ReverseDiff.TrackedReal) rather than plain Float64. Computes saturation_fn(x + delta_x) .- saturation_fn(x) without forcing Float64 conversion of saturation_fn's output, unlike lift_test_estimated_lift (whose Float64.(collect(...))-based result validation would otherwise truncate AD dual/tracked numbers and break gradients).
x and delta_x are the fixed (non-parameter), already-scaled calibration data and are still eagerly validated as finite Float64 vectors; only saturation_fn's output is left untouched so that AD types survive.
Epsilon.lift_test_gamma_distribution — Method
lift_test_gamma_distribution(mu, sigma)Build the Distributions.Gamma lift-test observation distribution Abacus registers via pm.Gamma(mu=mu, sigma=sigma, observed=...) in abacus.mmm.calibration.graph.add_saturation_observations.
Epsilon.lift_test_likelihood_terms — Method
lift_test_likelihood_terms(saturation_fn, x, delta_x, delta_y, sigma)Compute the Abacus lift-test likelihood-term ingredients for one batch of lift-test rows: the Gamma observation mean mu = |estimated_lift|, the observed value |delta_y|, and the elementwise Gamma log-density logp = logpdf(Gamma(mu, sigma), |delta_y|). Returns a named tuple (; mu, observed, logp).
Epsilon.lift_test_log_density — Method
lift_test_log_density(saturation_fn, x, delta_x, delta_y, sigma)AD-compatible lift-test log-density contribution for one batch of lift-test rows, computed entirely from already-scaled model-space values: the total Gamma log-density sum(logpdf(Gamma(mu, sigma), |delta_y|)), where mu = |saturation_fn(x + delta_x) - saturation_fn(x)|.
This mirrors the (summed) logp produced by lift_test_likelihood_terms, but unlike that function it does not force saturation_fn's output to Float64, so it is safe to call with a saturation_fn that closes over sampled Turing parameters. That makes it suitable for Turing.@addlogprob! integration on the model's saturation parameter sampling path (Task 15-05). This function itself has no dependency on Turing. saturation_fn must be a pure saturation closure with no adstock applied, preserving the calibration contract that adstock is never inserted into lift-test calibration.
Throws ArgumentError for mismatched lengths, non-finite x/delta_x/ delta_y, non-positive sigma, or a non-positive/non-finite estimated lift magnitude (which would make the observation's Gamma mean degenerate, for example when the estimated lift is exactly zero).
Epsilon.lift_test_payload_log_density — Method
lift_test_payload_log_density(saturation_fn, payload, channel_param)Multi-channel, LiftTestCalibrationPayload-aware entry point for lift_test_log_density: selects each row's saturation parameter from a full per-channel sampled parameter vector channel_param (indexed the same way as the model's channel axis, so that channel_param[payload.channel_index[i]] is the parameter for row i), then delegates to lift_test_log_density.
saturation_fn must accept (x_row, param_row) — both row-aligned vectors — and return a row-aligned vector, for example (x_row, lam_row) -> centered_logistic_saturation.(x_row, lam_row).
This is the intended calibration entry point for Task 15-05's Turing.@addlogprob! wiring, where channel_param is a sampled Turing parameter vector (for example the model's lam) and may carry AD dual/tracked numeric types; this function itself has no dependency on Turing.
Throws ArgumentError if any payload.channel_index value is out of bounds for channel_param, so a channel-index/parameter-vector length mismatch fails closed rather than throwing an opaque BoundsError deep inside AD.
Epsilon.load_inference_results — Method
load_inference_results(path)Load a serialized InferenceResults artifact from path.
Epsilon.load_model — Method
load_model(path)Load a serialized Epsilon model object from path.
Julia serialization artifacts are trusted-local only. Epsilon validates model payload lifecycle state after deserialization, including retained HSGP media state in schema-v2 envelopes.
Epsilon.load_model_config — Method
load_model_config(path; defaults=Dict(), overrides=Dict())Load and return only the typed ModelConfig.
Epsilon.load_public_config — Method
load_public_config(path; defaults=Dict(), overrides=Dict())Load a YAML config file and return typed model and sampler config objects plus the merged effective mapping.
Epsilon.load_results — Method
load_results(path)Load a serialized ModelResults object from path.
Epsilon.load_sampler_config — Method
load_sampler_config(path; defaults=Dict(), overrides=Dict())Load and return only the typed SamplerConfig.
Epsilon.load_scenario_store — Method
load_scenario_store(path)::ScenarioStoreArtifactLoad and validate the typed scenario-store payload from path.
Epsilon.logistic_saturation — Function
logistic_saturation(x, lam=0.5)Legacy compatibility alias for centered_logistic_saturation.
New code should call centered_logistic_saturation directly. The public config value media.saturation.type = "logistic" currently uses this centered logistic curve for compatibility with existing Epsilon model semantics.
Like centered_logistic_saturation, this alias interprets x as media spend or exposure and rejects negative inputs.
Epsilon.max_abs_scale_channel_data — Method
max_abs_scale_channel_data(wrapper, data)Fit and apply max-absolute scaling to selected channel columns.
Epsilon.max_abs_scale_target_data — Method
max_abs_scale_target_data(wrapper, data)Fit and apply max-absolute scaling to target data.
Epsilon.metric_results — Method
metric_results(results::InferenceResults; channel, grid=nothing, delta_grid=nothing)Compute draw-level ROAS, mROAS, CPA, and mCPA for one supported media channel from grouped InferenceResults.
Metrics are derived from the same bounded response-curve surface returned by response_curve_results(results; channel, grid, delta_grid) rather than a separate formula path. Panel metrics therefore inherit the explicit delta_grid historical-scaling semantics of panel response curves.
Epsilon.metric_results — Method
metric_results(curves::ResponseCurveResults)Compute draw-level ROAS, mROAS, CPA, and mCPA from a canonical ResponseCurveResults surface.
Epsilon.michaelis_menten — Method
michaelis_menten(x, alpha, lam)Apply the Michaelis-Menten saturation curve elementwise.
x is interpreted as media spend or exposure and must be nonnegative.
alpha and lam may be scalars or arrays that broadcast against x.
Epsilon.model_config_from_dict — Method
model_config_from_dict(config; defaults=Dict(), overrides=Dict())Build a typed ModelConfig from a public YAML-style configuration dictionary. Nested mappings are merged with precedence defaults < config < overrides. Non-mapping values replace the whole node at the same path.
Epsilon.model_diagnostics — Method
model_diagnostics(results)
model_diagnostics(model)Extract typed chain diagnostics from fitted model results or a fitted model.
Epsilon.model_results — Method
model_results(model; new_data=model.data, include_posterior_predictive=true, include_prior_predictive=false)Extract the flat convenience results object from a Turing-backed fitted model.
The richer grouped InferenceResults surface is the canonical grouped artifact entry point for supported Turing fits.
Epsilon.nobs — Method
nobs(data)Return the number of observations in an MMM data container.
For MMMData, this is the number of time rows. For PanelMMMData, this currently returns flattened panel-cell observations, ntime(data) * npanels(data), to preserve existing panel artifact and model-spec contracts. Use ntime and npanels when those axes need to remain separate.
Epsilon.normalize_channel_columns — Method
normalize_channel_columns(data, channel_columns)Return channel-scaled data and the fitted MaxAbsScaleChannels wrapper.
Epsilon.npanel_observations — Method
npanel_observations(data::PanelMMMData)Return the number of flattened panel-cell observations, ntime(data) * npanels(data).
Epsilon.npanels — Method
npanels(data::PanelMMMData)Return the number of flattened panel cells in a panel MMM data container.
Epsilon.ntime — Method
ntime(data)Return the number of time rows in an MMM data container.
Epsilon.observed_fitted_plot — Method
observed_fitted_plot(results::InferenceResults)Render the bounded observed-versus-fitted time-series diagnostic for grouped InferenceResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.optimize_budget — Method
optimize_budget(results::InferenceResults; total_budget, channels=nothing, budget_bounds=nothing, relative_bounds=nothing, objective=:total_response, grid=nothing, panel_allocation_mode=:historical_shares)Run the bounded Phase 8 fixed-budget optimizer on one supported grouped InferenceResults artifact.
For time-series results, spend is allocated directly across channels. For panel results, v1 optimization allocates channel totals and preserves historical within-channel panel-cell spend shares (panel_allocation_mode = :historical_shares). Free channel-by-panel allocation, panel-total bounds, and channel-panel bounds are intentionally deferred because Stage 60 panel response curves are defined by a shared historical spend delta within each channel.
Supported constraints are the fixed total-budget equality, optional per-channel absolute bounds, optional observed-relative guardrails, and optional channel subset selection with unselected channels held fixed at observed spend.
total_budget, observed spend, explicit bounds, and response-curve spend grids must all use the same original input units as the channel columns supplied to MMMData or PanelMMMData. Epsilon does not convert currencies, time aggregation levels, or thousands/millions scaling at the optimizer boundary.
The nonlinear solve accepts locally feasible optima from Ipopt; response curves are smooth interpolations of posterior-mean grids, not a proof of global concavity.
Epsilon.panel_axes — Method
panel_axes(metadata_or_spec)Return ordered flat panel-cell axis metadata. Non-panel metadata returns an empty vector.
Epsilon.panel_axis — Method
panel_axis(metadata_or_spec)Return the single ordered PanelAxis for a panel model.
Epsilon.panel_coordinate — Method
panel_coordinate(metadata_or_spec, flat_index)Return the PanelCoordinate for one one-based flat panel-cell index.
Epsilon.panel_coordinates — Method
panel_coordinates(metadata::ModelCoordinateMetadata)
panel_coordinates(spec::MMMModelSpec)Return the deterministic mapping from Epsilon's flat panel_cell axis to named panel coordinates.
For one-dimensional and multi-dimensional panel models, Epsilon keeps panel_cell as the explicit flat axis and stores the declared panel-dimension coordinate columns in PanelAxis order.
Epsilon.pipeline_main — Function
pipeline_main(args = ARGS)Run the bounded Phase 9 pipeline CLI.
The current supported CLI surface is one thin command:
epsilon run <config_path>
All supported flags map one-to-one onto PipelineRunConfig and route through the same run_pipeline(config) implementation.
Epsilon.posterior_density_plot — Method
posterior_density_plot(results::InferenceResults; parameters=nothing, max_parameters=8)Render a bounded posterior-density figure for grouped InferenceResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.predict — Function
predict(model, new_data=model.data)Generate posterior predictive samples from the latest successful fitted MMM artifact.
Epsilon.prior_posterior_plot — Method
prior_posterior_plot(results::InferenceResults; parameter)Render a bounded prior-versus-posterior density overlay for one parameter from grouped InferenceResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.prior_predict — Function
prior_predict(model, new_data=model.data)Generate prior predictive samples for a typed MMM model.
Epsilon.r2d2_coefficients — Method
r2d2_coefficients(prior, z, phi, tau2)Apply the R2D2 coefficient construction to latent standard-normal draws.
This helper converts supplied phi and tau2 values into coefficient draws; it does not sample or otherwise consume the prior's mean_R2 or concentration hyperparameters directly.
Epsilon.r2d2_variance_weights — Method
r2d2_variance_weights(prior, phi, tau2)Convert simplex-like variance allocations and a global variance term into coefficient variances.
This deterministic helper uses prior.parameters[:scale] once phi and tau2 are already given. mean_R2 and concentration parameterize the upstream stochastic prior over those quantities and are therefore model-layer metadata rather than inputs to this variance calculation.
Epsilon.regularized_local_scales — Method
regularized_local_scales(prior, local_scales, global_scale)Compute regularized local scales for the Finnish horseshoe.
This deterministic helper uses prior.parameters[:slab_scale]. slab_df belongs to the stochastic slab prior in the later model layer and is not part of this closed-form local-scale update.
Epsilon.residual_diagnostics_plot — Method
residual_diagnostics_plot(results::InferenceResults)Render the bounded residual-diagnostics figure for grouped InferenceResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.response_curve_plot — Method
response_curve_plot(results::ResponseCurveResults)Render the bounded response-curve surface from ResponseCurveResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.response_curve_results — Method
response_curve_results(results::InferenceResults; channel, grid=nothing, delta_grid=nothing)Compute a draw-level forward-pass contribution curve for one supported media channel from grouped InferenceResults.
For time-series results, grid is interpreted in original total-spend units across the observed horizon for the selected channel. For panel results, pass delta_grid; each delta rescales the observed historical spend path for every panel cell and the returned surface stays at panel-cell/channel level. This canonical Stage 60 surface preserves the observed temporal spend shape and replays the full scaled media path: channel scaling, adstock, saturation, and coefficient ownership.
Epsilon.run_pipeline — Method
run_pipeline(config::PipelineRunConfig)Execute the bounded Phase 9 pipeline runner across the current supported stage surface.
The closed Phase 9 surface validates the supported pipeline contract, loads the combined CSV dataset, executes the bounded time-series MCMC stage sequence, persists stage-owned artifacts, and returns a truthful completed PipelineRunResult when all enabled stages succeed.
Epsilon.sampler_config_from_dict — Method
sampler_config_from_dict(config; defaults=Dict(), overrides=Dict())Build a typed SamplerConfig from either a top-level public config or a nested sampler mapping. Nested mappings are merged with precedence defaults < config < overrides.
Epsilon.sampler_diagnostics — Method
sampler_diagnostics(results)
sampler_diagnostics(model)Extract typed HMC/NUTS sampler diagnostics from fitted model results or a fitted model.
Epsilon.sampler_warnings — Method
sampler_warnings(diagnostics; numerical_error_threshold=0, tree_depth_threshold=10, acceptance_rate_threshold=0.65)
sampler_warnings(results; ...)
sampler_warnings(model; ...)Build typed user-facing warnings from sampler diagnostics, fitted results, or a fitted model.
Epsilon.saturation_curve_plot — Method
saturation_curve_plot(results::SaturationCurveResults)Render the bounded saturation-only curve surface from SaturationCurveResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.saturation_curve_results — Method
saturation_curve_results(results::InferenceResults; channel, grid=nothing, delta_grid=nothing)Compute a draw-level saturation-only curve for one supported media channel from grouped InferenceResults.
For time-series results, grid uses the same original-unit total-spend contract as response_curve_results(results; channel, grid). For panel results, pass delta_grid to apply the same panel-cell historical-scaling contract as response_curve_results. The replay path bypasses adstock and returns saturation-only contribution in observed target units.
Epsilon.save_inference_results — Method
save_inference_results(path, results)Serialize a grouped InferenceResults artifact to path.
Epsilon.save_model — Method
save_model(path, model)Serialize a typed Epsilon model object to path.
The current implementation persists the typed model/config/data state plus any fitted chain artifacts and metadata needed to resume posterior predictive use. Ephemeral backend closures are rebuilt on demand rather than written to disk.
Julia serialization artifacts are trusted-local only: deserialization executes before Epsilon can validate the restored structure. Model payload schema v2 validates retained HSGP media state after deserialization before restoring a model lifecycle.
Epsilon.save_results — Method
save_results(path, results)Serialize a typed results object to path.
Epsilon.scale_channel_lift_measurements — Method
scale_channel_lift_measurements(channel, x, delta_x, channel_columns, transform)Rescale lift-test x/delta_x values through a fitted channel transform (for example a fitted MaxAbsScaler's transform applied to its underlying matrix), mirroring Abacus abacus.mmm.calibration.scaling.scale_channel_lift_measurements.
Each row's value is embedded into a zero-filled (nrows, nchannels) matrix at its own channel's column, transform is applied to that full matrix, and each row's own scaled value is read back out. This reproduces Abacus's pivot/transform/unpivot behavior for any matrix-valued transform. Returns a named tuple (; channel, x, delta_x).
Epsilon.scale_lift_measurements — Method
scale_lift_measurements(channel, x, delta_x, delta_y, sigma, channel_columns, channel_transform, target_transform)Rescale a full lift-test dataset (channel-indexed x/delta_x plus target-like delta_y/sigma) for use against a scaled model, mirroring Abacus abacus.mmm.calibration.scaling.scale_lift_measurements. Returns a named tuple (; channel, x, delta_x, delta_y, sigma).
Epsilon.scale_target_for_lift_measurements — Method
scale_target_for_lift_measurements(target, transform)Rescale a lift-test target-like vector (delta_y or sigma) through a fitted target transform, mirroring Abacus abacus.mmm.calibration.scaling.scale_target_for_lift_measurements.
Epsilon.scenario_plan — Method
scenario_plan(evaluation; current_scenario=...)
scenario_plan(evaluations; current_scenario=...)Project evaluated manual-allocation scenarios into deterministic non-UI scenario-planner tables.
This overload consumes one or more ManualScenarioEvaluationResult values. It reports the supplied current scenario plus each evaluated manual allocation as scenario_type = "manual_allocation". It does not refit, optimize, simulate future spend paths, or solve optimization. Use scenario_plan(result, evaluations) when compatible manual evaluations and a solved fixed-budget optimization result should be compared in one plan.
Epsilon.scenario_plan — Method
scenario_plan(result; current_scenario=..., optimized_scenario=nothing)
scenario_plan(result, evaluation/evaluations; current_scenario=..., optimized_scenario=nothing)Build deterministic scenario-planner comparison tables from a solved BudgetOptimizationResult or PanelBudgetOptimizationResult.
This function is intentionally a reporting/planning projection. It does not simulate new spend paths, refit models, or solve another optimization problem. For panel results it preserves the v1 historical-share policy already encoded by optimize_budget.
When supplied with already evaluated manual-allocation scenarios, the combined overload returns one plan with current, manual, and optimised scenarios after verifying that all artifacts share the same model metadata, spec, coordinate metadata, objective, and current baseline.
Epsilon.scenario_store_plan — Method
scenario_store_plan(store)::ScenarioPlanResultProject a typed scenario store back to a copied ScenarioPlanResult.
Epsilon.standardize_control_data — Method
standardize_control_data(wrapper, data)Fit and apply standardization to selected control columns.
Epsilon.summary_table — Function
summary_table(result)Project a typed Phase 7 post-model result surface into an analyst-ready DataFrame.
Current supported methods are:
summary_table(results::ContributionResults)summary_table(results::DecompositionResults)summary_table(results::ResponseCurveResults)summary_table(results::SaturationCurveResults)summary_table(results::AdstockCurveResults)summary_table(results::MetricResults)
Epsilon.tanh_saturation — Function
tanh_saturation(x, b=0.5, c=0.5)Apply tanh saturation elementwise.
This is the only signed low-level saturation primitive: reference fixtures include negative x values. Public MMM media containers and response grids still reject negative media spend before model replay.
b and c may be scalars or arrays that broadcast against x.
Epsilon.trace_plot — Method
trace_plot(results::InferenceResults; parameters=nothing, max_parameters=8)Render a bounded posterior trace-plot figure for MCMC-backed grouped InferenceResults.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.transform — Method
transform(scaler, data)Apply a fitted scaler to vector or matrix data.
Epsilon.validate_calibration_step_config — Method
validate_calibration_step_config(config)Deprecated public validation wrapper for one CalibrationStepConfig.
Use CalibrationStepConfig construction or load_public_config calibration parsing instead. Direct calls emit a deprecation warning, then validate that method is non-empty and one of the currently supported calibration methods, and that params does not configure a custom dist.
Epsilon.validate_channel_values — Method
validate_channel_values(data, channel_columns)Warn when selected channel columns contain negative values.
Epsilon.validate_column_indices — Method
validate_column_indices(ncols, columns, name)Validate a column-selection vector for matrix data.
Epsilon.validate_cost_per_target_calibration_payload — Method
validate_cost_per_target_calibration_payload(payload)Deprecated public validation wrapper for one CostPerTargetCalibrationPayload.
Use build_cost_per_target_calibration_payload instead. Direct calls emit a deprecation warning, then validate that all fields have matching, nonzero length; gathered_cpt and targets are finite; and sigma is strictly positive and finite.
Epsilon.validate_lift_test_calibration_payload — Method
validate_lift_test_calibration_payload(payload)Deprecated public validation wrapper for one LiftTestCalibrationPayload.
Use build_lift_test_calibration_payload instead. Direct calls emit a deprecation warning, then validate that all fields have matching, nonzero length; channel_index is strictly positive (1-based); x, delta_x, and delta_y are finite; and sigma is strictly positive and finite.
Epsilon.validate_lift_test_columns — Method
validate_lift_test_columns(columns)Require that columns contains the lift-test data columns Abacus needs to register a calibration likelihood term: x, delta_x, delta_y, and sigma.
Epsilon.validate_mmm_data — Method
validate_mmm_data(data)Deprecated public validation wrapper for an MMMData container.
Use MMMData construction before building TimeSeriesMMM instead. Direct calls emit a deprecation warning, then validate the typed data container.
Epsilon.validate_model_config — Method
validate_model_config(config)Deprecated public validation wrapper for one model configuration object.
Use ModelConfig construction or load_model_config instead. Direct calls emit a deprecation warning, then validate the typed model configuration.
Epsilon.validate_panel_mmm_data — Method
validate_panel_mmm_data(data)Validate a PanelMMMData container.
Epsilon.validate_sampler_config — Method
validate_sampler_config(config)Deprecated public validation wrapper for one sampler configuration.
Use SamplerConfig construction or load_sampler_config instead. Direct calls emit a deprecation warning, then validate sampler settings.
Epsilon.validate_target_data — Method
validate_target_data(data)Require target data to have at least one element.
Epsilon.weibull_adstock — Function
weibull_adstock(x, lam=1, k=1, l_max=12; axis=1, mode=After, type=:pdf, normalize=false)Apply Weibull adstock along axis.
lam and k may be scalars or batch-shaped arrays that broadcast against the non-convolved dimensions of x.
type accepts :pdf, :cdf, "pdf", "cdf", Epsilon.PDF, or Epsilon.CDF.
For type=:cdf, Epsilon preserves the current Abacus convention of prepending a leading self-retention term before cumulative multiplication, so the effective kernel has l_max + 1 entries.
Epsilon.write_plot_bundle — Method
write_plot_bundle(run::PipelineRunResult; output_dir=nothing) -> StringWrite the bounded static plot bundle for a successful pipeline run.
Requires optional plotting support. Load CairoMakie before calling.
Epsilon.write_scenario_store — Method
write_scenario_store(path, plan; metadata, spec, coordinate_metadata)Write a local scenario store directory for plan.
The writer replaces the typed payload and known CSV sidecars. It removes stale channel_panel_allocations.csv sidecars when the current plan has no panel allocation table.