当前位置: 首页>>代码示例>>Python>>正文


Python api.qqplot方法代码示例

本文整理汇总了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) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:4,代码来源:test_gofplots.py

示例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) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:5,代码来源:test_gofplots.py

示例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) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:5,代码来源:test_gofplots.py

示例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') 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:6,代码来源:test_gofplots.py

示例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) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:8,代码来源:test_gofplots.py

示例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 
开发者ID:JakeColtman,项目名称:bartpy,代码行数:9,代码来源:residuals.py

示例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() 
开发者ID:Chandlercjy,项目名称:OnePy,代码行数:61,代码来源:by_matplotlib.py

示例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() 
开发者ID:Chandlercjy,项目名称:OnePy,代码行数:61,代码来源:by_matplotlib.py


注:本文中的statsmodels.api.qqplot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。