Beispiel #1
0
          -0.029952  , -0.0229632 , -0.01837056, -0.01515571, -0.01279816,
          -0.01100641, -0.0096056 , -0.00848495, -0.00757118, -0.00681406,
          -0.00617808, -0.0056375 , -0.00517324, -0.00477087, -0.00441934,
          -0.00410998, -0.00383598, -0.00359188, -0.00337324, -0.00317647,
          -0.00299859, -0.00283712, -0.00269001, -0.00255551, -0.00243214,
          -0.00231864])
    >>> # verified for points [[5,10,20,25]] at 4 decimals with Bhardwaj, Swanson, Journal of Eonometrics 2006
    '''
    print(lpol_fiar(0.4, n=20))
    print(lpol_fima(-0.4, n=20))
    print(np.sum((lpol_fima(-0.4, n=n)[1:] + riinv[1:])**2))  #different signs
    print(np.sum((lpol_fiar(0.4, n=n)[1:] - riinv[1:])**2))  #corrected signs

    #test is now in statsmodels.tsa.tests.test_arima_process
    from statsmodels.tsa.tests.test_arima_process import test_fi
    test_fi()

    ar_true = [1, -0.4]
    ma_true = [1, 0.5]

    ar_desired = arma_impulse_response(ma_true, ar_true)
    ar_app, ma_app, res = ar2arma(ar_desired,
                                  2,
                                  1,
                                  n=100,
                                  mse='ar',
                                  start=[0.1])
    print(ar_app, ma_app)
    ar_app, ma_app, res = ar2arma(ar_desired,
                                  2,
                                  2,
Beispiel #2
0
          -0.029952  , -0.0229632 , -0.01837056, -0.01515571, -0.01279816,
          -0.01100641, -0.0096056 , -0.00848495, -0.00757118, -0.00681406,
          -0.00617808, -0.0056375 , -0.00517324, -0.00477087, -0.00441934,
          -0.00410998, -0.00383598, -0.00359188, -0.00337324, -0.00317647,
          -0.00299859, -0.00283712, -0.00269001, -0.00255551, -0.00243214,
          -0.00231864])
    >>> # verified for points [[5,10,20,25]] at 4 decimals with Bhardwaj, Swanson, Journal of Eonometrics 2006
    '''
    print(lpol_fiar(0.4, n=20))
    print(lpol_fima(-0.4, n=20))
    print(np.sum((lpol_fima(-0.4, n=n)[1:] + riinv[1:])**2)) #different signs
    print(np.sum((lpol_fiar(0.4, n=n)[1:] - riinv[1:])**2)) #corrected signs

    #test is now in statsmodels.tsa.tests.test_arima_process
    from statsmodels.tsa.tests.test_arima_process import test_fi
    test_fi()

    ar_true = [1, -0.4]
    ma_true = [1, 0.5]


    ar_desired = arma_impulse_response(ma_true, ar_true)
    ar_app, ma_app, res = ar2arma(ar_desired, 2,1, n=100, mse='ar', start=[0.1])
    print(ar_app, ma_app)
    ar_app, ma_app, res = ar2arma(ar_desired, 2,2, n=100, mse='ar', start=[-0.1, 0.1])
    print(ar_app, ma_app)
    ar_app, ma_app, res = ar2arma(ar_desired, 2,3, n=100, mse='ar')#, start = [-0.1, 0.1])
    print(ar_app, ma_app)

    slow = 1
    if slow: