當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。