📈 Murphet — Making Prophet a Beta

A Stan-powered model that never breaks the 0-1 bounds while delivering more accurate forecasts.

Your conversion rates deserve better than stock-price models!

pip install murphet

Why Choose Murphet?

🎯

Never Break the Bounds

Keep predictions strictly between 0 and 1 with a Beta likelihood.

📊

Adaptive Uncertainty

Uncertainty intervals that adapt to data levels, especially near boundaries.

🔄

No More Artificial Kinks

Smooth logistic transitions between trends for realistic forecasts.

📅

Stable Seasonal Patterns

Regularized Fourier terms with sensible priors.

🧠

Capture Persistent Patterns

Latent AR(1) structure captures trends Prophet misses.

📈

Properly Calibrated Predictions

Smart link functions for calibrated intervals.

Quick Start (10 Lines!)

import pandas as pd, numpy as np
from murphet import fit_churn_model

# load your data: columns `ds` (dates) and `y` (0 < y < 1)
df = pd.read_csv("churn_data.csv")
df["ds"] = pd.to_datetime(df["ds"])
df["t"]  = np.arange(len(df))            # integer time index

# fit: yearly seasonality, 4 changepoints
model = fit_churn_model(
    t=df["t"], y=df["y"],
    periods=12, num_harmonics=3,
    n_changepoints=4,
    likelihood="beta", inference="nuts"
)

# forecast next 6 steps
future_t = np.arange(len(df), len(df)+6)
forecast = model.predict(future_t)