Vous êtes sur la page 1sur 37

Ejercicios computacionales TEST DE JOHANSEN

1. Comente el gráfico de las series y determine que componentes


determinísticos se deberían usar para los tests de raíz unitaria y
cointegración.

Podemos observar que el consumo presenta tendencia lineal y también el PIB.


Ahora las variables del consumo y del PIB en primeras diferencias.
Para raíz unitaria se debería usar intercepto y tendencia, y para dos raíces unitarias
solo constante, como observamos en los graficos.

2. Determine si las variables son estacionarias en tendencia o no para ver si


podría existir cointegración.

Prueba de raíz unitaria

Null Hypothesis: CONS has a unit root


Exogenous: Constant, Linear Trend
Lag Length: 3 (Automatic - based on SIC, maxlag=11)

t-Statistic Prob.*

Augmented Dickey-Fuller test statistic -2.425572 0.3640


Test critical values: 1% level -4.071006
5% level -3.464198
10% level -3.158586
*MacKinnon (1996) one-sided p-values.

Augmented Dickey-Fuller Test Equation


Dependent Variable: D(CONS)
Method: Least Squares
Sample (adjusted): 1971Q1 1991Q4
Included observations: 84 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

CONS(-1) -0.078656 0.032428 -2.425572 0.0176


D(CONS(-1)) 0.135689 0.106328 1.276139 0.2057
D(CONS(-2)) 0.163154 0.107043 1.524191 0.1315
D(CONS(-3)) 0.285583 0.108291 2.637181 0.0101
C 144.8592 55.51149 2.609536 0.0109
@TREND("1970Q1") 1.390453 0.591990 2.348779 0.0214

R-squared 0.171501 Mean dependent var 17.26071


Adjusted R-squared 0.118392 S.D. dependent var 18.44710
S.E. of regression 17.32072 Akaike info criterion 8.610433
Sum squared resid 23400.56 Schwarz criterion 8.784063
Log likelihood -355.6382 Hannan-Quinn criter. 8.680231
F-statistic 3.229239 Durbin-Watson stat 2.014887
Prob(F-statistic) 0.010575

Null Hypothesis: PIB has a unit root


Exogenous: Constant, Linear Trend
Lag Length: 1 (Automatic - based on SIC, maxlag=11)

t-Statistic Prob.*

Augmented Dickey-Fuller test statistic -2.215287 0.4749


Test critical values: 1% level -4.068290
5% level -3.462912
10% level -3.157836

*MacKinnon (1996) one-sided p-values.

Augmented Dickey-Fuller Test Equation


Dependent Variable: D(PIB)
Method: Least Squares
Sample (adjusted): 1970Q3 1991Q4
Included observations: 86 after adjustments
Variable Coefficient Std. Error t-Statistic Prob.

PIB(-1) -0.078661 0.035508 -2.215287 0.0295


D(PIB(-1)) 0.355794 0.102691 3.464708 0.0008
C 234.9729 98.58764 2.383391 0.0195
@TREND("1970Q1") 1.892199 0.879168 2.152260 0.0343

R-squared 0.152615 Mean dependent var 23.34535


Adjusted R-squared 0.121613 S.D. dependent var 35.93794
S.E. of regression 33.68187 Akaike info criterion 9.917191
Sum squared resid 93026.38 Schwarz criterion 10.03135
Log likelihood -422.4392 Hannan-Quinn criter. 9.963134
F-statistic 4.922762 Durbin-Watson stat 2.085875
Prob(F-statistic) 0.003406

Podemos observar que al 5% de nivel de significancia no rechazamos la hipótesis


nula de que existe una raíz unitaria tanto para el consumo como para el PIB.
Como son integradas de orden uno, puede que haya cointegración.
Test de raíz unitaria PP y KPSS

Null Hypothesis: CONS has a unit root


Exogenous: Constant, Linear Trend
Bandwidth: 5 (Newey-West automatic) using Bartlett kernel

Adj. t-Stat Prob.*

Phillips-Perron test statistic -1.935905 0.6272


Test critical values: 1% level -4.066981
5% level -3.462292
10% level -3.157475

*MacKinnon (1996) one-sided p-values.

Residual variance (no correction) 323.3940


HAC corrected variance (Bartlett kernel) 637.7429

Phillips-Perron Test Equation


Dependent Variable: D(CONS)
Method: Least Squares
Sample (adjusted): 1970Q2 1991Q4
Included observations: 87 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.


CONS(-1) -0.044464 0.032312 -1.376068 0.1725
C 94.19111 56.24138 1.674765 0.0977
@TREND("1970Q1") 0.798720 0.587106 1.360435 0.1773

R-squared 0.022053 Mean dependent var 16.90345


Adjusted R-squared -0.001232 S.D. dependent var 18.29021
S.E. of regression 18.30147 Akaike info criterion 8.685714
Sum squared resid 28135.27 Schwarz criterion 8.770745
Log likelihood -374.8286 Hannan-Quinn criter. 8.719953
F-statistic 0.947106 Durbin-Watson stat 1.595415
Prob(F-statistic) 0.391964

Null Hypothesis: PIB has a unit root


Exogenous: Constant, Linear Trend
Bandwidth: 4 (Newey-West automatic) using Bartlett kernel

Adj. t-Stat Prob.*

Phillips-Perron test statistic -2.197109 0.4849


Test critical values: 1% level -4.066981
5% level -3.462292
10% level -3.157475

*MacKinnon (1996) one-sided p-values.

Residual variance (no correction) 1237.491


HAC corrected variance (Bartlett kernel) 2312.771

Phillips-Perron Test Equation


