wcoulton/CompressedFisher

Calculation of the compressed covariance matrix for Mean Only case

Opened this issue · 0 comments

This message is regarding the def _compute_compressed_fisher_matrix_mean_only(self,params_names) function in gaussian.py file. It is likely that there is a problem with line 734 -
compressed_covmat = self.compress_vector(compressed_covmat.T,with_mean=False)/self._hartlap_comp # One factor cancels here as we have C^{-1}C C^{-1}

I think the factor of self._hartlap_comp is not necessary since it is taken care of in the compression happening in the previous lines 733 and 734. Perhaps it should be replaced by the Hartlap factor for the covariance of the compressed summaries, which is closer to 1. The replacement of line 734 in the modified code could look as follows -

n_sims_covmat = self._n_sims_covmat_fisher
self._hartlap_dim = (n_sims_covmat-dim_fisher-2)/(n_sims_covmat-1)
compressed_covmat = self.compress_vector(compressed_covmat.T,with_mean=False)/self._hartlap_dim # One factor cancels here as we have C^{-1}C C^{-1} 

Let me know if you have any questions. Thank you!