everwillow is a statistical inference library for high-energy physics built on JAX pytrees and optimistix optimizers. It provides tools for fitting, profiling, and hypothesis testing with flexible parameter handling and parameter bounds via transformations. It works with any JAX-based statistical model.
import everwillow as ew
# Define your negative log-likelihood
def nll(params):
return (params["mu"] - 2.0) ** 2 + (params["sigma"] - 1.0) ** 2
# Fit with bounds
result = ew.fit(
nll,
params={"mu": 0.0, "sigma": 0.5},
bounds={"mu": (0.0, 5.0), "sigma": (0.0, None)},
)
print(result.params) # {'mu': 2.0, 'sigma': 1.0}- Pytree parameters: Use dicts, nested structures, or custom classes
- Parameter bounds: Automatic transformations keep optimizers in unbounded space
- Fixed parameters: Freeze parameters by name or custom predicates
- JAX-native: Fast, JIT-compatible, GPU-ready
- Model agnostic: Works with any JAX-based statistical model that produces pytrees
pip install everwillowFor development:
git clone https://github.com/MoAly98/everwillow.git
cd everwillow
uv sync --group devWe welcome contributions! See CONTRIBUTING.md for setup and workflow.