I have a model equation let's call it eq_m:
that I know my dataset follows, I am trying to fit my data to eq_m so that I can use the fitted parameters to predict new data.
However this eq_m is non linear hence I used scipy's curve_fit to get the lambda, mu, sigma parameter values, using the following snippet:
opt_parms, parm_cov = o.curve_fit(eq_m, x, y,maxfev=50000)
lamb , mu, sigm = opt_parms
I run this model on various groups of data which are all supposed to follow this model, and 55/60 give me great results however the 5 remaining groups are highly over fitted and have predicted parameters with high positive values. Is there a way I can regularize the curve fit and penalize high magnitude parameter values using scipy/numpy or scikit-learn?
My supervisor suggested to use conjugate priors but I have no idea how to do that here.
Can anyone please help me with this? If I have to provide a guess to solve this problem can someone please also tell me how to calculate these guesses?