How can I get confidence intervals in matlab using fmincon?
12 次查看(过去 30 天)
显示 更早的评论
I have a model that is a series of ODEs with parameters. My question is, how could I determine the confidence intervals of my parameters using the fmincon function which allows me to put bounds on my parameters? If I cannot use fmincon to do this, is there another function or program I can use that will do this? I have seen the ci=nlparci function but I am not sure if I can use that for what I am doing.
Thanks!
4 个评论
george hargenrader
2020-11-11
Hi Sean Quinn
Did you ever figure this out? I am having the same problem where I don't know how to get confidence intervals for my fitted parameters from a set of ODEs using solve which is choosing to use fmincon.
回答(1 个)
John D'Errico
2020-11-11
@george hargenrader, as well as @Sean Quinn, but probably too late for the OP...
You are using fmincon because there are constraints. If there are no constraints, then why use the wrong tool? However, those constraints would invalidate the assumptions necessary to produce confidence intervals using the standard methods, at least if one or more of the constraints are active. This is the case for inequality constraints, which would include bound constraints. (If there were equality constraints, at least linear equality constraints among the parameters and nothing else, there would be things you could do by reducing the model, projecting into a subspace. But any active inequality constraints blow anything you would do using traditional methods out of the water.
And no. You CANNOT use nlparci.
Is there anything you could do? Well, jackknife & bootstrapping methods are avavilable for problems like this, at least if you have the stats toolbox. You will find the function bootstrp in there.
3 个评论
george hargenrader
2020-11-11
So I think I understand the idea of bootstrating a little better. If I understand this correctly then to obtain confidence intervals for my fitted rate constants what I need to do is:
1) randomly sample my dataset with replacement
2) fit that randomly selected dataset
3) record the fitted rate constant
4) repeat steps 1-3 many times until I get a distibution of fitted rate constants
5) determin the 2.5 and 97.5 percential of my rate constants, which tells me the 95% confidence interval.
Is that correct?
John D'Errico
2020-11-12
If the only reason for using fmincon was to apply bound constraints, then lsqnonlin would be a better choice.
I'd just use bootstrp, rather than writing code, but based on my memory from long ago, that sounds reasonable.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!