Skip to content
Menu
CDhistory
CDhistory

ARIMAX models¶

Posted on 6月 18, 2021 by admin

Class Description¶

class ARIMAX(data, formula, ar, ma, integ, target, family)¶

Autoregressive Integrated Moving Average Exogenous Variable Models (ARIMAX) の略です。

パラメータ タイプ 説明
data pd.DataFrame or np.DataFrame pd.DataFrame or np.DataFrame data data pd.DataFrame or np.DataFramendarray 一変量時系列を含む
formula string 回帰を指定するPatsy表記
ar int The 自己回帰ラグの数
ma int 移動平均ラグの数
integ int 何回データの差をとるか(デフォルト: 0)
target string or int DataFrame/array のどの列を使用するかを指定します。
family pf.Family instance 時系列の分布、例えば pf.Normal()

Attributes

latent_variables¶

A pf.Family

family

pf.Family instance

時系列の分布を表す。LatentVariables() オブジェクトで、モデルの潜在変数、事前設定、任意のフィット値、開始値、その他の潜在変数に関する情報を含んでいます。 このオブジェクト内の属性や、潜在変数情報にアクセスするためのメソッドについては、潜在変数に関するドキュメントを参照してください。 潜在変数とそのインデックスは、モデルインスタンスに付けられたlatent_variables属性を表示することで確認することができます。

Parameter Type Description
index int Indx of the latent variable to change
prior pf.Pf.Family instance 先行分布、例:pf.Normal()

Returns: void – changes the model latent_variables attribute

fit(method, **kwargs)¶

モデルに対する潜在変数を推定している。

Description

パラメータ タイプ 説明
method str Inference option: e.g. Parameter Type Method 推定値latent_variables属性latent_variablesを更新する。例:’M-H’ または ‘MLE’

推論オプションの全リストは、ドキュメントのベイズ推論および古典的推論のセクションを参照してください。

Returns: pf.Results instance with information for the estimated latent variables

plot_fit(**kwargs)¶

Plot the fit of the model against the data.選択した推測の特定のモードに関連するオプションのパラメータを入力することができる。

Returns : void – matplotlib plot

plot_ppc(T, nsims)¶

ユーザーが選択した不一致度指標で事後予測チェックのヒストグラムをプロットする。 この方法は、ベイズ推定を使用してフィッティングした場合のみ機能します。

パラメータ タイプ 説明
T 関数 矛盾、例:Discrepancy np.mean または np.max
nsims int PPC

のシミュレーション数 を返しました。 void – matplotlib plot

plot_predict(h, oos_data, past_values, intervals, **kwargs)¶

モデルの予測値を間隔とともにプロットします。

パラメータ タイプ 説明
h int 何段階先に予測するか
oos_data pd.DataFrame 外生変数をhステップのフレームに格納
past_values int 過去のデータポイント数 to plot
intervals boolean 間隔をプロットするかどうか

はっきり言ってしまえば。 oos_data 引数は、モデルインスタンスを初期化するために使用される initialdataframe と同じフォーマットの DataFrame でなければなりません。 その理由は、将来の値を予測するためには、将来の外生変数に関する仮定を指定する必要があるからである。 たとえば、h ステップ先を予測する場合、このメソッドは oos_data から h 個の最初の行を取り、patsy 式で求めた外因性変数の値を取得します。

オプションの引数には figsize – プロットする図の寸法が含まれます。 最尤法または変分推論を使用する場合、示された区間は潜在的変数の不確実性を反映しないことに注意してください。 メトロポリス・ヘイスティングスだけが、完全にベイズ予測区間を与える。

Returns : void – matplotlib plot

plot_predict_is(h, fit_once, fit_method, **kwargs)¶

モデルのサンプル内ローリング予測値をプロットする. これは、ユーザーがデータの最後のサブセクションをサンプル外であると仮定し、各期間後に予測し、それらがどの程度うまくいったかを評価することを意味する。 ユーザーは、パラメータを最初に1回、または時間ステップごとに適合させるかどうかを選択することができます。

一度だけ合わせるかどうか。 or every timestep