Dependent Variable: D(PIB)
Method: Least Squares
Sample (adjusted): 1970Q2 1991Q4
Included observations: 87 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

PIB(-1) -0.060317 0.037111 -1.625296 0.1078


C 190.3837 103.5257 1.838999 0.0694
@TREND("1970Q1") 1.477641 0.917244 1.610958 0.1109

R-squared 0.030517 Mean dependent var 22.93333


Adjusted R-squared 0.007434 S.D. dependent var 35.93448
S.E. of regression 35.80066 Akaike info criterion 10.02768
Sum squared resid 107661.7 Schwarz criterion 10.11272
Log likelihood -433.2042 Hannan-Quinn criter. 10.06192
F-statistic 1.322060 Durbin-Watson stat 1.314680
Prob(F-statistic) 0.272075

test de raíz unitaria KPSS

Null Hypothesis: CONS is stationary


Exogenous: Constant, Linear Trend
Bandwidth: 7 (Newey-West automatic) using Bartlett kernel

LM-Stat.

Kwiatkowski-Phillips-Schmidt-Shin test statistic 0.157053


Asymptotic critical values*: 1% level 0.216000
5% level 0.146000
10% level 0.119000

*Kwiatkowski-Phillips-Schmidt-Shin (1992, Table 1)

Residual variance (no correction) 3672.481


HAC corrected variance (Bartlett kernel) 23838.76

KPSS Test Equation


Dependent Variable: CONS
Method: Least Squares
Sample: 1970Q1 1991Q4
Included observations: 88

Variable Coefficient Std. Error t-Statistic Prob.

C 1755.348 12.95894 135.4545 0.0000


@TREND("1970Q1") 17.96998 0.257257 69.85236 0.0000

R-squared 0.982680 Mean dependent var 2537.042


Adjusted R-squared 0.982479 S.D. dependent var 463.1134
S.E. of regression 61.30161 Akaike info criterion 11.09195
Sum squared resid 323178.4 Schwarz criterion 11.14826
Log likelihood -486.0460 Hannan-Quinn criter. 11.11464
F-statistic 4879.352 Durbin-Watson stat 0.089327
Prob(F-statistic) 0.000000
Null Hypothesis: PIB is stationary
Exogenous: Constant, Linear Trend
Bandwidth: 6 (Newey-West automatic) using Bartlett kernel

LM-Stat.

Kwiatkowski-Phillips-Schmidt-Shin test statistic 0.145883


Asymptotic critical values*: 1% level 0.216000
5% level 0.146000
10% level 0.119000

*Kwiatkowski-Phillips-Schmidt-Shin (1992, Table 1)

Residual variance (no correction) 10612.14


HAC corrected variance (Bartlett kernel) 58386.78

KPSS Test Equation


Dependent Variable: PIB
Method: Least Squares
Sample: 1970Q1 1991Q4
Included observations: 88

Variable Coefficient Std. Error t-Statistic Prob.

C 2807.436 22.02882 127.4438 0.0000


@TREND("1970Q1") 24.32574 0.437309 55.62599 0.0000

R-squared 0.972958 Mean dependent var 3865.606


Adjusted R-squared 0.972644 S.D. dependent var 630.0349
S.E. of regression 104.2062 Akaike info criterion 12.15309
Sum squared resid 933868.1 Schwarz criterion 12.20939
Log likelihood -532.7358 Hannan-Quinn criter. 12.17577
F-statistic 3094.251 Durbin-Watson stat 0.119095
Prob(F-statistic) 0.000000

Tanto para PP como para KPSS existe presencia de una raíz unitaria.

3. Determine el número óptimo de rezagos en un VEC para la especificación


del test de Johansen y evalúe los residuos del mismo (solucione potenciales
problemas).

Vector Error Correction Estimates


Sample (adjusted): 1970Q4 1991Q4
Included observations: 85 after adjustments
Standard errors in ( ) & t-statistics in [ ]

Cointegrating Eq: CointEq1

CONS(-1) 1.000000

PIB(-1) -0.739898
(0.00697)
[-106.220]

C 323.1656

Error Correction: D(CONS) D(PIB)

CointEq1 0.391935 0.587285


(0.07661) (0.13867)
[ 5.11612] [ 4.23518]

D(CONS(-1)) -0.396700 0.100166


(0.16889) (0.30572)
[-2.34882] [ 0.32765]

D(CONS(-2)) -0.254691 -0.002228


(0.15801) (0.28601)
[-1.61188] [-0.00779]

D(PIB(-1)) 0.195139 0.195057


(0.08243) (0.14921)
[ 2.36733] [ 1.30729]

D(PIB(-2)) 0.168376 0.164260


(0.07128) (0.12902)
[ 2.36228] [ 1.27315]

C 19.70286 13.10815
(3.22436) (5.83644)
[ 6.11063] [ 2.24592]

R-squared 0.293452 0.394475


Adj. R-squared 0.248734 0.356151
Sum sq. resids 20257.05 66372.00
S.E. equation 16.01307 28.98537
F-statistic 6.562260 10.29307
Log likelihood -353.2381 -403.6759
Akaike AIC 8.452661 9.639433
Schwarz SC 8.625083 9.811855
Mean dependent 17.01647 23.19294
S.D. dependent 18.47472 36.12326

Determinant resid covariance


(dof adj.) 145097.7
Determinant resid covariance 125336.3
Log likelihood -740.1167
Akaike information criterion 17.74392
Schwarz criterion 18.14624
Number of coefficients 14

Los rezagos optimos para el modelo VEC


VEC Lag Exclusion Wald Tests
Sample: 1970Q1 1991Q4
Included observations: 85

Chi-squared test statistics for lag exclusion:


Numbers in [ ] are p-values

D(CONS) D(PIB) Joint

DLag 1 6.337517 5.728316 15.57628


[ 0.0421] [ 0.0570] [ 0.0036]

DLag 2 5.582386 3.116555 7.719957


[ 0.0613] [ 0.2105] [ 0.1024]

df 2 2 4

Vector Error Correction Estimates


Sample (adjusted): 1970Q3 1991Q4
Included observations: 86 after adjustments
Standard errors in ( ) & t-statistics in [ ]

Cointegrating Eq: CointEq1

CONS(-1) 1.000000

PIB(-1) -0.739489
(0.00797)
[-92.7535]

C 321.4201

Error Correction: D(CONS) D(PIB)


CointEq1 0.318038 0.567995
(0.06710) (0.11985)
[ 4.73981] [ 4.73940]

D(CONS(-1)) -0.277962 0.100467


(0.15482) (0.27651)
[-1.79545] [ 0.36334]

D(PIB(-1)) 0.157038 0.243597


(0.07001) (0.12505)
[ 2.24297] [ 1.94799]

C 18.13848 15.99080
(2.56648) (4.58396)
[ 7.06746] [ 3.48843]

R-squared 0.243387 0.369637


Adj. R-squared 0.215706 0.346575
Sum sq. resids 21692.47 69201.53
S.E. equation 16.26476 29.05032
F-statistic 8.792589 16.02796
Log likelihood -359.8348 -409.7172
Akaike AIC 8.461274 9.621331
Schwarz SC 8.575429 9.735487
Mean dependent 17.01860 23.34535
S.D. dependent 18.36573 35.93794

Determinant resid covariance


(dof adj.) 148973.7
Determinant resid covariance 135438.0
Log likelihood -752.1570
Akaike information criterion 17.72458
Schwarz criterion 18.00997
Number of coefficients 10

VEC Lag Exclusion Wald Tests


Sample: 1970Q1 1991Q4
Included observations: 86

Chi-squared test statistics for lag exclusion:


Numbers in [ ] are p-values
D(CONS) D(PIB) Joint

DLag 1 5.107944 10.06593 16.38767


[ 0.0778] [ 0.0065] [ 0.0025]

Df 2 2 4

Viendo los criterios de información AKAIKE y SCHWARZ los rezagos optimos


parecen ser 1

VEC Residual Serial Correlation LM Tests


Sample: 1970Q1 1991Q4
Included observations: 86

Null hypothesis:
No serial
correlation at lag h

Lag LRE* stat df Prob. Rao F-stat df Prob.

1 6.853031 4 0.1439 1.739705 (4, 158.0) 0.1439


2 4.292882 4 0.3678 1.080998 (4, 158.0) 0.3678
3 3.385498 4 0.4955 0.850069 (4, 158.0) 0.4955
4 1.346834 4 0.8534 0.336012 (4, 158.0) 0.8534
5 2.044701 4 0.7275 0.511240 (4, 158.0) 0.7275
6 1.179405 4 0.8815 0.294086 (4, 158.0) 0.8815
7 5.553470 4 0.2351 1.404012 (4, 158.0) 0.2351
8 9.639420 4 0.0470 2.468778 (4, 158.0) 0.0470
9 1.724990 4 0.7862 0.430868 (4, 158.0) 0.7862
10 0.382257 4 0.9839 0.095078 (4, 158.0) 0.9839
11 3.963262 4 0.4110 0.996958 (4, 158.0) 0.4110
12 12.51213 4 0.0139 3.233935 (4, 158.0) 0.0139

Null hypothesis:
No serial
correlation at lags
1 to h

Lag LRE* stat df Prob. Rao F-stat df Prob.

1 6.853031 4 0.1439 1.739705 (4, 158.0) 0.1439


2 9.521825 8 0.3002 1.203615 (8, 154.0) 0.3003
3 10.98800 12 0.5299 0.918293 (12, 150.0) 0.5304
4 16.66327 16 0.4077 1.049943 (16, 146.0) 0.4087
5 18.21423 20 0.5733 0.910225 (20, 142.0) 0.5749
6 20.07146 24 0.6927 0.829164 (24, 138.0) 0.6949
7 24.93319 28 0.6315 0.884624 (28, 134.0) 0.6352
8 27.69597 32 0.6843 0.855024 (32, 130.0) 0.6893
9 31.18787 36 0.6967 0.852977 (36, 126.0) 0.7035
10 33.15524 40 0.7698 0.808526 (40, 122.0) 0.7774
11 38.80422 44 0.6934 0.863621 (44, 118.0) 0.7055
12 53.95250 48 0.2574 1.146233 (48, 114.0) 0.2752

*Edgeworth expansion corrected likelihood ratio statistic.

No se rechaza la hipótesis nula de ausencia de auto correlación.

VEC Residual Heteroskedasticity Tests (Levels and Squares)


Sample: 1970Q1 1991Q4
Included observations: 86

Joint test:

Chi-sq df Prob.

13.40534 18 0.7670

Individual components:

Dependent R-squared F(6,79) Prob. Chi-sq(6) Prob.

res1*res1 0.043978 0.605687 0.7250 3.782147 0.7061


res2*res2 0.078016 1.114126 0.3617 6.709348 0.3486
res2*res1 0.064003 0.900329 0.4991 5.504252 0.4809

No se rechaza la hipótesis nula de homoscedasticidad.

VEC Residual Normality Tests


