def trimmed_mean_ci(data, limits=(0.2, 0.2), inclusive=(True, True), alpha=0.05, axis=None):
 data = ma.array(data, copy=False)
 trimmed = mstats.trimr(data, limits=limits, inclusive=inclusive, axis=axis)
 tmean = trimmed.mean(axis)
 tstde = mstats.trimmed_stde(data, limits=limits, inclusive=inclusive, axis=axis)
 df = (trimmed.count(axis) - 1)
 tppf = t.ppf((1 - (alpha / 2.0)), df)
 return np.array(((tmean - (tppf * tstde)), (tmean + (tppf * tstde))))

def trimmed_mean_ci ( data , limits = ( 0.2 , 0.2 ) , inclusive = ( True , True ) , alpha = 0.05 , axis = None ) : data = ma . array ( data , copy = False ) trimmed = mstats . trimr ( data , limits = limits , inclusive = inclusive , axis = axis ) tmean = trimmed . mean ( axis ) tstde = mstats . trimmed_stde ( data , limits = limits , inclusive = inclusive , axis = axis ) df = ( trimmed . count ( axis ) - 1 ) tppf = t . ppf ( ( 1 - ( alpha / 2.0 ) ) , df ) return np . array ( ( ( tmean - ( tppf * tstde ) ) , ( tmean + ( tppf * tstde ) ) ) )
selected confidence interval of the trimmed mean along the given axis .