Skip to content

Commit

Permalink
Add standard errors tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gragusa committed Feb 17, 2018
1 parent 353f3cd commit 932093c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/ols_hac.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,16 @@ Vt = [0.00417663470962045 -0.00014277423204925 0.000404820124045818
-0.00014277423204925 0.00310914818879932 -0.000418125055191947
0.000404820124045818 -0.000418125055191946 0.00345356514902845]
@test VVt atol=1e-4
@test stderr(lm1,ParzenKernel(Andrews), prewhite = true) sqrt.(diag(Vt)) atol = 0.001

V = vcov(lm1, QuadraticSpectralKernel(Andrews), prewhite = true)
Vt = [0.00422525037811967 -0.000131637826271777 0.000413149700377485
-0.000131637826271777 0.00308879179300843 -0.00042052413768716
0.000413149700377485 -0.000420524137687161 0.00342999158493283]

@test VVt atol=1e-4
@test stderr(lm1, QuadraticSpectralKernel(Andrews), prewhite = true) sqrt.(diag(Vt)) atol = 0.001


@test optimalbw(Andrews, BartlettKernel, lm1) 1.79655260917
@test optimalbw(Andrews, TruncatedKernel, lm1) 0.923095757094
Expand Down Expand Up @@ -181,8 +185,3 @@ Vt = [0.00422525037811967 -0.000131637826271777 0.000413149700377485
# V = vcov(lm1, VARHAC(1,3,3))


## X = CovarianceMatrices.ModelMatrix(lm1.model);
## u = CovarianceMatrices.wrkresidwts(lm1.model.rr);
## z = X.*u;

## vcov(lm1, TruncatedKernel(1.0), prewhite = false)

0 comments on commit 932093c

Please sign in to comment.