#NEWLINE# def _reparam( self ) : #NEWLINE# #INDENT# "\n        Returns parameters of the map converting parameters from the\n        form used in optimization to the form returned to the user.\n\n        Returns\n        -------\n        lin : list-like\n            Linear terms of the map\n        quad : list-like\n            Quadratic terms of the map\n\n        Notes\n        -----\n        If P are the standard form parameters and R are the\n        transformed parameters (i.e. with the Cholesky square root\n        covariance and square root transformed variane components),\n        then P[i] = lin[i] * R + R' * quad[i] * R\n        " #NEWLINE# ( k_fe , k_re , k_re2 , k_vc ) = ( self . k_fe , self . k_re , self . k_re2 , self . k_vc ) #NEWLINE# k_tot = ( ( k_fe + k_re2 ) + k_vc ) #NEWLINE# ix = np . tril_indices ( self . k_re ) #NEWLINE# lin = [ ] #NEWLINE# for k in range ( k_fe ) : #NEWLINE# #INDENT# e = np . zeros ( k_tot ) #NEWLINE# e [ k ] = 1 #NEWLINE# lin . append ( e ) #NEWLINE# #UNINDENT# for k in range ( ii ) : #NEWLINE# #INDENT# lin . append ( np . zeros ( k_tot ) ) #NEWLINE# #UNINDENT# for k in range ( k_vc ) : #NEWLINE# #INDENT# lin . append ( np . zeros ( k_tot ) ) #NEWLINE# #UNINDENT# quad = [ ] #NEWLINE# for k in range ( k_tot ) : #NEWLINE# #INDENT# quad . append ( np . zeros ( ( k_tot , k_tot ) ) ) #NEWLINE# #UNINDENT# ii = np . tril_indices ( k_re ) #NEWLINE# ix = [ ( a , b ) for ( a , b ) in zip ( ii [ 0 ] , ii [ 1 ] ) ] #NEWLINE# for i1 in range ( k_re2 ) : #NEWLINE# #INDENT# for i2 in range ( k_re2 ) : #NEWLINE# #INDENT# ix1 = ix [ i1 ] #NEWLINE# ix2 = ix [ i2 ] #NEWLINE# if ( ( ix1 [ 1 ] == ix2 [ 1 ] ) and ( ix1 [ 0 ] <= ix2 [ 0 ] ) ) : #NEWLINE# #INDENT# ii = ( ix2 [ 0 ] , ix1 [ 0 ] ) #NEWLINE# k = ix . index ( ii ) #NEWLINE# quad [ ( k_fe + k ) ] [ ( ( k_fe + i2 ) , ( k_fe + i1 ) ) ] += 1 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for k in range ( k_tot ) : #NEWLINE# #INDENT# quad [ k ] = ( 0.5 * ( quad [ k ] + quad [ k ] . T ) ) #NEWLINE# #UNINDENT# km = ( k_fe + k_re2 ) #NEWLINE# for k in range ( km , ( km + k_vc ) ) : #NEWLINE# #INDENT# quad [ k ] [ ( k , k ) ] = 1 #NEWLINE# #UNINDENT# return ( lin , quad )