def ASDPoptim(self, block_size, approx_method): """ Defining C2 of the kncokoff paper using approximate SDP optimization method: https://statweb.stanford.edu/~candes/papers/MF_knockoffs.pdf """ sol = utils.asdp(self.Sigma, block_size, approx_method) s = np.diag(np.array(sol).flatten()) C2 = 2. * s - np.dot(s, np.dot(self.Sigma_inv, s)) return (C2, s)
def ASDPoptim(Sigma, Sigma_inv, block_size, approx_method): sol = utils.asdp(Sigma, block_size, approx_method) s = np.diag(np.array(sol).flatten()) C2 = 2. * s - np.dot(s, np.dot(Sigma_inv, s)) return(C2, s)