http://www.mathworks.com/matlabcentral/newsreader/view_thread/284538
MATLAB Central Newsreader  Covariance matrix from a single regression
Feed for thread: Covariance matrix from a single regression
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Mon, 14 Jun 2010 04:00:25 +0000
Covariance matrix from a single regression
http://www.mathworks.com/matlabcentral/newsreader/view_thread/284538#754142
Firat
Hi all,<br>
I am trying to fit a linear model to a set of data. F=G*K is my equation, where I know G and F data and try to estimate K. I have 240x1 F matrix, a G matrix of size 240x4 and K matrix should be 4x1. I can fit a linear model to that data and get the K matrix. My question is: Is there a way to get the covariance matrix of that single model ? <br>
<br>
<br>
<br>
I hope it is clear,<br>
Thank you,<br>
Firat

Mon, 14 Jun 2010 04:47:03 +0000
Re: Covariance matrix from a single regression
http://www.mathworks.com/matlabcentral/newsreader/view_thread/284538#754148
Firat
Actually I should have said multiple regression;<br>
F= K1*G1 + K2 *G2 +K3*G3 + K4*G4 <br>
<br>
I am trying to get the statistics of the K terms basically.<br>
<br>
Thanks,<br>
Firat<br>
<br>
"Firat " <firateren85@gmail.com> wrote in message <hv49go$sm$1@fred.mathworks.com>...<br>
> Hi all,<br>
> I am trying to fit a linear model to a set of data. F=G*K is my equation, where I know G and F data and try to estimate K. I have 240x1 F matrix, a G matrix of size 240x4 and K matrix should be 4x1. I can fit a linear model to that data and get the K matrix. My question is: Is there a way to get the covariance matrix of that single model ? <br>
> <br>
> <br>
> <br>
> I hope it is clear,<br>
> Thank you,<br>
> Firat

Mon, 14 Jun 2010 08:34:03 +0000
Re: Covariance matrix from a single regression
http://www.mathworks.com/matlabcentral/newsreader/view_thread/284538#754171
Roger Stafford
"Firat " <firateren85@gmail.com> wrote in message <hv49go$sm$1@fred.mathworks.com>...<br>
> Hi all,<br>
> I am trying to fit a linear model to a set of data. F=G*K is my equation, where I know G and F data and try to estimate K. I have 240x1 F matrix, a G matrix of size 240x4 and K matrix should be 4x1. I can fit a linear model to that data and get the K matrix. My question is: Is there a way to get the covariance matrix of that single model ? <br>
> Actually I should have said multiple regression;<br>
> F= K1*G1 + K2 *G2 +K3*G3 + K4*G4 <br>
> I am trying to get the statistics of the K terms basically.<br>
> .......<br>
<br>
With multiple regression the precise result you would get for K is:<br>
<br>
K = G\F;<br>
<br>
using the matlab backslash operator. However, you are asking about the statistical properties of such a result, with the apparent implication that you would like to obtain at least an estimate of these properties from the data present in F and G themselves. This is a far more difficult task.<br>
<br>
This is analogous to the simpler estimate of the variance of a single random variable based on n observations of it. In this case the estimate that is commonly used is to subtract the mean of the observed values from each value, add the squares of these differences, and then divide by n1 rather than n to make it "unbiased".<br>
<br>
I confess I do not know what a reasonable estimate would be for the statistical properties of G\F, but it would certainly involve such things as the observed four dimensional distribution of the rows of G, as well as correlations of F values with these rows.<br>
<br>
I would also guess further that far more than 240 samples would be needed to arrive at a reliable estimate of these properties, simply because it requires a great many points to thoroughly explore all the variations inherent in a fourdimensional situation. For example if a hundred samples are considered as necessary to get a good estimate of a single variable's distribution, then about a hundred to the fourth power, or a hundred million, would be necessary to thoroughly explore the corresponding four dimensions.<br>
<br>
All this is by way of saying that in my opinion you have tackled a real "bear" with the question you have asked here. Of course an easy way out is to repeat the set of 240 observations many times independently and calculate the variances and covariances of the different quadruples of G\F that are produced. However, that seems a little frustrating, since it says, "if I had made only 240 observations, these would be the uncertainties in my answer." But with a lot more than 240 actually available, why not make a more reliable estimate with G and F that much larger?<br>
<br>
Roger Stafford

