output.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:abcpy 作者: eth-cscs 项目源码 文件源码
def posterior_histogram(self, n_bins = 10):
        """
        Computes a weighted histogram of multivariate posterior samples
        andreturns histogram H and A list of p arrays describing the bin 
        edges for each dimension.

        Returns
        -------
        python list 
            containing two elements (H = np.ndarray, edges = list of p arraya)
        """        
        endp = len(self.parameters) - 1
        endw = len(self.weights) - 1

        params = self.parameters[endp]
        weights = self.weights[endw]
        weights.shape
        H, edges = np.histogramdd(params, bins = n_bins, weights = weights.reshape(len(weights),))

        return [H, edges]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号