#NEWLINE# def _estimate_svar( self , start_params , lags , maxiter , maxfun , trend = 'c' , solver = 'nm' , override = False ) : #NEWLINE# #INDENT# '\n        lags : int\n        trend : string or None\n            As per above\n        ' #NEWLINE# k_trend = util . get_trendorder ( trend ) #NEWLINE# y = self . endog #NEWLINE# z = util . get_var_endog ( y , lags , trend = trend , has_constant = 'raise' ) #NEWLINE# y_sample = y [ lags : ] #NEWLINE# var_params = np . linalg . lstsq ( z , y_sample ) [ 0 ] #NEWLINE# resid = ( y_sample - np . dot ( z , var_params ) ) #NEWLINE# avobs = len ( y_sample ) #NEWLINE# df_resid = ( avobs - ( ( self . neqs * A_mask ) + k_trend ) ) #NEWLINE# sse = np . dot ( resid . T , resid ) #NEWLINE# omega = ( sse / df_resid ) #NEWLINE# self . sigma_u = omega #NEWLINE# ( A , B ) = self . _solve_AB ( start_params , override = override , solver = solver , maxiter = maxiter , maxfun = maxfun ) #NEWLINE# A_mask = self . A_mask #NEWLINE# B_mask = self . B_mask #NEWLINE# return SVARResults ( y , z , var_params , omega , lags , names = self . endog_names , trend = trend , dates = self . data . dates , model = self , A = A , B = B , A_mask = A_mask , B_mask = B_mask )