Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

from __future__ import print_function, division, absolute_import, unicode_literals 

 

import numpy as np 

from cosmoHammer import getLogger 

 

class MultivarianteGaussianModule(object): 

""" 

Chain for computing the likelihood of a multivariante gaussian distribution 

""" 

def __init__(self, icov, mu): 

self.icov = icov 

self.mu = mu 

 

 

def computeLikelihood(self, ctx): 

x = ctx.getParams() 

diff = x-self.mu 

return -np.dot(diff,np.dot(self.icov,diff))/2.0 

 

def setup(self): 

getLogger().info("Multivariante Gaussian setup")