CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-pymc3

Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano

Agent Success

Agent success rate when using this tile

68%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.94x

Baseline

Agent success rate without this tile

72%

Overview
Eval results
Files

task.mdevals/scenario-1/

Log Probability Helpers

Utilities for building PyTensor-friendly graphs that expose log densities, log-tail probabilities, and quantiles for a univariate Gaussian defined by a supplied mean and standard deviation.

Capabilities

Elementwise log density

  • With values [-1.0, 0.0, 1.0], mean 0.0, and scale 1.0, returns log densities approximately [-1.4189, -0.9189, -1.4189] while preserving the input shape. @test
  • With value 0.0, mean 0.0, and scale 0.5, returns a log density around -0.2258. @test

Tail log CDF

  • For value 1.5 under mean 0.0 and scale 1.0, returns the log probability of being at or below the value, near -0.0691. @test
  • For value -2.0 under mean 0.0 and scale 1.0, returns the log probability of being at or below the value, near -3.7832. @test

Quantile retrieval

  • For probability 0.975 with mean 0.0 and scale 1.0, returns a quantile near 1.95996. @test
  • For probability 0.25 with mean 2.0 and scale 0.5, returns a quantile near 1.66276. @test

Implementation

@generates

API

from typing import Sequence
import numpy as np
import pytensor.tensor as pt

ArrayLike = Sequence[float] | np.ndarray | pt.TensorVariable

def elementwise_log_density(values: ArrayLike, mean: float, sigma: float) -> pt.TensorVariable:
    """
    Build a graph returning the per-observation log density for the defined variable.
    Preserves input shape and supports symbolic inputs.
    """
    ...

def tail_log_cdf(value: float | pt.TensorVariable, mean: float, sigma: float) -> pt.TensorVariable:
    """Build a graph returning the log probability that the variable is less than or equal to the supplied value."""
    ...

def quantile(probability: float | pt.TensorVariable, mean: float, sigma: float) -> pt.TensorVariable:
    """Build a graph returning the value whose cumulative probability matches the supplied probability."""
    ...

Dependencies { .dependencies }

PyMC { .dependency }

Probabilistic programming runtime providing log-probability evaluation and distribution-aware math for PyTensor graphs. @satisfied-by

tile.json