Spline regression -- coefficients are about the same for all basis function

Hello!

I am building a model to explore the relationship between property value and flood risk. I have 6 variables in total including flood risk. The spline part is only put on the variable of flood risk, so the equation is

Property Value = intercept +
bathrooms_slope x bathrooms +
livingArea_slope x livingArea +
POOL_slope x POOL +
hhinc_k_slope x hhinc_k +
dist2coast_km_slope x dist2coast_km +
pm.math.dot(np.asarray(B, order=“F”), w.T)
where ‘B’ in the last term are basis functions transformed for flood risk.

Here is the plot of standardized flood risk (originally is a 0 - 1 probability variable) versus log-property value:

Here is my model specification:

However, the coefficients I got for my 6 basis functions doesn’t differ from one another, which is strange, and the std of the sample are exactly the same for all w[i]:

You can also see from the sampling plot that all my w[i] are overlapped for each chain:

I don’t know why this happened and want to ask for insights.

I have tested a simple linear regression model without the spline component first:

Property Value = intercept +
bathrooms_slope x bathrooms +
livingArea_slope x livingArea +
POOL_slope x POOL +
hhinc_k_slope x hhinc_k +
dist2coast_km_slope x dist2coast_km +
flood_risk_slope x flood_risk

And the result was reasonable:

I am wondering why I get strange coefficients for my spline components… And are there any possible solutions for this issue. Tons of thanks!

Hello,

Have you tried some troubleshooting steps like removing the intercept or removing every other term except intercept and B etc. Given that it is only the intercept and w that have large standard deviations when together but not intercept on its own, maybe there some sort of identifiability problem where the expressions containing these parameters end up having similar contributions. What does B look like? An actually fully working code would make it easier to diagnose the problem. You could also use az.plot_pair to see if intercept and w are correlated etc.