1""" 2Test Results for the VAR model. Obtained from Stata using 3datasets/macrodata/var.do 4""" 5 6import numpy as np 7 8 9class MacrodataResults(object): 10 def __init__(self): 11 params = [ 12 -0.2794863875, 0.0082427826, 0.6750534746, 0.2904420695, 13 0.0332267098, -0.0073250059, 0.0015269951, -0.1004938623, 14 -0.1231841792, 0.2686635768, 0.2325045441, 0.0257430635, 15 0.0235035714, 0.0054596064, -1.97116e+00, 0.3809752365, 16 4.4143364022, 0.8001168377, 0.2255078864, -0.1241109271, 17 -0.0239026118] 18 params = np.asarray(params).reshape(3, -1) 19 params = np.hstack((params[:, -1][:, None], 20 params[:, :-1:2], 21 params[:, 1::2])) 22 self.params = params 23 self.neqs = 3 24 self.nobs = 200 25 self.df_eq = 7 26 self.nobs_1 = 200 27 self.df_model_1 = 6 28 self.rmse_1 = .0075573716985351 29 self.rsquared_1 = .2739094844780006 30 self.llf_1 = 696.8213727557811 31 self.nobs_2 = 200 32 self.rmse_2 = .0065444260782597 33 self.rsquared_2 = .1423626064753714 34 self.llf_2 = 725.6033255319256 35 self.nobs_3 = 200 36 self.rmse_3 = .0395942039671031 37 self.rsquared_3 = .2955406949737428 38 self.llf_3 = 365.5895183036045 39 # These are from Stata. They use the LL based definition 40 # We return Lutkepohl statistics. See Stata TS manual page 436 41 # self.bic = -19.06939794312953 42 # self.aic = -19.41572126661708 43 # self.hqic = -19.27556951526737 44 # These are from R. See var.R in macrodata folder 45 self.bic = -2.758301611618373e+01 46 self.aic = -2.792933943967127e+01 47 self.hqic = -2.778918768832157e+01 48 self.fpe = 7.421287668357018e-13 49 self.detsig = 6.01498432283e-13 50 self.llf = 1962.572126661708 51 52 self.chi2_1 = 75.44775165699033 53 # do not know how they calculate this; it's not -2 * (ll1 - ll0) 54 55 self.chi2_2 = 33.19878716815366 56 self.chi2_3 = 83.90568280242312 57 bse = [ 58 .1666662376, .1704584393, .1289691456, .1433308696, .0257313781, 59 .0253307796, .0010992645, .1443272761, .1476111934, .1116828804, 60 .1241196435, .0222824956, .021935591, .0009519255, .8731894193, 61 .8930573331, .6756886998, .7509319263, .1348105496, .1327117543, 62 .0057592114] 63 bse = np.asarray(bse).reshape(3, -1) 64 bse = np.hstack((bse[:, -1][:, None], 65 bse[:, :-1:2], 66 bse[:, 1::2])) 67 self.bse = bse 68