Пример #1
0
samples = numpy.array([xt, yt, εt])

comparison_plot(title, samples, labels, plot_name)

# %%

title = f"ECM Simulation, " + r"$\phi=$" + f"{numpy.array2string(arima_params['φ'], precision=2, separator=',')}, " + r"$\lambda=$" + f"{format(ecm_params['λ'], '2.2f')}, " + r"$\beta=$" + f"{format(ecm_params['β'], '2.2f')}, " + r"$\gamma=$" + f"{format(ecm_params['γ'], '2.2f')}, " + r"$\sigma=$" + f"{format(ecm_params['σ'], '2.2f')}"
plot_name = f"cointegration_ecm_simulation_residual{image_postfix}"
labels = [r"$\varepsilon_t = y_{t}-\hat{\alpha}-\hat{\beta}x_{t}$"]
samples = numpy.array([εt])

comparison_plot(title, samples, labels, plot_name)

# %%

arima.adf_report(εt)

# %%

title = f"ECM Simulation, " + r"$\phi=$" + f"{numpy.array2string(arima_params['φ'], precision=2, separator=',')}, " + r"$\lambda=$" + f"{format(ecm_params['λ'], '2.2f')}, " + r"$\beta=$" + f"{format(ecm_params['β'], '2.2f')}, " + r"$\gamma=$" + f"{format(ecm_params['γ'], '2.2f')}, " + r"$\sigma=$" + f"{format(ecm_params['σ'], '2.2f')}"
plot_name = f"cointegration_ecm_simulation_acf_pacf{image_postfix}"
max_lag = 15
ylim = [-0.5, 1.1]
arima.acf_pcf_plot(title, εt, ylim, max_lag, plot_name)

# %%

model_fit = arima.arma_estimate_parameters(εt, (1, 0))
print(model_fit.summary())

# %%
Пример #2
0
# %%

samples = numpy.array([arima1[:n-1], darima1])
title = "ARIMA(1,1,0) Comparison: " + r"$\phi=$"+f"{numpy.array2string(φ1, precision=2, separator=',')}, " + r"$\delta=$"+f"{numpy.array2string(δ1, precision=2, separator=',')}"
plot_name = "aima_estimation_1_1_0"
ylables = [r"$x_t$", r"$\Delta x_t$"]
timeseries_comparison_plot(samples, 500, title, ylables, plot_name)

# %%

model_fit = arima.arima_estimate_parameters(arima1, (1, 1, 0))
print(model_fit.summary())

# %%

arima.adf_report(arima1)

# %%

arima.adf_report(darima1)


# %%

model_fit = arima.arma_estimate_parameters(darima1, (1, 0))
print(model_fit.summary())

# %%

title = r"ARIMA(1,1,0) $\Delta x_t$ ACF-PACF Comparison: " + r"$\phi=$"+f"{numpy.array2string(φ1, precision=2, separator=',')}, " + r"$\delta=$"+f"{numpy.array2string(δ1, precision=2, separator=',')}"
plot_name = "aima_estimation_1_1_0_pacf_acf_Δx_comparison"