Huge error while using data fitting in simbiology

4 Ansichten (letzte 30 Tage)
Varun
Varun am 3 Aug. 2017
Beantwortet: Gautham Gampa am 27 Jun. 2019
I have been trying to use it for fitting a two compartment model to some Pharmacokinetic data. The result I got on fitting is not a very good fit (fit results http://imgur.com/a/otYdH). I thought maybe this has something to do with my choice of initial estimates, so, I then sought the help of a colleague who did the fitting in Phoenix (this is another software traditionally used for Pharmacokinetic fitting, her results: http://imgur.com/a/rAC1I ). When I used these parameters as initial estimates the standard errors in the parameters that Simbiology generated was a few orders of magnitude higher than the parameters themselves and the fit was still very poor. I then thought that there was some error in the model that I was using. So I used the parameters that my colleague supplied to simulate the model with the same dose and compared the simulation results with the actual data (comparison: http://imgur.com/a/jxSIv)
I have tried playing around with the estimation method (trying lsqnonlin,fmincon and others) transformation and the algorithm settings. I have tried looking up resources online and have tried everything that they suggested which included relaxing the tolerance limit, keeping a track of the log, formatting the data in different forms, keeping track of units etc. I am not sure if I am doing something wrong or if I was missing something.
Here's the data in case you wanted to take a look
time= [ 0.0888 0.1728 0.2544 0.336 0.504 0.756 1.0056 1.5048 2.004 2.5056 3.0048 ]; %hours conc=[ 24869 4090 1596 872 427 129 85.7 49.3 34.2 20 20.6] %picogram/milliliter dose=2.1*10^6 %picogram, single IV dose
  2 Kommentare
Jan
Jan am 3 Aug. 2017
Please read your question again. It does not contain any detail which would the readers allow to reconsider, what you are doing. "Data fitting tasks" can be a variety of things. Some readers will not know "Phoenix", but if the results of this software let the problems grow, it is not useful - perhaps. That you have tried "everything" does not enlighten the readers also.
Please explain clearly, what you are doing. Post an example and explain, what "huge" means in absolute terms.
Varun
Varun am 3 Aug. 2017
Thanks for the helpful suggestion Jan. I tried to attach the image of what I meant by huge errors, somehow that didn't go through. Anyway, I edited the question now

Melden Sie sich an, um zu kommentieren.

Antworten (3)

Gautham Gampa
Gautham Gampa am 27 Jun. 2019
I was looking for an answer to a similar problem with high standard errors which is how I cam across this question, and I decided to try and run your data.
I know that this was from a long time ago, but here is a SimBiology run with your data. The Standard Errors may seem high, but the fit looks good. Here are the estimated parameters and Simulation of the real data given by you along with the simulated concentration data as "Plasma_Concentration" which was just a default name I had, since I do not know what your data is referring to. "Plasma" is referring to the volume (mL) in the central compartment, and "k1" (1/hr) and "k2" (1/hr) are the forward and reverse rate parameters between the central and peripheral compartment, while "ke" (1/hr) is the rate parameter for elimination from the central compartment.
I gave no initial estimates, just to see where the model fitting would take it, and it looked good. I used the estimation method Isqnonlin. I didn't play around with any of the other algorithm settings, either.
If anyone has input on why the Standard Error is so high, when the fit looks good, please give your input.
RandomParameters.JPG
RandomSimulation.JPG

Arthur Goldsipe
Arthur Goldsipe am 8 Aug. 2017
Bad fits like this can be caused by poor/insufficient data, problems with the model, or problems with the fit. It's difficult to diagnose the exact problem without having the actual code. I've contacted the user directly to ask for the project.

John D'Errico
John D'Errico am 3 Aug. 2017
The crystal ball is so foggy today. What exactly you did, what you tried. We cannot read your mind. But I'll hazard a guess. I might be wrong. In that case, maybe I need to pick up a bottle of the crystal ball cleaner. I'm sure I can buy it online.
I think what you did was take some coefficients that were given to you, rounded to too few significant digits, then you tried to use the rounded coefficients. This is often the case, especially when models were overfitted, thus too many terms were used. You get a good fit, but the coefficients mean little.
I'll give you an example of what I THINK you did. I'll start by making up some garbage data.
x = rand(1,10)*2 - 1;
y = exp(x) + randn(size(x));
P9 = polyfit(x,y,9)
P9 =
-81089 1.3476e+05 60522 -1.8762e+05 24857 78258 -24766 -8232.6 3444 -233.65
That is not the true values of those coefficients. That is just as they, rounded off to 5 significant digits.
This will be a little better, but still not the exact values stored in MATLAB.
format long g
P9
P9 =
Columns 1 through 6
-81089.3461895953 134764.851748061 60521.6498525447 -187617.186509473 24856.9662439673 78257.9981077358
Columns 7 through 10
-24765.5523105969 -8232.57814042534 3443.98668781279 -233.645061890357
But now, let me store the approximate values in a second polynomial.
P9R = [-81089 1.3476e+05 60522 -1.8762e+05 24857 78258 -24766 -8232.6 3444 -233.65];
Now, compute the standard deviation of the residuals for the original polynomial, and then the 5 digit approximation.
stdP9 = std(polyval(P9,x) - y)
stdP9 =
1.09030773996899e-11
stdP9R = std(polyval(P9R,x) - y)
stdP9R =
1.63244721964179
So by using a 5 digit approximation to those coefficients, the standard deviation of the residuals is only about 11 powers of 10 larger.
Again, I might be wrong here. But so many people have made this same mistake, that I'm willing to bet I might be right. And if not, then you need to explain what you did, because I simply cannot read your mind.
  1 Kommentar
Varun
Varun am 3 Aug. 2017
Hi John,
Thanks for your snarky reply. You must have really loved typing this. Are you usually this full of yourself or was today a little special? You could have been helpful by saying what Jan said, and by providing helpful suggestions, but I guess constructive criticism is something you are not familiar with. Just a parting suggestion, instead of buying a crystal ball cleaner, maybe, next time just ignore a question that is not clear enough. I am pretty sure there are a tonne of people out there which you could help with your 'experience'.
Thanks again for your kind help.
Varun

Melden Sie sich an, um zu kommentieren.

Communitys

Weitere Antworten in  SimBiology Community

Kategorien

Mehr zu Import Data finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by