Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How calculate STANDARDIZED RESIDUALs

Subject: How calculate STANDARDIZED RESIDUALs

From: Maty

Date: 19 Jul, 2013 07:58:18

Message: 1 of 8

Hi all,
I need to calculate the standardized residuals starting from the residuals matrix A

I know the definition of res.st

Standardized Residuals. Standardized residuals are raw residuals divided by their estimated standard deviation. The standardized residual for observation i is
st(i)=r(i)/[sqrt(MSE(1-h(ii))]
where MSE is the mean squared error and h(ii) is the leverage value for observation i.

but I need the syntax

Thanks in advance for your consideration and any help
Maty

Subject: How calculate STANDARDIZED RESIDUALs

From: Torsten

Date: 19 Jul, 2013 08:12:07

Message: 2 of 8

"Maty " <matlab870@gmail.com> wrote in message <ksariq$lhj$1@newscl01ah.mathworks.com>...
> Hi all,
> I need to calculate the standardized residuals starting from the residuals matrix A
>
> I know the definition of res.st
>
> Standardized Residuals. Standardized residuals are raw residuals divided by their estimated standard deviation. The standardized residual for observation i is
> st(i)=r(i)/[sqrt(MSE(1-h(ii))]
> where MSE is the mean squared error and h(ii) is the leverage value for observation i.
>
> but I need the syntax
>
> Thanks in advance for your consideration and any help
> Maty

Here is the MATLAB code:

MSE = (r'*r)/(n-p);
st = r./(sqrt(MSE*(1-h)));

where
r is the n by 1 vector of residuals
n is the number of observations
p is the number of unknown parameters
MSE is the mean squared error
h is the n by 1 leverage vector
st is the n by 1 vector of standardized residuals.

Best wishes
Torsten.

Subject: How calculate STANDARDIZED RESIDUALs

From: Maty

Date: 19 Jul, 2013 09:00:11

Message: 3 of 8

> Here is the MATLAB code:
>
> MSE = (r'*r)/(n-p);
> st = r./(sqrt(MSE*(1-h)));
>
> where
> r is the n by 1 vector of residuals
> n is the number of observations
> p is the number of unknown parameters
> MSE is the mean squared error
> h is the n by 1 leverage vector
> st is the n by 1 vector of standardized residuals.

Thanks for your help but I'm at the beginning.
Can you kindly explain me how find/determine 'p' and 'h'?

Subject: How calculate STANDARDIZED RESIDUALs

From: Maty

Date: 19 Jul, 2013 09:17:10

Message: 4 of 8

is it wrong to use the simpler definition that follow?

sr(i) = (r(i)-mean)/sd
sr(i) is the i'th standardized residual. mean is the mean of residuals . sd is the standard deviation of the residuals.

Subject: How calculate STANDARDIZED RESIDUALs

From: Torsten

Date: 19 Jul, 2013 10:12:09

Message: 5 of 8

"Maty " <matlab870@gmail.com> wrote in message <ksb06l$1qk$1@newscl01ah.mathworks.com>...
> is it wrong to use the simpler definition that follow?
>
> sr(i) = (r(i)-mean)/sd
> sr(i) is the i'th standardized residual. mean is the mean of residuals . sd is the standard deviation of the residuals.

The residuals are the deviations of the observations from the sample mean - thus the mean of the residuals is zero.
Thus your formula from above is for the special case that p=1 and h=0.

Best wishes
Torsten.

Subject: How calculate STANDARDIZED RESIDUALs

From: Maty

Date: 19 Jul, 2013 13:37:10

Message: 6 of 8

Can you/someone kindly explain me how find/determine 'p' and 'h'?

Thanks

Subject: How calculate STANDARDIZED RESIDUALs

From: Maty

Date: 19 Jul, 2013 13:44:10

Message: 7 of 8

Can you/someone kindly explain me how find/determine 'p' and 'h'?

In my case I have a data matrix of 200x5 (five residuals series obtained from 5 financial time series)

Subject: How calculate STANDARDIZED RESIDUALs

From: Tom Lane

Date: 22 Jul, 2013 19:14:41

Message: 8 of 8

If you have the Statistics Toolbox, consider using either regstats or
LinearModel.fit to do what you want. You should be able to get what you need
from them.

-- Tom

"Maty " <matlab870@gmail.com> wrote in message
news:ksbfra$8d6$1@newscl01ah.mathworks.com...
> Can you/someone kindly explain me how find/determine 'p' and 'h'?
>
> In my case I have a data matrix of 200x5 (five residuals series obtained
> from 5 financial time series)

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us