パラメータ タイプ 説明
h int 何回前のタイムステップを使うか
fit_once boolean
fit_method str どの推論オプションか、例.h は何ステップ前の性能をシミュレートするかの int 値です。

Returns : void – matplotlib plot

plot_sample(nsims, plot_data=True)¶

モデルの事後予測密度からサンプルをプロットします。 この方法は、ベイズ推論を使用してモデルを適合させた場合のみ機能します。

パラメータ タイプ 説明
nsims int How many 描画するサンプル数
plot_data boolean 実データも描画するかどうか

Returns : void – matplotlib plot

plot_z(indices, figsize)¶

潜在変数とそれに関連する不確定要素のプロットを返す。

パラメータ タイプ 説明
インデックス int or list どのような plot
figsize tuple matplotlib図のサイズ

Returns : void – matplotlib plot

ppc(T, nsims)¶

Posterior predictive check のための p-value を返します。 この方法は、ベイズ推定を使ってフィッティングした場合のみ有効です。

パラメータ タイプ 説明
T function 不一致、例…

Parameter Describenship799 np.mean または np.max
nsims int PPCのシミュレーション数

返される値です。 int – 不一致度検定のp値

predict(h, oos_data, intervals=False)¶

モデル予測値のDataFrameを返します。

predict(h)predict(interval=False)DataFrame

パラメータ タイプ 説明
h int 何段階先に予測するか
oos_data pd.D hステップのフレーム内の外生変数
間隔 予測間隔を返すかどうか

はっきり言って、oos_data引数はモデルインスタンスの初期化に使われたinitialdataframeと同じ形式のDataFrameにすべきです。 その理由は、将来の値を予測するためには、将来の外生変数に関する仮定を指定する必要があるからです。 例えば、h ステップ先を予測する場合、このメソッドは oos_data から 5 つの最初の行を取り、patsy 式で外生変数として指定した外生変数の値を取ります。

最尤法または変分推論を使用する場合、示される区間が潜在変数の不確実性を反映しないことに注意してください。 メトロポリス・ヘイスティングスだけが完全にベイズ的な予測区間を提供します。

Returns : pd.DataFrame – the model predictions

predict_is(h, fit_once, fit_method)¶

Returns DataFrame of in-sample rolling predictions for the model.

一度だけ合わせるかどうか。 or every timestep

Parameter Type Description
h int 何回前のタイムステップを使うか
fit_once boolean
fit_method str どの推論オプションか、例.例えば ‘MLE’

Returns : pd.DataFrame – the model predictions

sample(nsims)¶

Returns np.ndarray of draws of the data from the posterior predictive density.pdは、モデルの予測値から、データを抽出した配列です。 この方法は、ベイズ推論を使用してモデルを適合させた場合のみ機能します。

パラメータ タイプ 説明
nsims int How many posterior draws to take

戻り値 : np.δ督譜。ndarray – 事後予測密度からのサンプル数

。

コメントを残す コメントをキャンセル

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

最近の投稿

  • アセラ復活。 NYCまたはボストンで99ドル
  • OMIM Entry – # 608363 – CHROMOSOME 22q11.2 DUPLICATION SYNDROME
  • Kate Albrecht’s Parents – Learn More About Her Father Chris Albrecht And Mother Annie Albrecht
  • テンプル・フォーク・アウトフィッターズ
  • Burr(小説)

アーカイブ

  • 2022年2月
  • 2022年1月
  • 2021年12月
  • 2021年11月
  • 2021年10月
  • 2021年9月
  • 2021年8月
  • 2021年7月
  • 2021年6月
  • 2021年5月
  • 2021年4月
  • DeutschDeutsch
  • NederlandsNederlands
  • SvenskaSvenska
  • DanskDansk
  • EspañolEspañol
  • FrançaisFrançais
  • PortuguêsPortuguês
  • ItalianoItaliano
  • RomânăRomână
  • PolskiPolski
  • ČeštinaČeština
  • MagyarMagyar
  • SuomiSuomi
  • 日本語日本語
©2022 CDhistory | Powered by WordPress & Superb Themes