25
25
𝒦 = Bartlett {NeweyWest} ()
26
26
Σ = a𝕍ar (𝒦, X)
27
27
@test 𝒦. bw[1 ] ≈ 5.326955 atol= 1e-6
28
- @test optimalbw (𝒦, X; prewhiten = false , demean= true ) ≈ 𝒦. bw[1 ] rtol= 1e-9
28
+ @test optimalbw (𝒦, X; prewhite = false , demean= true ) ≈ 𝒦. bw[1 ] rtol= 1e-9
29
29
30
30
𝒦 = Parzen {NeweyWest} ()
31
31
Σ = a𝕍ar (𝒦, X)
32
32
@test 𝒦. bw[1 ] ≈ 9.72992 atol= 1e-6
33
- @test optimalbw (𝒦, X; prewhiten = false , demean= true ) ≈ 𝒦. bw[1 ] rtol= 1e-9
33
+ @test optimalbw (𝒦, X; prewhite = false , demean= true ) ≈ 𝒦. bw[1 ] rtol= 1e-9
34
34
35
35
𝒦 = QuadraticSpectral {NeweyWest} ()
36
36
Σ = a𝕍ar (𝒦, X)
37
37
@test 𝒦. bw[1 ] ≈ 4.833519 atol= 1e-6
38
- @test optimalbw (𝒦, X; prewhiten = false , demean= true ) ≈ 𝒦. bw[1 ] rtol= 1e-9
38
+ @test optimalbw (𝒦, X; prewhite = false , demean= true ) ≈ 𝒦. bw[1 ] rtol= 1e-9
39
39
# # ---
40
40
𝒦 = Bartlett {NeweyWest} ()
41
- Σ = a𝕍ar (𝒦, X; prewhiten = true )
41
+ Σ = a𝕍ar (𝒦, X; prewhite = true )
42
42
@test 𝒦. bw[1 ] ≈ 1.946219 rtol= 1e-7
43
- @test optimalbw (𝒦, X; prewhiten = true ) == 𝒦. bw[1 ]
43
+ @test optimalbw (𝒦, X; prewhite = true ) == 𝒦. bw[1 ]
44
44
45
45
𝒦 = Parzen {NeweyWest} ()
46
- Σ = a𝕍ar (𝒦, X; prewhiten = true )
46
+ Σ = a𝕍ar (𝒦, X; prewhite = true )
47
47
@test 𝒦. bw[1 ] ≈ 6.409343 rtol= 1e-7
48
- @test optimalbw (𝒦, X; prewhiten = true ) == 𝒦. bw[1 ]
48
+ @test optimalbw (𝒦, X; prewhite = true ) == 𝒦. bw[1 ]
49
49
50
50
𝒦 = QuadraticSpectral {NeweyWest} ()
51
- Σ = a𝕍ar (𝒦, X; prewhiten = true )
51
+ Σ = a𝕍ar (𝒦, X; prewhite = true )
52
52
@test 𝒦. bw[1 ] ≈ 3.183961 atol= 1e-6
53
- @test optimalbw (𝒦, X; prewhiten = true ) == 𝒦. bw[1 ]
53
+ @test optimalbw (𝒦, X; prewhite = true ) == 𝒦. bw[1 ]
54
54
end
55
55
56
56
@testset " OB Andrews" begin
57
57
𝒦 = Bartlett {Andrews} ()
58
- Σ = a𝕍ar (𝒦, X; prewhiten = false );
58
+ Σ = a𝕍ar (𝒦, X; prewhite = false );
59
59
@test 𝒦. bw[1 ] ≈ 2.329739 rtol= 1e-6
60
- @test optimalbw (𝒦, X; prewhiten = false ) == 𝒦. bw[1 ]
60
+ @test optimalbw (𝒦, X; prewhite = false ) == 𝒦. bw[1 ]
61
61
62
62
𝒦 = Parzen {Andrews} ()
63
- Σ = a𝕍ar (𝒦, X; prewhiten = false );
63
+ Σ = a𝕍ar (𝒦, X; prewhite = false );
64
64
@test 𝒦. bw[1 ] ≈ 4.81931 rtol= 1e-6
65
- @test CovarianceMatrices. optimalbw (𝒦, X; prewhiten = false ) == 𝒦. bw[1 ]
65
+ @test CovarianceMatrices. optimalbw (𝒦, X; prewhite = false ) == 𝒦. bw[1 ]
66
66
67
67
𝒦 = QuadraticSpectral {Andrews} ()
68
- Σ = a𝕍ar (𝒦, X; prewhiten = false )
68
+ Σ = a𝕍ar (𝒦, X; prewhite = false )
69
69
@test 𝒦. bw[1 ] ≈ 2.394082 atol= 1e-6
70
70
@test optimalbw (𝒦, X) == 𝒦. bw[1 ]
71
71
72
72
𝒦 = TukeyHanning {Andrews} ()
73
- Σ = a𝕍ar (𝒦, X; prewhiten = false )
73
+ Σ = a𝕍ar (𝒦, X; prewhite = false )
74
74
@test 𝒦. bw[1 ] ≈ 3.162049 rtol= 1e-6
75
75
@test optimalbw (𝒦, X) == 𝒦. bw[1 ]
76
76
77
77
𝒦 = Truncated {Andrews} ()
78
- Σ = a𝕍ar (𝒦, X; prewhiten = false )
78
+ Σ = a𝕍ar (𝒦, X; prewhite = false )
79
79
@test 𝒦. bw[1 ] ≈ 1.197131 rtol= 1e-6
80
80
@test optimalbw (𝒦, X) == 𝒦. bw[1 ]
81
81
82
82
# # --
83
83
𝒦 = Bartlett {Andrews} ()
84
- Σ = a𝕍ar (𝒦, X; prewhiten = true );
84
+ Σ = a𝕍ar (𝒦, X; prewhite = true );
85
85
@test 𝒦. bw[1 ] ≈ 0.3836096 rtol= 1e-6
86
- @test optimalbw (𝒦, X; prewhiten = true ) == 𝒦. bw[1 ]
86
+ @test optimalbw (𝒦, X; prewhite = true ) == 𝒦. bw[1 ]
87
87
88
88
𝒦 = Parzen {Andrews} ()
89
- Σ = a𝕍ar (𝒦, X; prewhiten = true );
89
+ Σ = a𝕍ar (𝒦, X; prewhite = true );
90
90
@test 𝒦. bw[1 ] ≈ 1.380593 rtol= 1e-6
91
- @test CovarianceMatrices. optimalbw (𝒦, X; prewhiten = true ) == 𝒦. bw[1 ]
91
+ @test CovarianceMatrices. optimalbw (𝒦, X; prewhite = true ) == 𝒦. bw[1 ]
92
92
93
93
𝒦 = QuadraticSpectral {Andrews} ()
94
- Σ = a𝕍ar (𝒦, X; prewhiten = true )
94
+ Σ = a𝕍ar (𝒦, X; prewhite = true )
95
95
@test 𝒦. bw[1 ] ≈ 0.6858351 atol= 1e-6
96
96
@test optimalbw (𝒦, X) == 𝒦. bw[1 ]
97
97
98
98
𝒦 = TukeyHanning {Andrews} ()
99
- Σ = a𝕍ar (𝒦, X; prewhiten = true )
99
+ Σ = a𝕍ar (𝒦, X; prewhite = true )
100
100
@test 𝒦. bw[1 ] ≈ 0.9058356 rtol= 1e-6
101
101
@test optimalbw (𝒦, X) == 𝒦. bw[1 ]
102
102
103
103
𝒦 = Truncated {Andrews} ()
104
- Σ = a𝕍ar (𝒦, X; prewhiten = true )
104
+ Σ = a𝕍ar (𝒦, X; prewhite = true )
105
105
@test 𝒦. bw[1 ] ≈ 0.3429435 rtol= 1e-6
106
106
@test optimalbw (𝒦, X) == 𝒦. bw[1 ]
107
107
@@ -201,8 +201,8 @@ QuadraticSpectral{NeweyWest}())
201
201
pre = (false , true )
202
202
203
203
@testset " aVar HAC" begin
204
- for ((𝒦, prewhiten ), Σ₀) in zip (Iterators. product (kernels, pre), Σ₀₀)
205
- Σ = a𝕍ar (𝒦, X; prewhiten = prewhiten )
204
+ for ((𝒦, prewhite ), Σ₀) in zip (Iterators. product (kernels, pre), Σ₀₀)
205
+ Σ = a𝕍ar (𝒦, X; prewhite = prewhite )
206
206
@test Σ ≈ Σ₀ rtol= 1e-6
207
207
end
208
208
end
@@ -290,7 +290,7 @@ function fopt!(u; weighted=false)
290
290
eval (quote
291
291
ols = glm (@formula (y~ x1+ x2+ x3), $ df, Normal (), IdentityLink (), wts= $ weighted ? $ (df). w : Float64[])
292
292
𝒦 = ($ k){Andrews}()
293
- tmp = vcov (𝒦, ols; prewhiten = $ pre, dofadjust= false )
293
+ tmp = vcov (𝒦, ols; prewhite = $ pre, dofadjust= false )
294
294
da[String ($ k)] = Dict {String, Any} (" bw" => CM. bandwidth (𝒦), " V" => tmp)
295
295
end )
296
296
end
@@ -299,7 +299,7 @@ function fopt!(u; weighted=false)
299
299
eval (quote
300
300
𝒦 = ($ k){NeweyWest}()
301
301
# # To get the same results of R, the weights given to the intercept should be 0
302
- tmp = vcov (𝒦, ols; prewhiten = $ pre, dofadjust= false )
302
+ tmp = vcov (𝒦, ols; prewhite = $ pre, dofadjust= false )
303
303
dn[String ($ k)] = Dict {String, Any} (" bw" => CM. bandwidth (𝒦), " V" => tmp)
304
304
end )
305
305
end
@@ -341,15 +341,15 @@ function ffix!(u; weighted=false)
341
341
eval (quote
342
342
ols = glm (@formula (y~ x1+ x2+ x3), $ df, Normal (), IdentityLink (), wts= $ weighted ? $ (df). w : Float64[])
343
343
𝒦 = ($ k)(3 )
344
- tmp = vcov (𝒦, ols; prewhiten = $ pre, dofadjust= false )
344
+ tmp = vcov (𝒦, ols; prewhite = $ pre, dofadjust= false )
345
345
da[String ($ k)] = Dict {String, Any} (" bw" => CM. bandwidth (𝒦), " V" => tmp)
346
346
end )
347
347
end
348
348
for k in neweywest_kernels
349
349
eval (quote
350
350
𝒦 = ($ k)(3 )
351
351
# # To get the same results of R, the weights given to the intercept should be 0
352
- tmp = vcov (𝒦, ols; prewhiten = $ pre, dofadjust= false )
352
+ tmp = vcov (𝒦, ols; prewhite = $ pre, dofadjust= false )
353
353
dn[String ($ k)] = Dict {String, Any} (" bw" => CM. bandwidth (𝒦), " V" => tmp)
354
354
end )
355
355
end
0 commit comments