I'm going to see the behavior of ensembles of the data. a better way to visualize ensemble is by using the various uncertainty intervals along with the mean. We can compute the uncertainty interval at various percentile using the" st.scoreatpercentile" But using the following code, I encounter an error and figure is not plotted.
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as st
# generate some data
x = 100*np.sin([np.linspace(0,10,100)])
X = np.vstack([x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x])
e = 10*np.random.randn(20,100)
X_err = X+e
ll = st.scoreatpercentile(X_err, 10) # 10th percentile
ml = st.scoreatpercentile(X_err, 50) # 50th percentile
ul = st.scoreatpercentile(X_err, 90) # 90th percentile
plt.plot(ml,'g', lw=2, label= ' Median ' )
plt.plot(ul,'r', label= ' 90% ' )
plt.plot(ll,'b', label= ' 10% ' )
plt.xlabel( ' Time ' )
plt.ylabel( ' X ' )
plt.legend(loc= 'best' )
plt.show()