Weighted Least Squares

Weighted Least Squares Link to Notebook GitHub In [1]: from __future__ import print_function import numpy as np from scipy import stats import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std from statsmodels.iolib.table import (SimpleTable, default_txt_fmt) np.random.seed(1024) WLS Estimation Artificial data: Heteroscedasticity 2 groups Model assumptions: Misspecification: true model is quadratic, estimat

Weight Functions

Weight Functions Andrew?s Wave Hampel 17A Huber?s t Least Squares Ramsay?s Ea Trimmed Mean Tukey?s Biweight

Vector Autoregressions tsa.vector_ar

Vector Autoregressions tsa.vector_ar VAR(p) processes We are interested in modeling a multivariate time series , where denotes the number of observations and the number of variables. One way of estimating relationships between the time series and their lagged values is the vector autoregression process: where is a coefficient matrix. We follow in large part the methods and notation of Lutkepohl (2005), which we will not develop here. Model fitting Note The classes referenced below ar

VARResults.test_whiteness()

statsmodels.tsa.vector_ar.var_model.VARResults.test_whiteness VARResults.test_whiteness(nlags=10, plot=True, linewidth=8) [source] Test white noise assumption. Sample (Y) autocorrelations are compared with the standard bounds. Parameters: plot : boolean, default True Plot autocorrelations with 2 / sqrt(T) bounds

VARResults.test_normality()

statsmodels.tsa.vector_ar.var_model.VARResults.test_normality VARResults.test_normality(signif=0.05, verbose=True) [source] Test assumption of normal-distributed errors using Jarque-Bera-style omnibus Chi^2 test Parameters: signif : float Test significance threshold Notes H0 (null) : data are generated by a Gaussian-distributed process

VARResults.test_causality()

statsmodels.tsa.vector_ar.var_model.VARResults.test_causality VARResults.test_causality(equation, variables, kind='f', signif=0.05, verbose=True) [source] Compute test statistic for null hypothesis of Granger-noncausality, general function to test joint Granger-causality of multiple variables Parameters: equation : string or int Equation to test for causality variables : sequence (of strings or ints) List, tuple, etc. of variables to test for Granger-causality kind : {?f?, ?wald?} Perf

VARResults.summary()

statsmodels.tsa.vector_ar.var_model.VARResults.summary VARResults.summary() [source] Compute console output summary of estimates Returns: summary : VARSummary

VARResults.sample_acov()

statsmodels.tsa.vector_ar.var_model.VARResults.sample_acov VARResults.sample_acov(nlags=1) [source]

VARResults.sample_acorr()

statsmodels.tsa.vector_ar.var_model.VARResults.sample_acorr VARResults.sample_acorr(nlags=1) [source]

VARResults.resid_acov()

statsmodels.tsa.vector_ar.var_model.VARResults.resid_acov VARResults.resid_acov(nlags=1) [source] Compute centered sample autocovariance (including lag 0) Parameters: nlags : int