Orthogonalization: Cholesky (Lutkepohl)
Null Hypothesis: Residuals are multivariate normal
Sample: 1970Q1 1991Q4
Included observations: 86

Component Skewness Chi-sq df Prob.*

1 -0.674590 6.522702 1 0.0107


2 -0.157038 0.353475 1 0.5522

Joint 6.876177 2 0.0321


Component Kurtosis Chi-sq df Prob.

1 3.943019 3.186605 1 0.0742


2 2.975497 0.002151 1 0.9630

Joint 3.188757 2 0.2030

Component Jarque-Bera df Prob.

1 9.709307 2 0.0078
2 0.355627 2 0.8371

Joint 10.06493 4 0.0393

*Approximate p-values do not account for coefficient


estimation

Rechazamos la hipótesis nula de normalidad, entonces los residuos no se


distribuyen como la normal.
Para solucionar el problema aplicamos dummies estacionales, utilizamos
@during(“1980q2 1980q2”), como se observa en el gráfico de los residuos parece
que se presenta un problema estacional en las series.
Vector Error Correction Estimates
Sample (adjusted): 1970Q3 1991Q4
Included observations: 86 after adjustments
Standard errors in ( ) & t-statistics in [ ]

Cointegrating Eq: CointEq1

CONS(-1) 1.000000

PIB(-1) -0.740325
(0.00793)
[-93.2993]

C 324.6493

Error Correction: D(CONS) D(PIB)

CointEq1 0.290668 0.523064


(0.06235) (0.11314)
[ 4.66190] [ 4.62310]
D(CONS(-1)) -0.301946 0.062200
(0.14342) (0.26026)
[-2.10525] [ 0.23899]

D(PIB(-1)) 0.163580 0.254065


(0.06485) (0.11769)
[ 2.52229] [ 2.15884]

C 19.08065 17.51121
(2.38869) (4.33457)
[ 7.98793] [ 4.03990]

@DURING("1980q2 1980q2") -58.77302 -95.30527


(15.3671) (27.8855)
[-3.82461] [-3.41774]

R-squared 0.359184 0.448917


Adj. R-squared 0.327539 0.421703
Sum sq. Resids 18372.51 60498.18
S.E. equation 15.06058 27.32931
F-statistic 11.35036 16.49583
Log likelihood -352.6920 -403.9376
Akaike AIC 8.318420 9.510177
Schwarz SC 8.461114 9.652872
Mean dependent 17.01860 23.34535
S.D. dependent 18.36573 35.93794

Determinant resid covariance (dof adj.) 125506.0


Determinant resid covariance 111336.5
Log likelihood -743.7309
Akaike information criterion 17.57514
Schwarz criterion 17.91760
Number of coefficients 12

Test de Normalidad.

VEC Residual Normality Tests


Orthogonalization: Cholesky (Lutkepohl)
Null Hypothesis: Residuals are multivariate normal
Sample: 1970Q1 1991Q4
Included observations: 86

Component Skewness Chi-sq df Prob.*

1 -0.334488 1.603644 1 0.2054


2 -0.176712 0.447587 1 0.5035
Joint 2.051230 2 0.3586

Component Kurtosis Chi-sq df Prob.

1 2.917146 0.024599 1 0.8754


2 3.220097 0.173586 1 0.6769

Joint 0.198184 2 0.9057

Component Jarque-Bera df Prob.

1 1.628242 2 0.4430
2 0.621172 2 0.7330

Joint 2.249415 4 0.6900

*Approximate p-values do not account for coefficient


estimation

Como se observa en el test de normalidad Jarque Bera, ahora si los residuos tienen
distribución normal.
Por lo tanto tenemos un VEC bien especificado.

4. Realice el test de cointegración de Johansen con el número de rezagos


elegido y, si existe cointegración, escriba a mano la relación de largo plazo
resultante (tome al consumo como variable dependiente).

Unrestricted Cointegration Rank Test (Trace)

Hypothesized Trace 0.05


No. of CE(s) Eigenvalue Statistic Critical Value Prob.**

None * 0.260718 26.02222 15.49471 0.0009


At most 1 0.000508 0.043718 3.841466 0.8343

Trace test indicates 1 cointegrating eqn(s) at the 0.05 level


* denotes rejection of the hypothesis at the 0.05 level
**MacKinnon-Haug-Michelis (1999) p-values

Unrestricted Cointegration Rank Test (Maximum Eigenvalue)

Hypothesized Max-Eigen 0.05


No. of CE(s) Eigenvalue Statistic Critical Value Prob.**

None * 0.260718 25.97850 14.26460 0.0005


At most 1 0.000508 0.043718 3.841466 0.8343

Max-eigenvalue test indicates 1 cointegrating eqn(s) at the 0.05


level
* denotes rejection of the hypothesis at the 0.05 level
**MacKinnon-Haug-Michelis (1999) p-values

