import numpy as np



def compute_bands(vals, levels=[1.0, 5.5, 12.5, 25.0, 50.0, 75.0, 87.5, 94.5, 99.0]):
    '''
    Given an array with shape (x, y, z) where x is the dimension for samples, y is the 
    dimension for time, and z the dimension variable, computes the corresponding percentile bands for credible intervals.
    '''
    def scoreatpercentile(vals, p):
        return np.percentile(vals, p, axis=0)
    perc = {p:scoreatpercentile(vals,p) for p in levels}
    median = np.median(vals, axis=0)
    return perc
import numpy as np



def compute_bands(vals, levels=[1.0, 5.5, 12.5, 25.0, 50.0, 75.0, 87.5, 94.5, 99.0]):
    '''
    Given an array with shape (x, y, z) where x is the dimension for samples, y is the 
    dimension for time, and z the dimension variable, computes the corresponding percentile bands for credible intervals.
    '''
    def scoreatpercentile(vals, p):
        return np.percentile(vals, p, axis=0)
    perc = {p:scoreatpercentile(vals,p) for p in levels}
    median = np.median(vals, axis=0)
    return perc
Given an array with shape (x, y, z) where x is the dimension for samples, y is the      dimension for time, and z the dimension variable, computes the corresponding percentile bands for credible intervals.