New make replica
Created by: VLTSML26
The main version of make_replica
in pseudodata.py
takes a sampling covariance matrix in input and uses its square root to generate shifts for pseudodata. This is done through sqrt_covmat
in covmats.py
by calling a Cholesky decomposition method from scipy.linalg
module.
The new version of make_replica
will take as input only the eigenvalues and eigenvectors and will calculate the square root of the covariance matrix without using the scipy
module. This is done under the assumption that another scipy module, scipy.linalg.eig
, returns a orthogonal (or unitary) base change. Let C be the covmat: it follows that C=UDU^T, when D is diagonal and U is the eigenvector matrix. Since D is diagonal and C is positive definite, we can write C=UD^{1/2}D^{1/2}U^T=UD^{1/2}(UD^{1/2})^T and therefore UD^{1/2} is a Cholesky decomposition, i.e. a square root of C.
I have tested the two methodologies with a level 2 closure test here (the fits are also uploaded on the server). Is there another way of testing the right behavior of the new approach? I also would like to know if this would give problems elsewhere.