Esempio n. 1
0
        self.irregular.plot(ax=axes[3], legend=False)
        axes[3].set_ylabel('Irregular')

        fig.tight_layout()
        return fig


if __name__ == "__main__":
    import numpy as np
    from statsmodels.tsa.arima_process import ArmaProcess
    np.random.seed(123)
    ar = [1, .35, .8]
    ma = [1, .8]
    arma = ArmaProcess(ar, ma, nobs=100)
    assert arma.isstationary()
    assert arma.isinvertible()
    y = arma.generate_sample()
    dates = pd.date_range("1/1/1990", periods=len(y), freq='M')
    ts = pd.Series(y, index=dates)

    xpath = "/home/skipper/src/x12arima/x12a"

    try:
        results = x13_arima_analysis(xpath, ts)
    except:
        print("Caught exception")

    results = x13_arima_analysis(xpath, ts, log=False)

    # import pandas as pd
    # seas_y = pd.read_csv("usmelec.csv")
Esempio n. 2
0
np.random.seed(1234)
# include zero-th lag
arparams = np.array([1, .75, -.65, -.55, .9])
maparams = np.array([1, .65])

# <markdowncell>

# * Let's make sure this models is estimable.

# <codecell>

arma_t = ArmaProcess(arparams, maparams)

# <codecell>

arma_t.isinvertible()

# <codecell>

arma_t.isstationary()

# <rawcell>

# * What does this mean?

# <codecell>

fig = plt.figure(figsize=(12,8))
ax = fig.add_subplot(111)
ax.plot(arma_t.generate_sample(size=50));
Esempio n. 3
0
        self.irregular.plot(ax=axes[3], legend=False)
        axes[3].set_ylabel('Irregular')

        fig.tight_layout()
        return fig


if __name__ == "__main__":
    import numpy as np
    from statsmodels.tsa.arima_process import ArmaProcess
    np.random.seed(123)
    ar = [1, .35, .8]
    ma = [1, .8]
    arma = ArmaProcess(ar, ma, nobs=100)
    assert arma.isstationary()
    assert arma.isinvertible()
    y = arma.generate_sample()
    dates = pd.date_range("1/1/1990", periods=len(y), freq='M')
    ts = pd.TimeSeries(y, index=dates)

    xpath = "/home/skipper/src/x12arima/x12a"

    try:
        results = x13_arima_analysis(xpath, ts)
    except:
        print("Caught exception")

    results = x13_arima_analysis(xpath, ts, log=False)

    # import pandas as pd
    # seas_y = pd.read_csv("usmelec.csv")