def _getScalesDiag(self,termx=0):
        """
        Uses 2 term single trait model to get covar params for initialization
        
        Args:
            termx:      non-noise term terms that is used for initialization 
        """
        assert self.P>1, 'CVarianceDecomposition:: diagonal init_method allowed only for multi trait models' 
        assert self.noisPos!=None, 'CVarianceDecomposition:: noise term has to be set'
        assert termx<self.n_terms-1, 'CVarianceDecomposition:: termx>=n_terms-1'
        assert self.covar_type[self.noisPos] not in ['lowrank','block','fixed'], 'CVarianceDecimposition:: diagonal initializaiton not posible for such a parametrization'
        assert self.covar_type[termx] not in ['lowrank','block','fixed'], 'CVarianceDecimposition:: diagonal initializaiton not posible for such a parametrization'
        scales = []
        res = self.estimateHeritabilities(self.vd.getTerm(termx).getK())
        scaleg = SP.sqrt(res['varg'].mean())
        scalen = SP.sqrt(res['varn'].mean())
        for term_i in range(self.n_terms):
            if term_i==termx:
                _scales = scaleg*self.diag[term_i]
            elif term_i==self.noisPos:
                _scales = scalen*self.diag[term_i]
            else:
                _scales = 0.*self.diag[term_i]
            if self.offset[term_i]>0:
                _scales = SP.concatenate((_scales,SP.array([SP.sqrt(self.offset[term_i])])))
            scales.append(_scales)
        return SP.concatenate(scales)
def _getScalesDiag ( self , termx = 0 ) : assert self . P > 1 , 'CVarianceDecomposition:: diagonal init_method allowed only for multi trait models' assert self . noisPos != None , 'CVarianceDecomposition:: noise term has to be set' assert termx < self . n_terms - 1 , 'CVarianceDecomposition:: termx>=n_terms-1' assert self . covar_type [ self . noisPos ] not in [ 'lowrank' , 'block' , 'fixed' ] , 'CVarianceDecimposition:: diagonal initializaiton not posible for such a parametrization' assert self . covar_type [ termx ] not in [ 'lowrank' , 'block' , 'fixed' ] , 'CVarianceDecimposition:: diagonal initializaiton not posible for such a parametrization' scales = [ ] res = self . estimateHeritabilities ( self . vd . getTerm ( termx ) . getK ( ) ) scaleg = SP . sqrt ( res [ 'varg' ] . mean ( ) ) scalen = SP . sqrt ( res [ 'varn' ] . mean ( ) ) for term_i in range ( self . n_terms ) : if term_i == termx : _scales = scaleg * self . diag [ term_i ] elif term_i == self . noisPos : _scales = scalen * self . diag [ term_i ] else : _scales = 0. * self . diag [ term_i ] if self . offset [ term_i ] > 0 : _scales = SP . concatenate ( ( _scales , SP . array ( [ SP . sqrt ( self . offset [ term_i ] ) ] ) ) ) scales . append ( _scales ) return SP . concatenate ( scales )
Uses 2 term single trait model to get covar params for initialization
        
        Args:
            termx:      non-noise term terms that is used for initialization