本文整理汇总了Python中statsmodels.api.qqplot方法的典型用法代码示例。如果您正苦于以下问题:Python api.qqplot方法的具体用法?Python api.qqplot怎么用?Python api.qqplot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类statsmodels.api
的用法示例。
在下文中一共展示了api.qqplot方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_qqplot
# 需要导入模块: from statsmodels import api [as 别名]
# 或者: from statsmodels.api import qqplot [as 别名]
def test_qqplot(self):
self.fig = self.prbplt.qqplot(ax=self.ax, line=self.line)
示例2: test_qqplot_other_array
# 需要导入模块: from statsmodels import api [as 别名]
# 或者: from statsmodels.api import qqplot [as 别名]
def test_qqplot_other_array(self):
self.fig = self.prbplt.qqplot(ax=self.ax, line=self.line,
other=self.other_array)
示例3: test_qqplot_other_prbplt
# 需要导入模块: from statsmodels import api [as 别名]
# 或者: from statsmodels.api import qqplot [as 别名]
def test_qqplot_other_prbplt(self):
self.fig = self.prbplt.qqplot(ax=self.ax, line=self.line,
other=self.other_prbplot)
示例4: test_qqplot_custom_labels
# 需要导入模块: from statsmodels import api [as 别名]
# 或者: from statsmodels.api import qqplot [as 别名]
def test_qqplot_custom_labels(self):
self.fig = self.prbplt.qqplot(ax=self.ax, line=self.line,
xlabel='Custom X-Label',
ylabel='Custom Y-Label')
示例5: test_qqplot_pltkwargs
# 需要导入模块: from statsmodels import api [as 别名]
# 或者: from statsmodels.api import qqplot [as 别名]
def test_qqplot_pltkwargs(self):
self.fig = self.prbplt.qqplot(ax=self.ax, line=self.line,
marker='d',
markerfacecolor='cornflowerblue',
markeredgecolor='white',
alpha=0.5)
示例6: plot_qq
# 需要导入模块: from statsmodels import api [as 别名]
# 或者: from statsmodels.api import qqplot [as 别名]
def plot_qq(model: SklearnModel, ax=None) -> None:
if ax is None:
_, ax = plt.subplots(1, 1)
residuals = model.residuals(model.data.X.values)
sm.qqplot(residuals, fit=True, line="45", ax=ax)
ax.set_title("QQ plot")
return ax
示例7: plot
# 需要导入模块: from statsmodels import api [as 别名]
# 或者: from statsmodels.api import qqplot [as 别名]
def plot(self, ticker):
self.setting()
fig = plt.figure(tight_layout=True)
ax1 = fig.add_subplot(5, 2, 1)
ax2 = fig.add_subplot(5, 2, 2)
ax3 = fig.add_subplot(5, 2, 3)
ax4 = fig.add_subplot(5, 2, 4)
ax5 = fig.add_subplot(5, 2, 5)
ax6 = fig.add_subplot(5, 2, 6)
ax7 = fig.add_subplot(5, 2, 7)
ax8 = fig.add_subplot(5, 2, 8)
ax9 = fig.add_subplot(5, 2, 9)
ax10 = fig.add_subplot(5, 2, 10)
# 左边
self.close_df(ticker).plot(ax=ax1, sharex=ax5)
self.balance_df.plot(ax=ax3)
self.cash_df.plot(ax=ax5, sharex=ax5)
analysis.get_drawdown_df(self.balance_df).plot(ax=ax9, sharex=ax5)
holding_pnl = self.env.recorder.holding_pnl.single_dataframe()
holding_pnl.rename(columns=dict(
value=f'holding_pnl'), inplace=True)
holding_pnl.plot(ax=ax7, sharex=ax5)
# for i in self.holding_pnl_df:
# i.plot(ax=ax7, sharex=ax5)
# 右边
market_value = self.env.recorder.market_value.single_dataframe()
market_value.rename(columns=dict(
value=f'market_value'), inplace=True)
market_value.plot(ax=ax2, sharex=ax5)
margin = self.env.recorder.margin.single_dataframe()
margin.rename(columns=dict(
value=f'margin'), inplace=True)
margin.plot(ax=ax4, sharex=ax5)
# for i in self.positions_df:
# i.plot(ax=ax2, sharex=ax5)
# for i in self.margin_df:
# i.plot(ax=ax4, sharex=ax5)
self.realized_pnl_df.plot(ax=ax6, sharex=ax5, kind='bar')
sm.qqplot(self.returns_df['returns'],
dist='norm', line='s', ax=ax8, marker='.')
self.returns_df[self.returns_df != 0].hist(bins=100, ax=ax10)
MultiCursor(fig.canvas, (ax1, ax2, ax3, ax4, ax5, ax6,
ax7, ax9), color='r', lw=1)
plt.show()
示例8: plot_A_share
# 需要导入模块: from statsmodels import api [as 别名]
# 或者: from statsmodels.api import qqplot [as 别名]
def plot_A_share(self, ticker):
self.setting()
fig = plt.figure(tight_layout=True)
ax1 = fig.add_subplot(5, 2, 1)
ax2 = fig.add_subplot(5, 2, 2)
ax3 = fig.add_subplot(5, 2, 3)
ax4 = fig.add_subplot(5, 2, 4)
ax5 = fig.add_subplot(5, 2, 5)
ax6 = fig.add_subplot(5, 2, 6)
ax7 = fig.add_subplot(5, 2, 7)
ax8 = fig.add_subplot(5, 2, 8)
ax9 = fig.add_subplot(5, 2, 9)
ax10 = fig.add_subplot(5, 2, 10)
# 左边
self.close_df(ticker).plot(ax=ax1, sharex=ax5)
self.balance_df.plot(ax=ax3)
self.cash_df.plot(ax=ax5, sharex=ax5)
analysis.get_drawdown_df(self.balance_df).plot(ax=ax9, sharex=ax5)
holding_pnl = self.env.recorder.holding_pnl.single_dataframe()
holding_pnl.rename(columns=dict(
value=f'holding_pnl'), inplace=True)
holding_pnl.plot(ax=ax7, sharex=ax5)
# for i in self.holding_pnl_df:
# i.plot(ax=ax7, sharex=ax5)
# 右边
market_value = self.env.recorder.market_value.single_dataframe()
market_value.rename(columns=dict(
value=f'market_value'), inplace=True)
market_value.plot(ax=ax2, sharex=ax5)
margin = self.env.recorder.margin.single_dataframe()
margin.rename(columns=dict(
value=f'margin'), inplace=True)
margin.plot(ax=ax4, sharex=ax5)
# for i in self.positions_df:
# i.plot(ax=ax2, sharex=ax5)
# for i in self.margin_df:
# i.plot(ax=ax4, sharex=ax5)
self.realized_pnl_df.plot(ax=ax6, sharex=ax5, kind='bar')
sm.qqplot(self.returns_df['returns'],
dist='norm', line='s', ax=ax8, marker='.')
self.returns_df[self.returns_df != 0].hist(bins=100, ax=ax10)
MultiCursor(fig.canvas, (ax1, ax2, ax3, ax4, ax5, ax6,
ax7, ax9), color='r', lw=1)
plt.show()