Plateau data: Initial evaluation of model at starting point failed!

Hi,

I’ve a simple model that fails in a situation where the measured data does not change. Here is the code:

import bambi as bmb
import pymc as pm 
import pandas as pd

df = pd.DataFrame({ 
        "x": [739159, 739190, 739220, 739251],
        "y": [43, 43, 43, 43],
        })

# Create the glm using the Bambi model syntax
model = bmb.Model("y ~ x", df, family="t")
model.set_priors({"nu": bmb.Prior("Gamma", alpha=3, beta=1)})

# Fit the model using a NUTS (No-U-Turn Sampler) 
trace = model.fit(
    draws=10000,
    tune=1000,
    discard_tuned_samples=True,
    chains=4, 
    progressbar=True)

The error I get is

SamplingError: Initial evaluation of model at starting point failed!
Starting values:
{'sigma_log__': array(-inf), 'nu_log__': array(0.5193919), 'Intercept': array(43.14749544), 'x': array(0.48053908)}

Logp initial evaluation results:
{'sigma': -inf, 'nu': -0.82, 'Intercept': -inf, 'x': -inf, 'y': -inf}
You can call `model.debug()` for more details.

What do I need to change to make it more robust?

Best,
Thorsten

CC @tcapretto?

I suspect thr automatic priors from the data may do something wrong here?

This data is only a subset of the complete dataset. I guess I could use the estimates for mu and sigma from the complete dataset as priors? But I’m not entirely sure how to do that with bambi