confidence-interval

Plot average of multiple numpy arrays with confidence intervals shaded in python

Plot average of multiple numpy arrays with confidence intervals shaded in python Question: I have 100s of numpy arrays of size 1×2000 (e.g. np.array([1, 2, 3, ….]). I’m trying to plot the average line across all numpy arrays with the corresponding 5th and 95th confidence intervals (CIs), where the CIs are shaded. I’ve been trying …

Total answers: 1

How to take confidence interval of statsmodels.tsa.holtwinters-ExponentialSmoothing Models in python?

How to take confidence interval of statsmodels.tsa.holtwinters-ExponentialSmoothing Models in python? Question: I did time series forecasting analysis with ExponentialSmoothing in python. I used statsmodels.tsa.holtwinters. model = ExponentialSmoothing(df, seasonal=’mul’, seasonal_periods=12).fit() pred = model.predict(start=df.index[0], end=122) plt.plot(df_fc.index, df_fc, label=’Train’) plt.plot(pred.index, pred, label=’Holt-Winters’) plt.legend(loc=’best’) I want to take confidence interval of the model result. But I couldn’t find any …

Total answers: 4

Why am I getting a line shadow in a seaborn line plot?

Why am I getting a line shadow in a seaborn line plot? Question: Here is the code: fig=plt.figure(figsize=(14,8)) sns.lineplot(x=’season’, y=’team_strikerate’, hue=’batting_team’, data=overall_batseason) plt.legend(title = ‘Teams’, loc = 1, fontsize = 12) plt.xlim([2008,2022]) And here is the image Just to let you know, I’ve already drawn another similar lineplot above this one. Asked By: CuriousLearner || …

Total answers: 3

Lineplot with Seaborn and ci="sd" function

Lineplot with Seaborn and ci="sd" function Question: I’m trying to produce some snazzy charts in seaborn and need some help. I have some stock data, consisting of 5 stocks. I’m basically trying to visually display how Stock A has performed in comparison to the others. To do this I am looking at cumulative returns, and …

Total answers: 1

Correct way to obtain confidence interval with scipy

Correct way to obtain confidence interval with scipy Question: I have a 1-dimensional array of data: a = np.array([1,2,3,4,4,4,5,5,5,5,4,4,4,6,7,8]) for which I want to obtain the 68% confidence interval (ie: the 1 sigma). The first comment in this answer states that this can be achieved using scipy.stats.norm.interval from the scipy.stats.norm function, via: from scipy import …

Total answers: 3

Python function to get the t-statistic

Python function to get the t-statistic Question: I am looking for a Python function (or to write my own if there is not one) to get the t-statistic in order to use in a confidence interval calculation. I have found tables that give answers for various probabilities / degrees of freedom like this one, but …

Total answers: 4

scikit-learn – ROC curve with confidence intervals

scikit-learn – ROC curve with confidence intervals Question: I am able to get a ROC curve using scikit-learn with fpr, tpr, thresholds = metrics.roc_curve(y_true,y_pred, pos_label=1), where y_true is a list of values based on my gold standard (i.e., 0 for negative and 1 for positive cases) and y_pred is a corresponding list of scores (e.g., …

Total answers: 2

Compute a confidence interval from sample data

Compute a confidence interval from sample data Question: I have sample data which I would like to compute a confidence interval for, assuming a normal distribution. I have found and installed the numpy and scipy packages and have gotten numpy to return a mean and standard deviation (numpy.mean(data) with data being a list). Any advice …

Total answers: 6