Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arch/tests/utility/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ def test_centered_ols_level_with_tiny_variation():
# The reference centers and normalizes the columns, which makes them
# orthogonal to the constant and of the same size
centered = rhs.to_numpy().copy()
centered[:, :3] -= centered[:, :3].mean(0)
centered[:, :3] -= centered[:, :3].mean(axis=0)
norms = np.linalg.norm(centered, axis=0)
beta = np.linalg.lstsq(centered / norms, lhs, rcond=None)[0] / norms
assert_allclose(res.params.iloc[:3], beta[:3], rtol=1e-4)
# The intercept of the centered regression is the mean of lhs, and the constant
# is the intercept of the regression on the level
means = rhs.iloc[:, :3].mean(0).to_numpy()
means = rhs.iloc[:, :3].mean(axis=0).to_numpy()
params = res.params.to_numpy()
assert_allclose(params[3], lhs.mean() - means @ params[:3], rtol=1e-12)
assert np.isfinite(res.tvalues).all()
Expand Down
2 changes: 1 addition & 1 deletion examples/univariate_volatility_modeling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@
"metadata": {},
"outputs": [],
"source": [
"from arch.univariate import GARCH, MAMean\n",
"from arch.univariate import MAMean\n",
"\n",
"ma_mod = MAMean(returns, lags=1, volatility=GARCH(p=1, q=1))\n",
"ma_res = ma_mod.fit(disp=\"off\")\n",
Expand Down
Loading