コード例 #1
0
    def __init__(
        self, distribution, kernel, nu2=0.1, gamma=None, sample_discard=500, num_samples_Z=1000, stop_adapt=20000
    ):

        Kameleon.__init__(self, distribution, kernel, Z=None, nu2=nu2, gamma=gamma)

        assert stop_adapt > sample_discard
        assert num_samples_Z > 0

        self.sample_discard = sample_discard
        self.num_samples_Z = num_samples_Z
        self.stop_adapt = stop_adapt
コード例 #2
0
ファイル: KameleonPCA.py プロジェクト: karlnapf/kameleon-mcmc
 def __init__(self, distribution, kernel, Z, nu2=0.1, gamma=0.1, num_eigen=10):
     Kameleon.__init__(self, distribution, kernel, Z, nu2, gamma)
     self.num_eigen = num_eigen
     if Z is None:
         self.Kc = None
         self.eigvalues = None
         self.eigvectors = None
     else:
         K = self.kernel.kernel(Z)
         H = Kernel.centring_matrix(len(self.Z))
         self.Kc = H.dot(K.dot(H))
         u, s, _ = svd(self.Kc)
         self.eigvalues = s[0 : self.num_eigen]
         self.eigvectors = u[:, 0 : self.num_eigen]
コード例 #3
0
    def __init__(self, distribution, kernel, nu2=0.1, gamma=None, \
                 sample_discard=500, num_samples_Z=1000, stop_adapt=20000):

        Kameleon.__init__(self,
                          distribution,
                          kernel,
                          Z=None,
                          nu2=nu2,
                          gamma=gamma)

        assert (stop_adapt > sample_discard)
        assert (num_samples_Z > 0)

        self.sample_discard = sample_discard
        self.num_samples_Z = num_samples_Z
        self.stop_adapt = stop_adapt
コード例 #4
0
ファイル: KameleonPCA.py プロジェクト: mgong2/kameleon-mcmc
 def __init__(self,
              distribution,
              kernel,
              Z,
              nu2=0.1,
              gamma=0.1,
              num_eigen=10):
     Kameleon.__init__(self, distribution, kernel, Z, nu2, gamma)
     self.num_eigen = num_eigen
     if Z is None:
         self.Kc = None
         self.eigvalues = None
         self.eigvectors = None
     else:
         K = self.kernel.kernel(Z)
         H = Kernel.centring_matrix(len(self.Z))
         self.Kc = H.dot(K.dot(H))
         u, s, _ = svd(self.Kc)
         self.eigvalues = s[0:self.num_eigen]
         self.eigvectors = u[:, 0:self.num_eigen]