@@ -51,7 +51,7 @@ def test_estimate_ar_params_yw_localized():
51
51
52
52
for p in range (1 , 4 ):
53
53
gamma = correlation .temporal_autocorrelation (
54
- R [- (p + 1 ) :], window = "gaussian" , window_radius = 50
54
+ R [- (p + 1 ) :], window = "gaussian" , window_radius = 25
55
55
)
56
56
phi = autoregression .estimate_ar_params_yw_localized (gamma )
57
57
assert len (phi ) == p + 1
@@ -63,20 +63,20 @@ def test_estimate_ar_params_ols_localized():
63
63
R = _create_data_univariate ()
64
64
65
65
for p in range (1 , 4 ):
66
- phi = autoregression .estimate_ar_params_ols_localized (R [- (p + 1 ) :], p , 50 )
66
+ phi = autoregression .estimate_ar_params_ols_localized (R [- (p + 1 ) :], p , 25 )
67
67
assert len (phi ) == p + 1
68
68
for i in range (len (phi )):
69
69
assert phi [i ].shape == R .shape [1 :]
70
70
71
71
phi = autoregression .estimate_ar_params_ols_localized (
72
- R [- (p + 1 ) :], p , 50 , include_constant_term = True
72
+ R [- (p + 1 ) :], p , 25 , include_constant_term = True
73
73
)
74
74
assert len (phi ) == p + 2
75
75
for i in range (len (phi )):
76
76
assert phi [i ].shape == R .shape [1 :]
77
77
78
78
phi = autoregression .estimate_ar_params_ols_localized (
79
- R [- (p + 2 ) :], p , 50 , include_constant_term = True , d = 1
79
+ R [- (p + 2 ) :], p , 25 , include_constant_term = True , d = 1
80
80
)
81
81
assert len (phi ) == p + 3
82
82
for i in range (len (phi )):
@@ -115,21 +115,21 @@ def test_estimate_var_params_ols_localized():
115
115
q = R .shape [1 ]
116
116
117
117
for p in range (1 , 4 ):
118
- phi = autoregression .estimate_var_params_ols_localized (R [- (p + 1 ) :], p , 50 )
118
+ phi = autoregression .estimate_var_params_ols_localized (R [- (p + 1 ) :], p , 25 )
119
119
assert len (phi ) == p + 1
120
120
for i in range (len (phi )):
121
121
assert phi [i ].shape == (R .shape [2 ], R .shape [3 ], q , q )
122
122
123
123
phi = autoregression .estimate_var_params_ols_localized (
124
- R [- (p + 1 ) :], p , 50 , include_constant_term = True
124
+ R [- (p + 1 ) :], p , 25 , include_constant_term = True
125
125
)
126
126
assert len (phi ) == p + 2
127
127
assert phi [0 ].shape == (R .shape [2 ], R .shape [3 ], q )
128
128
for i in range (1 , len (phi )):
129
129
assert phi [i ].shape == (R .shape [2 ], R .shape [3 ], q , q )
130
130
131
131
phi = autoregression .estimate_var_params_ols_localized (
132
- R [- (p + 2 ) :], p , 50 , include_constant_term = True , d = 1
132
+ R [- (p + 2 ) :], p , 25 , include_constant_term = True , d = 1
133
133
)
134
134
assert len (phi ) == p + 3
135
135
assert phi [0 ].shape == (R .shape [2 ], R .shape [3 ], q )
@@ -154,7 +154,7 @@ def test_estimate_var_params_yw_localized():
154
154
155
155
for p in range (1 , 4 ):
156
156
gamma = correlation .temporal_autocorrelation_multivariate (
157
- R [- (p + 1 ) :], window = "gaussian" , window_radius = 50
157
+ R [- (p + 1 ) :], window = "gaussian" , window_radius = 25
158
158
)
159
159
phi = autoregression .estimate_var_params_yw_localized (gamma )
160
160
assert len (phi ) == p + 1
@@ -174,7 +174,7 @@ def test_iterate_ar_localized():
174
174
R = _create_data_univariate ()
175
175
p = 2
176
176
177
- phi = autoregression .estimate_ar_params_ols_localized (R [- (p + 1 ) :], p , 50 )
177
+ phi = autoregression .estimate_ar_params_ols_localized (R [- (p + 1 ) :], p , 25 )
178
178
R_ = autoregression .iterate_ar_model (R , phi )
179
179
assert R_ .shape == R .shape
180
180
@@ -192,7 +192,7 @@ def test_iterate_var_localized():
192
192
R = _create_data_multivariate ()
193
193
p = 2
194
194
195
- phi = autoregression .estimate_var_params_ols_localized (R [- (p + 1 ) :], p , 50 )
195
+ phi = autoregression .estimate_var_params_ols_localized (R [- (p + 1 ) :], p , 25 )
196
196
R_ = autoregression .iterate_var_model (R , phi )
197
197
assert R_ .shape == R .shape
198
198
@@ -216,7 +216,7 @@ def _create_data_multivariate():
216
216
R .append (np .stack ([R_ , np .roll (R_ , 5 , axis = 0 )]))
217
217
218
218
R = np .stack (R )
219
- R = R [:, :, - 400 :, 200 : - 200 ]
219
+ R = R [:, :, 575 : 800 , 255 : 480 ]
220
220
221
221
return R
222
222
@@ -240,6 +240,6 @@ def _create_data_univariate():
240
240
R .append (R_ )
241
241
242
242
R = np .stack (R )
243
- R = R [:, - 400 :, 200 : - 200 ]
243
+ R = R [:, 575 : 800 , 255 : 480 ]
244
244
245
245
return R
0 commit comments