generate

def genHidden(self,nHidden=10,vTot=0.5,vCommon=0.1):
        """ generate  """

        vSpecific = vTot-vCommon

        # generate hidden
        X = self.genWeights(self.N,nHidden)

        # common effect
        H = self.genWeights(nHidden,self.P)
        Bc = SP.dot(H,self.genTraitEffect())
        Yc  = SP.dot(X,Bc)
        Yc *= SP.sqrt(vCommon/Yc.var(0).mean())

        # indipendent effect
        Bi  = SP.randn(nHidden,self.P)
        Yi  = SP.dot(X,Bi)
        Yi *= SP.sqrt(vSpecific/Yi.var(0).mean())

        return Yc,Yi