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]
评论列表
文章目录