Unrestricted Cointegrating Coefficients (normalized by


b'*S11*b=I):

CONS PIB
-0.038392 0.028423
0.005871 -0.002699

Unrestricted Adjustment Coefficients (alpha):

D(CONS) -7.571043 -0.161148


D(PIB) -13.62425 0.300035

1 CointegratingLog
Equation(s): likelihood -743.7309

Normalized cointegrating coefficients (standard error in


parentheses)
CONS PIB
1.000000 -0.740325
(0.00793)

Adjustment coefficients (standard error in parentheses)


D(CONS) 0.290668
(0.06235)
D(PIB) 0.523064
(0.11314)

No rechazamos la hipótesis nula de que haya un vector de cointegración.


Relación de largo plazo.
5. Evalué la significancia del coeficiente del PIB en la relación de largo plazo.

Vector Error Correction Estimates


Sample (adjusted): 1970Q3 1991Q4
Included observations: 86 after adjustments
Standard errors in ( ) & t-statistics in [ ]

Cointegration Restrictions:
B(1, 2)=0
Convergence achieved after 1 iterations.
Not all cointegrating vectors are identified
LR test for binding restrictions (rank = 1):
Chi-square(1) 25.73440
Probability 0.000000

Cointegrating Eq: CointEq1

CONS(-1) 0.000209

PIB(-1) 0.000000

C -0.531311

Error Correction: D(CONS) D(PIB)

CointEq1 -9.267784 -10.46517


(19.3165) (35.0212)
[-0.47978] [-0.29882]

D(CONS(-1)) 0.056888 0.707883


(0.13611) (0.24677)
[ 0.41795] [ 2.86860]
D(PIB(-1)) 0.062590 0.071541
(0.06869) (0.12453)
[ 0.91122] [ 0.57448]

C 15.37525 10.86127
(2.53613) (4.59804)
[ 6.06249] [ 2.36215]

@DURING("1980q2 1980q2") -66.88436 -109.8128


(17.1765) (31.1412)
[-3.89395] [-3.52628]

R-squared 0.189549 0.304273


Adj. R-squared 0.149526 0.269916
Sum sq. resids 23236.05 76377.33
S.E. equation 16.93709 30.70716
F-statistic 4.736077 8.856226
Log likelihood -362.7906 -413.9598
Akaike AIC 8.553269 9.743250
Schwarz SC 8.695964 9.885945
Mean dependent 17.01860 23.34535
S.D. dependent 18.36573 35.93794

Determinant resid covariance (dof adj.) 169286.2


Determinant resid covariance 150174.0
Log likelihood -756.5981
Akaike information criterion 17.87437
Schwarz criterion 18.21684
Number of coefficients 12

Rechazamos la hipótesis nula de que el coeficiente del PIB en la relación de largo


plazo es cero.
6. Comente potenciales problemas (econométricos) derivados de estimar una
función de consumo de esta forma y cómo usted mejoraría la estimación.
Ejercicios Computacionales ARCH

10. ¿Cuál es el mejor modelo ARIMA para la serie?

Null Hypothesis: LBIT has a unit root


Trend Specification: Trend and intercept
Break Specification: Trend and intercept
Break Type: Innovational outlier

Break Date: 8/03/2016


Break Selection: Minimize Dickey-Fuller t-statistic
Lag Length: 0 (Automatic - based on Schwarz information criterion,
maxlag=22)

t-Statistic Prob.*

Augmented Dickey-Fuller test statistic -2.156388 > 0.99


Test critical values: 1% level -5.719131
5% level -5.175710
10% level -4.893950

*Vogelsang (1993) asymptotic one-sided p-values.

Augmented Dickey-Fuller Test Equation


Dependent Variable: LBIT
Method: Least Squares
Sample (adjusted): 4/16/2014 11/03/2017
Included observations: 1280 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

LBIT(-1) 0.992772 0.003352 296.1618 0.0000


C 0.040373 0.019878 2.031015 0.0425
TREND 5.51E-06 5.23E-06 1.054214 0.2920
INCPTBREAK -0.000378 0.004199 -0.089913 0.9284
TRENDBREAK 5.40E-05 2.28E-05 2.362403 0.0183
BREAKDUM 0.158761 0.035897 4.422641 0.0000

R-squared 0.998184 Mean dependent var 6.390606


Adjusted R-squared 0.998177 S.D. dependent var 0.837047
S.E. of regression 0.035736 Akaike info criterion -3.820648
Sum squared resid 1.626964 Schwarz criterion -3.796486
Log likelihood 2451.215 Hannan-Quinn criter. -3.811575
F-statistic 140088.4 Durbin-Watson stat 2.009986
Prob(F-statistic) 0.000000

Ya tenemos una serie que es estacionaria, porque al diferenciar la serie lbit


podemos ver lo siguiente.
Entonces ya podemos ver el comportamiento del correlograma de DLBIT.
Por lo tanto no hay un modelo ARIMA para esta serie, como vemos en el
correlograma parece ser ruido blanco, por lo que el modelo que tendríamos seria el
siguiente.

Dependent Variable: DLBIT


Method: Least Squares
Sample (adjusted): 4/16/2014 11/03/2017
Included observations: 1280 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

C 0.002086 0.001010 2.064653 0.0392

R-squared 0.000000 Mean dependent var 0.002086


Adjusted R-squared 0.000000 S.D. dependent var 0.036146
S.E. of regression 0.036146 Akaike info criterion -3.801704
Sum squared resid 1.671083 Schwarz criterion -3.797677
Log likelihood 2434.090 Hannan-Quinn criter. -3.800192
Durbin-Watson stat 2.041478

11. ¿Cuál es el resultado del test ARCH en el modelo elegido?, ¿es coherente
desarrollar un modelo ARCH en este caso?

Heteroskedasticity Test: ARCH

F-statistic 23.19515 Prob. F(10,1259) 0.0000


Obs*R-squared 197.5775 Prob. Chi-Square(10) 0.0000

Test Equation:
Dependent Variable: RESID^2
Method: Least Squares
Date: 11/27/17 Time: 10:42
Sample (adjusted): 4/26/2014 11/03/2017
Included observations: 1270 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

C 0.000664 0.000129 5.129861 0.0000


RESID^2(-1) 0.379763 0.028167 13.48232 0.0000
RESID^2(-2) -0.052782 0.030131 -1.751772 0.0801
RESID^2(-3) 0.022639 0.030159 0.750656 0.4530
RESID^2(-4) -0.000160 0.030148 -0.005311 0.9958
RESID^2(-5) 0.107339 0.030152 3.559898 0.0004
RESID^2(-6) 0.005888 0.030169 0.195166 0.8453
RESID^2(-7) 0.038738 0.030174 1.283823 0.1994
RESID^2(-8) -0.024126 0.030187 -0.799222 0.4243
RESID^2(-9) 0.004562 0.030156 0.151293 0.8798
RESID^2(-10) 0.007314 0.028177 0.259578 0.7952

R-squared 0.155573 Mean dependent var 0.001303


Adjusted R-squared 0.148866 S.D. dependent var 0.004183
S.E. of regression 0.003859 Akaike info criterion -8.268083
Sum squared resid 0.018751 Schwarz criterion -8.223505
Log likelihood 5261.233 Hannan-Quinn criter. -8.251338

Rechazamos la hipótesis nula de homoscedasticidad por lo que el modelo tiene


heterocedasticidad.
Y si es coherente hacer un modelo ARCH porque encontramos heterocedasticidad
en el modelo elegido entonces podemos modelar a la varianza condicional.
12. Observando el correlograma de los residuos al cuadrado, escoja al menos
dos modelos que podrían ser adecuados para modelar la varianza
condicional de la serie.

´
Observando el correlograma tenemos que el modelo parece ser un GARCH (1,1),
sin embargo también podríamos decir que parece un modelo GARCH (2,1).
13. Estime los modelos elegidos. ¿Los signos de los coeficientes son
adecuados? ¿Se cumplen las condiciones de estabilidad del modelo?
GARCH (1,1)

Dependent Variable: DLBIT


Method: ML - ARCH
Sample (adjusted): 4/16/2014 11/03/2017
Included observations: 1280 after adjustments
Convergence achieved after 19 iterations
Coefficient covariance computed using outer product of gradients
Presample variance: backcast (parameter = 0.7)
GARCH = C(2) + C(3)*RESID(-1)^2 + C(4)*GARCH(-1)

Variable Coefficient Std. Error z-Statistic Prob.

C 0.002405 0.000724 3.324457 0.0009

Variance Equation

C 6.93E-05 8.78E-06 7.900213 0.0000


RESID(-1)^2 0.258072 0.015410 16.74742 0.0000
GARCH(-1) 0.736027 0.013731 53.60362 0.0000

R-squared -0.000078 Mean dependent var 0.002086


Adjusted R-squared -0.000078 S.D. dependent var 0.036146
S.E. of regression 0.036148 Akaike info criterion -4.073119
Sum squared resid 1.671214 Schwarz criterion -4.057011
Log likelihood 2610.796 Hannan-Quinn criter. -4.067071
Durbin-Watson stat 2.041319

Los coeficientes de este modelo son los adecuados, y también se cumple la


condición de estabilidad, porque si sumamos los coeficientes nos da un valor menor
a uno.
GARCH (2,1)

Dependent Variable: DLBIT


Method: ML ARCH - Normal distribution (BFGS / Marquardt steps)
Sample (adjusted): 4/16/2014 11/03/2017
Included observations: 1280 after adjustments
Convergence achieved after 22 iterations
Coefficient covariance computed using outer product of gradients
Presample variance: backcast (parameter = 0.7)
GARCH = C(2) + C(3)*RESID(-1)^2 + C(4)*RESID(-2)^2 +
C(5)*GARCH(-1)

Variable Coefficient Std. Error z-Statistic Prob.

C 0.002267 0.000709 3.198836 0.0014

Variance Equation

C 4.42E-05 7.35E-06 6.008440 0.0000


RESID(-1)^2 0.346272 0.024746 13.99316 0.0000
RESID(-2)^2 -0.152586 0.029089 -5.245417 0.0000
GARCH(-1) 0.807936 0.016763 48.19784 0.0000

R-squared -0.000025 Mean dependent var 0.002086


Adjusted R-squared -0.000025 S.D. dependent var 0.036146
S.E. of regression 0.036147 Akaike info criterion -4.076154
Sum squared resid 1.671125 Schwarz criterion -4.056018
Log likelihood 2613.738 Hannan-Quinn criter. -4.068593
Durbin-Watson stat 2.041427

Los coeficientes no son todos los deseables, como podemos observar el segundo
rezago de los residuos al cuadrado es negativo, por lo que tampoco se cumple la
condición de estabilidad.
En este caso el modelo mas favorable hasta el momento resulta ser el GARCH (1,1)
que es con el que nos quedamos.

14. Evalué los residuos estandarizados de los modelos elegidos y descarte


aquellos que no tengan propiedades deseables.
GARCH (1,1)
Correlograma de los residuos estandarizados
No se rechaza la hipotesis nula de ausencia de autocorrelacion. Por lo tanto habría
ausencia de autocorrelacion.
Rechazamos la hipotesis nula de que se distribuye según la normal

Heteroskedasticity Test: ARCH

F-statistic 0.278096 Prob. F(10,1259) 0.9860


Obs*R-squared 2.799075 Prob. Chi-Square(10) 0.9858

Test Equation:
Dependent Variable: WGT_RESID^2
Method: Least Squares
Sample (adjusted): 4/26/2014 11/03/2017
Included observations: 1270 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

C 1.087171 0.129203 8.414419 0.0000


WGT_RESID^2(-1) 0.004559 0.028146 0.161979 0.8713
WGT_RESID^2(-2) -0.003462 0.028145 -0.123011 0.9021
WGT_RESID^2(-3) -0.032905 0.028144 -1.169157 0.2426
WGT_RESID^2(-4) -0.024207 0.028155 -0.859767 0.3901
WGT_RESID^2(-5) 0.005069 0.028163 0.179996 0.8572
WGT_RESID^2(-6) 0.001172 0.028178 0.041603 0.9668
WGT_RESID^2(-7) -0.017258 0.028171 -0.612628 0.5402
WGT_RESID^2(-8) -0.001451 0.028160 -0.051537 0.9589
WGT_RESID^2(-9) -0.005068 0.028160 -0.179963 0.8572
WGT_RESID^2(-10) -0.014277 0.028160 -0.506988 0.6123

R-squared 0.002204 Mean dependent var 0.999270


Adjusted R-squared -0.005721 S.D. dependent var 3.203482
S.E. of regression 3.212633 Akaike info criterion 5.180682
Sum squared resid 12994.15 Schwarz criterion 5.225261
Log likelihood -3278.733 Hannan-Quinn criter. 5.197427
F-statistic 0.278096 Durbin-Watson stat 1.999373
Prob(F-statistic) 0.986007

No se rechaza la hipótesis nula de homoscedasticidad.


GARCH (1,2)

Dependent Variable: DLBIT


Method: ML ARCH - Normal distribution (BFGS / Marquardt steps)
Sample (adjusted): 4/16/2014 11/03/2017
Included observations: 1280 after adjustments
Convergence achieved after 26 iterations
Coefficient covariance computed using outer product of gradients
Presample variance: backcast (parameter = 0.7)
GARCH = C(2) + C(3)*RESID(-1)^2 + C(4)*GARCH(-1) + C(5)*GARCH(-
2)

Variable Coefficient Std. Error z-Statistic Prob.

C 0.002325 0.000733 3.173321 0.0015

Variance Equation

C 7.92E-05 1.13E-05 7.033624 0.0000


RESID(-1)^2 0.304816 0.021735 14.02415 0.0000
GARCH(-1) 0.442986 0.078092 5.672609 0.0000
GARCH(-2) 0.245877 0.064102 3.835728 0.0001

R-squared -0.000044 Mean dependent var 0.002086


Adjusted R-squared -0.000044 S.D. dependent var 0.036146
S.E. of regression 0.036147 Akaike info criterion -4.073998
Sum squared resid 1.671156 Schwarz criterion -4.053862
Log likelihood 2612.358 Hannan-Quinn criter. -4.066437
Durbin-Watson stat 2.041389
Correlograma de los residuos al cuadrado

No rechazamos la hipótesis nula de ausencia de auto correlación.


Se rechaza la hipotesis nula de normalidad.

Heteroskedasticity Test: ARCH

F-statistic 0.251323 Prob. F(10,1259) 0.9906


Obs*R-squared 2.530141 Prob. Chi-Square(10) 0.9904

Test Equation:
Dependent Variable: WGT_RESID^2
Method: Least Squares
Sample (adjusted): 4/26/2014 11/03/2017
Included observations: 1270 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

C 1.084969 0.129908 8.351814 0.0000


WGT_RESID^2(-1) -0.003359 0.028153 -0.119314 0.9050
WGT_RESID^2(-2) 0.001741 0.028151 0.061862 0.9507
WGT_RESID^2(-3) -0.031088 0.028150 -1.104348 0.2697
WGT_RESID^2(-4) -0.022724 0.028160 -0.806983 0.4198
WGT_RESID^2(-5) 0.006494 0.028167 0.230541 0.8177
WGT_RESID^2(-6) 0.001512 0.028182 0.053650 0.9572
WGT_RESID^2(-7) -0.016425 0.028175 -0.582952 0.5600
WGT_RESID^2(-8) -0.000108 0.028166 -0.003830 0.9969
WGT_RESID^2(-9) -0.007793 0.028166 -0.276679 0.7821
WGT_RESID^2(-10) -0.013657 0.028167 -0.484856 0.6279

R-squared 0.001992 Mean dependent var 0.999504


Adjusted R-squared -0.005935 S.D. dependent var 3.240236
S.E. of regression 3.249836 Akaike info criterion 5.203710
Sum squared resid 13296.85 Schwarz criterion 5.248288
Log likelihood -3293.356 Hannan-Quinn criter. 5.220455
F-statistic 0.251323 Durbin-Watson stat 1.999486
Prob(F-statistic) 0.990600

No se rechaza la hipótesis nula de que haya ausencia de heterocedasticidad en los


residuos estandarizados

Para descartar un modelo podemos ver los criterios de información.


CRITERIO GARCH (1,1) GARCH (1,2)
Akaike info criterion -4.073119 -4.073998
Schwarz criterion -4.057011 -4.053862
Hannan-Quinn criter. -4.067071 -4.066437

Según el criterio de akaike es mejor el modelo GARCH (1,2), y según los otros dos
criterios resulta mejor el modelo GARCH (1,1). Por lo tanto el modelo ganador seria
el GARCH (1,1).
15. Pronostique la varianza condicional de la variable hasta el 30 de noviembre.
¿Se espera que la volatilidad de la relación dólar/bitcoin caiga?
Lo que podemos observar es que se espera que la volatilidad de la relación del
dólar/bitcon, crezca en el periodo pronosticado.

Ejercicios Computacionales DATOS DE PANEL

Se tiene la producción y precio de huevos de estados de EEUU para 1990 y


1991 (Y1 y Y2 son los huevos producidos en 1990 y 1991 respectivamente, X1
y X2 son los precios de los huevos en 1990 y 1991 respectivamente). Los datos
están disponibles en el link de Google Drive enviado por el grupo de Whatsapp
con el nombre “computacional panel”.

20. Haga un análisis descriptivo de las variables como insumo para el análisis de
regresión.
Variable Obs Mean Std. Dev. Min Max

Y 100 1367.468 1652.381 .7 7472


X 100 77.081 21.67721 45.8 151

El promedio de la producción en los dos años es de 1367.468 y el precio


promedio es de 77.081.
8,000
6,000
4,000
Y
2,000

Podemos observar en el box plot de la producción de huevos que hay más


concentración de las observación por encima de los limites, por lo tanto puede
haber presencia de outliers.

Variable Obs Mean Std. Dev. Min Max

Y 50 1357.082 1661.019 .7 7472


Variable Obs Mean Std. Dev. Min Max

Y 50 1377.854 1660.494 .7 7444

En promedio podemos notar que la producción de huevos se ha incrementado


en un año.
Variable Obs Mean Std. Dev. Min Max

X 50 78.29 21.31747 48 151

Variable Obs Mean Std. Dev. Min Max

X 50 75.872 22.18052 45.8 149


En promedio podemos notar que el precio de huevos ha disminuido en un año.

21. Agrupe las observaciones para los dos años y estime la regresión de
Y en función de X agrupada. ¿Qué suposiciones hace al agrupar los datos?
Source SS df MS Number of obs = 100
F( 1, 98) = 9.72
Model 24385606.2 1 24385606.2 Prob > F = 0.0024
Residual 245920172 98 2509389.51 R-squared = 0.0902
Adj R-squared = 0.0809
Total 270305778 99 2730361.4 Root MSE = 1584.1

Y Coef. Std. Err. t P>|t| [95% Conf. Interval]

X -22.89527 7.344513 -3.12 0.002 -37.47022 -8.320322


_cons 3132.258 587.8677 5.33 0.000 1965.654 4298.863

Suponemos que corremos la regresión sin tomar en cuenta las diferencias que
puedan existir, entre si se incluye o no variables que identifiquen las unidades
de observación o a los periodos de tiempo.

22. En este ejemplo, ¿es correcto agrupar los datos para ambos años en la
regresión?

Si es correcto realizar la estimación agrupada, debido a que no se rechaza la


hipótesis nula de ausencia de heterogeneidad.

23. Utilice el modelo de efectos fijos con la distinción entre los dos años y
presente los resultados de la regresión.
Fixed-effects (within) regression Number of obs = 100
Group variable: YEAR Number of groups = 2

R-sq: within = 0.0903 Obs per group: min = 50


between = 1.0000 avg = 50.0
overall = 0.0902 max = 50

F(1,97) = 9.63
corr(u_i, Xb) = -0.0561 Prob > F = 0.0025

Y Coef. Std. Err. t P>|t| [95% Conf. Interval]

X -22.94036 7.393448 -3.10 0.003 -37.6143 -8.266408


_cons 3135.734 591.7171 5.30 0.000 1961.339 4310.128

sigma_u 24.535036
sigma_e 1592.1527
rho .00023741 (fraction of variance due to u_i)

F test that all u_i=0: F(1, 97) = 0.01 Prob > F = 0.9136

24. ¿Tiene sentido distinguir el efecto por estado y el efecto por año? De ser así,
¿cuántas variables dicotómicas tendría que introducir?

Si tiene sentido porque queremos estimar los efectos fijos a través del tiempo,
es por eso que utilizamos el año en la declaración de datos de panel, entonces
tendríamos que incluir una variable dicótoma.
La modelación por año seria introducir una variable dicotoma
La modelación por estado seria introducir 49 variables dicotomas

25. Estime el modelo de efectos aleatorios para la producción de huevos.


Comente las diferencias con la regresión agrupada y la de efectos fijos.
Random-effects GLS regression Number of obs = 100
Group variable: YEAR Number of groups = 2

R-sq: within = 0.0903 Obs per group: min = 50


between = 1.0000 avg = 50.0
overall = 0.0902 max = 50

Wald chi2(1) = 9.72


corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0018

Y Coef. Std. Err. z P>|z| [95% Conf. Interval]

X -22.89527 7.344513 -3.12 0.002 -37.29025 -8.500288


_cons 3132.258 587.8677 5.33 0.000 1980.059 4284.458

sigma_u 0
sigma_e 1592.1527
rho 0 (fraction of variance due to u_i)

Rechazamos la hipótesis nula de ausencia de heterogeneidad.


26. En la práctica profesional, luego del análisis descriptivo, comenzaríamos
eligiendo uno de los tres modelos. ¿Cuál de los tres modelos elegiría para la
regresión de Y en función de X? ¿Por qué?

Coefficients
(b) (B) (b-B) sqrt(diag(V_b-V_B))
fijos aleatorios Difference S.E.

X -22.94036 -22.89527 -.0450875 .8492383

b = consistent under Ho and Ha; obtained from xtreg


B = inconsistent under Ha, efficient under Ho; obtained from xtreg

Test: Ho: difference in coefficients not systematic

chi2(1) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= 0.00
Prob>chi2 = 0.9577

Debido al valor de probabilidad no rechazamos la hipótesis nula de que no hay una


diferencia significativa entre efectos fijos y efectos aleatorios, por lo tanto se prefiere
el modelo por efectos aleatorios, por la propiedad de eficiencia.
Conclusión: debido al no rechazo de la hipótesis nula de ausencia de
heterogeneidad, en el modelo de efectos fijos, se prefiere el modelo de variables
agrupadas.

Vous aimerez peut-être aussi