Prev: Results not repeatable for sum() function on fixed / deterministic vector
Next: Results not repeatable for sum() function on fixed / deterministic vector
From: Elad Steinberg on 5 Apr 2010 13:03 Hi all, I'm fitting a very basic function 'x+a' to my data set which has some scatter to it. I'm interested in knowing for what range of 'a' does 95% of my data point fall into (meaning what is the minimum and maximum 'a' for which I encompass 95%). When I click the option of show prediction bounds it appears to show me them correctly but they do not correspond to the 95% confidence of my coefficient given by the fit. How can I find out the coefficients that were used in drawing the prediction bounds? I'm attaching a link to a print screen of my problem in order to clarify things. http://img186.imageshack.us/img186/2057/matlabv.jpg Thank you very much for the help, Elad
From: Tom Lane on 5 Apr 2010 16:04 > I'm fitting a very basic function 'x+a' to my data set which has some > scatter to it. I'm interested in knowing for what range of 'a' does 95% of > my data point fall into (meaning what is the minimum and maximum 'a' for > which I encompass 95%). When I click the option of show prediction bounds > it appears to show me them correctly but they do not correspond to the 95% > confidence of my coefficient given by the fit. How can I find out the > coefficients that were used in drawing the prediction bounds? > > I'm attaching a link to a print screen of my problem in order to clarify > things. > http://img186.imageshack.us/img186/2057/matlabv.jpg Elad, the default output from the PREDINT method, which is what it appears you have drawn on your figure, is a set of "prediction" bounds for new observations. The 95% confidence bounds for the coefficients are just that. In the simple model that you have, these correspond to 95% "prediction" bounds for the function. Try this for a cfit object in the variable f and some value x: A = predint(f,x,.95,'function') % bounds for function B = predint(f,x,.95,'observation') % bounds for new observation We would have 95% confidence that the true but unknown function evaluated at x lies between the limits in A. We would have 95% confidence, loosely speaking, that a new observation taken at the value x would lie between the limits in B. I hope that answers your question. If you are looking for more details on these calculations, you can edit predint.m or ask a follow-up question. -- Tom
From: Elad Steinberg on 5 Apr 2010 16:48
"Tom Lane" <tlane(a)mathworks.com> wrote in message <hpdfnl$ig8$1(a)fred.mathworks.com>... > > I'm fitting a very basic function 'x+a' to my data set which has some > > scatter to it. I'm interested in knowing for what range of 'a' does 95% of > > my data point fall into (meaning what is the minimum and maximum 'a' for > > which I encompass 95%). When I click the option of show prediction bounds > > it appears to show me them correctly but they do not correspond to the 95% > > confidence of my coefficient given by the fit. How can I find out the > > coefficients that were used in drawing the prediction bounds? > > > > I'm attaching a link to a print screen of my problem in order to clarify > > things. > > http://img186.imageshack.us/img186/2057/matlabv.jpg > > Elad, the default output from the PREDINT method, which is what it appears > you have drawn on your figure, is a set of "prediction" bounds for new > observations. The 95% confidence bounds for the coefficients are just that. > In the simple model that you have, these correspond to 95% "prediction" > bounds for the function. Try this for a cfit object in the variable f and > some value x: > > A = predint(f,x,.95,'function') % bounds for function > B = predint(f,x,.95,'observation') % bounds for new observation > > We would have 95% confidence that the true but unknown function evaluated at > x lies between the limits in A. We would have 95% confidence, loosely > speaking, that a new observation taken at the value x would lie between the > limits in B. > > I hope that answers your question. If you are looking for more details on > these calculations, you can edit predint.m or ask a follow-up question. > > -- Tom > That is exactly what I needed, Thank you very much Tom! |