Data fitting- Fitted coefficient 'fixed at bound'

Hello and greetings,
I am trying to fit a custom function (commonly called a one-diode model) to datasets from solar cells. In the confidence intervals produced for each fitted coefficients, one of them (called J0) is always 'fixed at bound'. Can anybody elaborate on what this means? I searched within the community and in the documentation but did not find an adequate answer. The lower and upper limits defined for the coefficients are not the problem. I suspect that the cause is either with the magnitude of the coefficient (usually e-10 or e-11 Ampere) or the fact that it is related to an exponential term. I tried lowering the TolX and Tolfun values to 10-20 (even though this is probably below the limit matlab can actually use). Maybe the answer lies in using TolX and Tolfun in a better way or using another fit command (such as fitnlm) instead of fit(?).
I have attached my code which also includes example data. The equation I am trying to fit is the one in the snapshot below. It has an exponential term modelling a diode.
The actual equation I use is less elegant because I converted this 'implicit' equation into an 'explicit' one using the 'LambertW' function.
If somebody could shed some light on how to correctly handle the 'fixed at bound' situation, I would be very grateful.
Thanks and regards,
Sid

Answers (1)

Hi,
The possible Name Value pair you may change is “DiffMinChange which signifies the minimum change that will happen between any two possible values of coefficient. Also, this will be global for all coefficient so if you decrease it to 10^-12 (let’s assume) the algorithm may become slow to converge. Since one coefficient is very small (due to the exponential) the difference between two potential values also need to small otherwise it will be fixed to one bound.
Also, I will recommend checking the goodness of fit to make sure how the current model is performing. If the metrics are high, then you can assume that the model is good.

4 Comments

Hi Raunak,
Thanks a lot for your reply! The goodness of fit parameters are fine. Adjusted-R-squared value is generally > 0.99.
Unfortunately lowering DiffMinChange to 1e-15, 1e-20 or even 1e-30 did not change anything. Could the problem be that the other coefficients are orders of magnitude higher than this one (J0)? This might often be the case with equations involving coefficients inside and outside an exponential term.
Regards,
Siddhartha
Hi Siddhartha,
Since these optimizations are generally local, if you are at one bound and it is a local minimum,then it's hard to get out of it. Also you mentioned the metrics are good this means the model may perform well for unseen data.
As for the coefficients I agree since the properties in optimization is global for all coefficient, significant difference in order of magnitude will result in that coefficient converging to a bound.
The properties I mentioned and you used previously are generally good to get out of a local minimum but in your case the local minimum is indeed very low such that the neighbourhood points are not able to change the function value.
Hope this clarifies!
Dear Raunak,
Thanks for the explanation and sorry for the late reply!
Can this mean that in the local neighbourhood, the coefficienct that is 'fixed at bound' has 100 % confidence interval?
I tried a simplier exponential function to fit the data and it does not have this problem. I think the problem might be arising from the 'LambertW' function I used to convert the implicit equation into an explicit one.
Regards,
Siddhartha
Hi,
The function you are using for converting the equation can take the solution space to a different dimesnion making one of the bounds as local minimum. This can be a issue but we cannot always confirm about whether a certain transformation makes a problem unsolvalable or not. As you mentioned if the you can remove the 'LambertW' function from the equation maybe the result will be much better and you can have better metrics for the same fit.
As for the first question if the coefficient is at local minimum then it will have a 100% confidence level around its neighbourhood (Given the size of neighbourhood we cannot define in such case).

Sign in to comment.

Categories

Products

Release

R2020a

Asked:

on 25 Sep 2020

Commented:

on 15 Oct 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!