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
Keep predictions strictly between 0 and 1 with a Beta likelihood.
Uncertainty intervals that adapt to data levels, especially near boundaries.
Smooth logistic transitions between trends for realistic forecasts.
Regularized Fourier terms with sensible priors.
Latent AR(1) structure captures trends Prophet misses.
Smart link functions for calibrated intervals.
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)