AlTarFramework / altar

Other
33 stars 17 forks source link

Changes made to make mogi and cdm run properly #11

Open gracebato opened 5 years ago

gracebato commented 5 years ago

1) proper calculation of LLK (e.g. LLK = normalization - normeval**2.0 / 2.0 ) 2) avoiding 0 values in the random generator within Metropolis.py 3) dV is now treated as a non-Jeffrey parameter to allow negative source (deflation). 4) LOS matrix for the EW component should have a negative sign.

lijun99 commented 5 years ago

The framework changes were also included in my previous pull request.

  1. proper calculation of LLK (e.g. LLK = normalization - normeval*2.0 / 2.0 ) I have proposed to use ddot (v*v) instead of dnrm2 (|v|) in L2.py:eval. Maybe a compromise is that we define a new function evalsquare for (v*v) so that users can pick either eval (LLK = -0.5*norm*norm) or evalsquare (LLK = -0.5\normsq) in their models. I will test which one is more efficient, but judging from openblas x86_64 kernels, ddot is better optimized with streaming SIMD extensions.

  2. avoiding 0 values in the random generator within Metropolis.py gsl offers a positive uniform distribution implementation, which is now included in pyre. Use self.uniform = altar.pdf.uniform_pos(rng=rng) instead. Adding a range requires rescaling for each generated random number, which might not be efficient.