#NEWLINE# def __init__( self , endog , svar_type , dates = None , freq = None , A = None , B = None , missing = 'none' ) : #NEWLINE# #INDENT# super ( SVAR , self ) . __init__ ( endog , None , dates , freq , missing = missing ) #NEWLINE# self . y = self . endog #NEWLINE# self . neqs = self . endog . shape [ 1 ] #NEWLINE# types = [ 'A' , 'B' , 'AB' ] #NEWLINE# if ( svar_type not in types ) : #NEWLINE# #INDENT# raise ValueError ( ( 'SVAR type not recognized, must be in ' + str ( types ) ) ) #NEWLINE# #UNINDENT# self . svar_type = svar_type #NEWLINE# svar_ckerr ( svar_type , A , B ) #NEWLINE# if ( A is None ) : #NEWLINE# #INDENT# A = np . identity ( self . neqs ) #NEWLINE# self . A_mask = A_mask = np . zeros ( A . shape , dtype = bool ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# A_mask = np . logical_or ( ( A == 'E' ) , ( A == 'e' ) ) #NEWLINE# self . A_mask = A_mask #NEWLINE# #UNINDENT# if ( B is None ) : #NEWLINE# #INDENT# B = np . identity ( self . neqs ) #NEWLINE# self . B_mask = B_mask = np . zeros ( B . shape , dtype = bool ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# B_mask = np . logical_or ( ( B == 'E' ) , ( B == 'e' ) ) #NEWLINE# self . B_mask = B_mask #NEWLINE# #UNINDENT# Anum = np . zeros ( A . shape , dtype = float ) #NEWLINE# Anum [ ( ~ A_mask ) ] = A [ ( ~ A_mask ) ] #NEWLINE# Anum [ A_mask ] = np . nan #NEWLINE# self . A = Anum #NEWLINE# Bnum = np . zeros ( B . shape , dtype = float ) #NEWLINE# Bnum [ ( ~ missing ) ] = B [ ( ~ B_mask ) ] #NEWLINE# Bnum [ B_mask ] = np . nan #NEWLINE# self . B = Bnum