Mon, 14 Jun 2010 08:48:24 +0000
Re: Covariance matrix from a single regression
http://www.mathworks.com/matlabcentral/newsreader/view_thread/284538#754173
TideMan
On Jun 14, 8:34 pm, "Roger Stafford"<br>
<ellieandrogerxy...@mindspring.com.invalid> wrote:<br>
> "Firat " <firatere...@gmail.com> wrote in message <hv49go$s...@fred.mathworks.com>...<br>
> > Hi all,<br>
> > I am trying to fit a linear model to a set of data. F=G*K is my equation, where I know G and F data and try to estimate K. I have 240x1 F matrix, a G matrix of size 240x4 and K matrix should be 4x1. I can fit a linear model to that data and get the K matrix. My question is: Is there a way to get the covariance matrix of that single model ?<br>
> > Actually I should have said multiple regression;<br>
> > F= K1*G1 + K2 *G2 +K3*G3 + K4*G4<br>
> > I am trying to get the statistics of the K terms basically.<br>
> > .......<br>
><br>
> With multiple regression the precise result you would get for K is:<br>
><br>
> K = G\F;<br>
><br>
> using the matlab backslash operator. However, you are asking about the statistical properties of such a result, with the apparent implication that you would like to obtain at least an estimate of these properties from the data present in F and G themselves. This is a far more difficult task.<br>
><br>
> This is analogous to the simpler estimate of the variance of a single random variable based on n observations of it. In this case the estimate that is commonly used is to subtract the mean of the observed values from each value, add the squares of these differences, and then divide by n1 rather than n to make it "unbiased".<br>
><br>
> I confess I do not know what a reasonable estimate would be for the statistical properties of G\F, but it would certainly involve such things as the observed four dimensional distribution of the rows of G, as well as correlations of F values with these rows.<br>
><br>
> I would also guess further that far more than 240 samples would be needed to arrive at a reliable estimate of these properties, simply because it requires a great many points to thoroughly explore all the variations inherent in a fourdimensional situation. For example if a hundred samples are considered as necessary to get a good estimate of a single variable's distribution, then about a hundred to the fourth power, or a hundred million, would be necessary to thoroughly explore the corresponding four dimensions.<br>
><br>
> All this is by way of saying that in my opinion you have tackled a real "bear" with the question you have asked here. Of course an easy way out is to repeat the set of 240 observations many times independently and calculate the variances and covariances of the different quadruples of G\F that are produced. However, that seems a little frustrating, since it says, "if I had made only 240 observations, these would be the uncertainties in my answer." But with a lot more than 240 actually available, why not make a more reliable estimate with G and F that much larger?<br>
><br>
> Roger Stafford<br>
<br>
Even easier than this would be to look up a very basic textbook on<br>
engineering statistics and obtain the algorithm from that.

Mon, 14 Jun 2010 13:41:41 +0000
Re: Covariance matrix from a single regression
http://www.mathworks.com/matlabcentral/newsreader/view_thread/284538#754232
Peter Perkins
On 6/14/2010 12:00 AM, Firat wrote:<br>
> Hi all,<br>
> I am trying to fit a linear model to a set of data. F=G*K is my<br>
> equation, where I know G and F data and try to estimate K. I have 240x1<br>
> F matrix, a G matrix of size 240x4 and K matrix should be 4x1. I can fit<br>
> a linear model to that data and get the K matrix. My question is: Is<br>
> there a way to get the covariance matrix of that single model ?<br>
<br>
Assuming you are willing to make all the usual assumptions of multiple <br>
linear regression, I believe that LSCOV is what you are looking for.

Mon, 14 Jun 2010 14:23:04 +0000
Re: Covariance matrix from a single regression
http://www.mathworks.com/matlabcentral/newsreader/view_thread/284538#754252
Firat
Thank you very much Peter, that was exactly what I was looking for. <br>
<br>
Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <hv5bil$qvr$1@fred.mathworks.com>...<br>
> On 6/14/2010 12:00 AM, Firat wrote:<br>
> > Hi all,<br>
> > I am trying to fit a linear model to a set of data. F=G*K is my<br>
> > equation, where I know G and F data and try to estimate K. I have 240x1<br>
> > F matrix, a G matrix of size 240x4 and K matrix should be 4x1. I can fit<br>
> > a linear model to that data and get the K matrix. My question is: Is<br>
> > there a way to get the covariance matrix of that single model ?<br>
> <br>
> Assuming you are willing to make all the usual assumptions of multiple <br>
> linear regression, I believe that LSCOV is what you are looking for.