-1

I've got an econometrics problem in which I have to compute in Matlab an AR(15) time series. After asking me to compute BIC and AIC values, the professor requests also the adjusted R squared statistics, but in this case I have no clue on how to compute it.

I've already implemented the AR model through the command 'arima('ARlags', 1:15)' and using the command 'estimate' I obtained the values of the constant, the 15 AR coefficients and the variance. I know how to compute the adjusted R squared: I have to calculate the sum of squares of residuals and total sum of squares and divide each by the degrees of freedom. However in this case I do not have, like in any statistics problem, the estimated values of my response, so I do not know how to calculate the residual sum of squares and then the adjusted R squared. Thanks in advance for any help

parcorr(zero_rate) AR1=arima('ARlags', 1:15); [est_AR1,EstParamCov1,logL1]=estimate(AR1,zero_rate); [AIC1, BIC1]=aicbic(logL1,17,35);

mb7
  • 3
  • 3
  • 1
    Please provide a minimal example of your code showing what you have tried. – Juan Carlos Ramirez Jun 07 '19 at 15:42
  • I have a curve about the zero rates in Belgium with different time maturities. I moved on like this: I checked the order p using the autocorrelogram (the last lag out of the CI region is 15), and then I used arima and estimate to create my AR(15) model `parcorr(zero_rate); AR1=arima('ARlags', 1:15); [est_AR1,EstParamCov1,logL1]=estimate(AR1,zero_rate); [AIC1, BIC1]=aicbic(logL1,17,35);` – mb7 Jun 07 '19 at 16:07

1 Answers1

0

Assuming you are using the arima class , you can use the infer method to get the residuals and then do a dot product to get the sum of squares

E = infer(Mdl,Y)
Ssquares = dot(E,E) 

To get the total sum of squares, you can do

Stotal = dot(Y-mean(Y),Y-mean(Y))

Then the R squared is just

Rsq = 1- Ssquares/Stotal

The adjusted R squared

Rsqadj - 1- (1-Rsq)*(n-1)/(n-p-1) (which is = 1-Ssquares/Stotal*(n-1)/(n-p-1))

Where n is your population size, and p is the number of non-intercept coefficients (in your case, i think this is 15).

Juan Carlos Ramirez
  • 2,054
  • 1
  • 7
  • 22