Getting "mass matrix contains zero on the diagonal" when trying to fit a piecewise linear model

You can following the advice in this discussion: Switch point Metropolis tuning