'SARIMAXResults' object has no attribute '_params_ma










0














I am trying to creat a Seasonal ARIMA model by using the class statsmodels.statespace.sarimax.SARIMA, and the model seems to be well created.
The JPEG of SARIMA Model summary



Now, I want to pass the AR coefficents and MA coefficents to variables seperately, but it appear a error that: SARIMAXResults object has no attribute _params_ma.
The JPEG of error



What should I do to correct the error?










share|improve this question























  • I have a new problem now. After the model is fitted, I tried to use SARIMAXResults.cov_params to get the correlation matrix of parameter estimates, but on jupyter notebook, it only shows me <bound method LikelihoodModelResults.cov_params of <statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper object at 0x000002252A63C278>>, it seems the process suceed to a calculate a matrix as a result, but why it can't be shown?
    – Wei CHEN
    Nov 2 '18 at 8:36















0














I am trying to creat a Seasonal ARIMA model by using the class statsmodels.statespace.sarimax.SARIMA, and the model seems to be well created.
The JPEG of SARIMA Model summary



Now, I want to pass the AR coefficents and MA coefficents to variables seperately, but it appear a error that: SARIMAXResults object has no attribute _params_ma.
The JPEG of error



What should I do to correct the error?










share|improve this question























  • I have a new problem now. After the model is fitted, I tried to use SARIMAXResults.cov_params to get the correlation matrix of parameter estimates, but on jupyter notebook, it only shows me <bound method LikelihoodModelResults.cov_params of <statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper object at 0x000002252A63C278>>, it seems the process suceed to a calculate a matrix as a result, but why it can't be shown?
    – Wei CHEN
    Nov 2 '18 at 8:36













0












0








0







I am trying to creat a Seasonal ARIMA model by using the class statsmodels.statespace.sarimax.SARIMA, and the model seems to be well created.
The JPEG of SARIMA Model summary



Now, I want to pass the AR coefficents and MA coefficents to variables seperately, but it appear a error that: SARIMAXResults object has no attribute _params_ma.
The JPEG of error



What should I do to correct the error?










share|improve this question















I am trying to creat a Seasonal ARIMA model by using the class statsmodels.statespace.sarimax.SARIMA, and the model seems to be well created.
The JPEG of SARIMA Model summary



Now, I want to pass the AR coefficents and MA coefficents to variables seperately, but it appear a error that: SARIMAXResults object has no attribute _params_ma.
The JPEG of error



What should I do to correct the error?







python time-series statsmodels state-space






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 31 '18 at 9:49









Bruno

1,1011618




1,1011618










asked Oct 31 '18 at 8:44









Wei CHENWei CHEN

12




12











  • I have a new problem now. After the model is fitted, I tried to use SARIMAXResults.cov_params to get the correlation matrix of parameter estimates, but on jupyter notebook, it only shows me <bound method LikelihoodModelResults.cov_params of <statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper object at 0x000002252A63C278>>, it seems the process suceed to a calculate a matrix as a result, but why it can't be shown?
    – Wei CHEN
    Nov 2 '18 at 8:36
















  • I have a new problem now. After the model is fitted, I tried to use SARIMAXResults.cov_params to get the correlation matrix of parameter estimates, but on jupyter notebook, it only shows me <bound method LikelihoodModelResults.cov_params of <statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper object at 0x000002252A63C278>>, it seems the process suceed to a calculate a matrix as a result, but why it can't be shown?
    – Wei CHEN
    Nov 2 '18 at 8:36















I have a new problem now. After the model is fitted, I tried to use SARIMAXResults.cov_params to get the correlation matrix of parameter estimates, but on jupyter notebook, it only shows me <bound method LikelihoodModelResults.cov_params of <statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper object at 0x000002252A63C278>>, it seems the process suceed to a calculate a matrix as a result, but why it can't be shown?
– Wei CHEN
Nov 2 '18 at 8:36




I have a new problem now. After the model is fitted, I tried to use SARIMAXResults.cov_params to get the correlation matrix of parameter estimates, but on jupyter notebook, it only shows me <bound method LikelihoodModelResults.cov_params of <statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper object at 0x000002252A63C278>>, it seems the process suceed to a calculate a matrix as a result, but why it can't be shown?
– Wei CHEN
Nov 2 '18 at 8:36












2 Answers
2






active

oldest

votes


















0














Finnaly, I find it was my own fault.



Following my SARIMA(2,0,0)X(0,0,1,12) model, the non-seasonal element has orders(p,d,q)=(2,0,0), and the seasonal element has orders (P,D,Q,s)=(0,0,1,12). Thus, the model says that the data has a nonseasonal AR(2) pattern, and a seasonal MA(1)_12 pattern.
As a result, the coefficient of nonseasonal MA pattern which is corresponding to SARIMAXResults.maparams will not be estimated. By contrast, the coefficient of seasonal MA partter which is corresponding to SARIMAXResults.seasonalmaparams will be estimated.



For purpose of getting estimated coefficient value of seasonal MA pattern, I should call seasonalmaparams() method, instead of maparams().



The error problem is solved now. :D






share|improve this answer






























    0














    Well, after seeing the soure code, the other propblem added in the comment is also solved.



    Actually, the parenthesis should be added to call the attribute of SARIMAXResults, so cov_params() will show the covariance-variance matrix, as following:
    cov_params matrix



    Next, for sake of calculating the correlation matrix of parameters, I coded as following:



    # Step1: Pass the covariance-variance matrix to a specified DataFrame
    df_cov = final_result.cov_params()
    # Step2: Creat a blank DataFrame which will be used to store correlation values
    coef_name = [r'$b_1$',r'$b_2$',r'$theta_1$',r'$phi_12$',r'$phi_24$']
    cor_df = pd.DataFrame(index=coef_name,columns=coef_name)
    cor_df.loc[:,:]=''
    # Step3: Loop the covariance-variance matrix and calculate the correlation
    var=[0]*5
    for i in range(5):
    var[i] = df_cov.iloc[i,i]
    for i in range(5):
    for j in range(5):
    if j<=i:
    corvar = df_cov.iloc[i,j]
    cor = corvar/np.sqrt(var[i]*var[j])
    cor_df.iloc[i,j] = round(cor,2)
    else:
    continue
    # Step4: Show the correlation matrix(as type of DataFrame)
    cor_df


    Finally, the correlaton matrix is well calculated as shown as below:
    correlation matrix



    Thanks for your attention, no more question now.






    share|improve this answer




















      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53079394%2fsarimaxresults-object-has-no-attribute-params-ma%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Finnaly, I find it was my own fault.



      Following my SARIMA(2,0,0)X(0,0,1,12) model, the non-seasonal element has orders(p,d,q)=(2,0,0), and the seasonal element has orders (P,D,Q,s)=(0,0,1,12). Thus, the model says that the data has a nonseasonal AR(2) pattern, and a seasonal MA(1)_12 pattern.
      As a result, the coefficient of nonseasonal MA pattern which is corresponding to SARIMAXResults.maparams will not be estimated. By contrast, the coefficient of seasonal MA partter which is corresponding to SARIMAXResults.seasonalmaparams will be estimated.



      For purpose of getting estimated coefficient value of seasonal MA pattern, I should call seasonalmaparams() method, instead of maparams().



      The error problem is solved now. :D






      share|improve this answer



























        0














        Finnaly, I find it was my own fault.



        Following my SARIMA(2,0,0)X(0,0,1,12) model, the non-seasonal element has orders(p,d,q)=(2,0,0), and the seasonal element has orders (P,D,Q,s)=(0,0,1,12). Thus, the model says that the data has a nonseasonal AR(2) pattern, and a seasonal MA(1)_12 pattern.
        As a result, the coefficient of nonseasonal MA pattern which is corresponding to SARIMAXResults.maparams will not be estimated. By contrast, the coefficient of seasonal MA partter which is corresponding to SARIMAXResults.seasonalmaparams will be estimated.



        For purpose of getting estimated coefficient value of seasonal MA pattern, I should call seasonalmaparams() method, instead of maparams().



        The error problem is solved now. :D






        share|improve this answer

























          0












          0








          0






          Finnaly, I find it was my own fault.



          Following my SARIMA(2,0,0)X(0,0,1,12) model, the non-seasonal element has orders(p,d,q)=(2,0,0), and the seasonal element has orders (P,D,Q,s)=(0,0,1,12). Thus, the model says that the data has a nonseasonal AR(2) pattern, and a seasonal MA(1)_12 pattern.
          As a result, the coefficient of nonseasonal MA pattern which is corresponding to SARIMAXResults.maparams will not be estimated. By contrast, the coefficient of seasonal MA partter which is corresponding to SARIMAXResults.seasonalmaparams will be estimated.



          For purpose of getting estimated coefficient value of seasonal MA pattern, I should call seasonalmaparams() method, instead of maparams().



          The error problem is solved now. :D






          share|improve this answer














          Finnaly, I find it was my own fault.



          Following my SARIMA(2,0,0)X(0,0,1,12) model, the non-seasonal element has orders(p,d,q)=(2,0,0), and the seasonal element has orders (P,D,Q,s)=(0,0,1,12). Thus, the model says that the data has a nonseasonal AR(2) pattern, and a seasonal MA(1)_12 pattern.
          As a result, the coefficient of nonseasonal MA pattern which is corresponding to SARIMAXResults.maparams will not be estimated. By contrast, the coefficient of seasonal MA partter which is corresponding to SARIMAXResults.seasonalmaparams will be estimated.



          For purpose of getting estimated coefficient value of seasonal MA pattern, I should call seasonalmaparams() method, instead of maparams().



          The error problem is solved now. :D







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 1 '18 at 2:29

























          answered Nov 1 '18 at 2:18









          Wei CHENWei CHEN

          12




          12























              0














              Well, after seeing the soure code, the other propblem added in the comment is also solved.



              Actually, the parenthesis should be added to call the attribute of SARIMAXResults, so cov_params() will show the covariance-variance matrix, as following:
              cov_params matrix



              Next, for sake of calculating the correlation matrix of parameters, I coded as following:



              # Step1: Pass the covariance-variance matrix to a specified DataFrame
              df_cov = final_result.cov_params()
              # Step2: Creat a blank DataFrame which will be used to store correlation values
              coef_name = [r'$b_1$',r'$b_2$',r'$theta_1$',r'$phi_12$',r'$phi_24$']
              cor_df = pd.DataFrame(index=coef_name,columns=coef_name)
              cor_df.loc[:,:]=''
              # Step3: Loop the covariance-variance matrix and calculate the correlation
              var=[0]*5
              for i in range(5):
              var[i] = df_cov.iloc[i,i]
              for i in range(5):
              for j in range(5):
              if j<=i:
              corvar = df_cov.iloc[i,j]
              cor = corvar/np.sqrt(var[i]*var[j])
              cor_df.iloc[i,j] = round(cor,2)
              else:
              continue
              # Step4: Show the correlation matrix(as type of DataFrame)
              cor_df


              Finally, the correlaton matrix is well calculated as shown as below:
              correlation matrix



              Thanks for your attention, no more question now.






              share|improve this answer

























                0














                Well, after seeing the soure code, the other propblem added in the comment is also solved.



                Actually, the parenthesis should be added to call the attribute of SARIMAXResults, so cov_params() will show the covariance-variance matrix, as following:
                cov_params matrix



                Next, for sake of calculating the correlation matrix of parameters, I coded as following:



                # Step1: Pass the covariance-variance matrix to a specified DataFrame
                df_cov = final_result.cov_params()
                # Step2: Creat a blank DataFrame which will be used to store correlation values
                coef_name = [r'$b_1$',r'$b_2$',r'$theta_1$',r'$phi_12$',r'$phi_24$']
                cor_df = pd.DataFrame(index=coef_name,columns=coef_name)
                cor_df.loc[:,:]=''
                # Step3: Loop the covariance-variance matrix and calculate the correlation
                var=[0]*5
                for i in range(5):
                var[i] = df_cov.iloc[i,i]
                for i in range(5):
                for j in range(5):
                if j<=i:
                corvar = df_cov.iloc[i,j]
                cor = corvar/np.sqrt(var[i]*var[j])
                cor_df.iloc[i,j] = round(cor,2)
                else:
                continue
                # Step4: Show the correlation matrix(as type of DataFrame)
                cor_df


                Finally, the correlaton matrix is well calculated as shown as below:
                correlation matrix



                Thanks for your attention, no more question now.






                share|improve this answer























                  0












                  0








                  0






                  Well, after seeing the soure code, the other propblem added in the comment is also solved.



                  Actually, the parenthesis should be added to call the attribute of SARIMAXResults, so cov_params() will show the covariance-variance matrix, as following:
                  cov_params matrix



                  Next, for sake of calculating the correlation matrix of parameters, I coded as following:



                  # Step1: Pass the covariance-variance matrix to a specified DataFrame
                  df_cov = final_result.cov_params()
                  # Step2: Creat a blank DataFrame which will be used to store correlation values
                  coef_name = [r'$b_1$',r'$b_2$',r'$theta_1$',r'$phi_12$',r'$phi_24$']
                  cor_df = pd.DataFrame(index=coef_name,columns=coef_name)
                  cor_df.loc[:,:]=''
                  # Step3: Loop the covariance-variance matrix and calculate the correlation
                  var=[0]*5
                  for i in range(5):
                  var[i] = df_cov.iloc[i,i]
                  for i in range(5):
                  for j in range(5):
                  if j<=i:
                  corvar = df_cov.iloc[i,j]
                  cor = corvar/np.sqrt(var[i]*var[j])
                  cor_df.iloc[i,j] = round(cor,2)
                  else:
                  continue
                  # Step4: Show the correlation matrix(as type of DataFrame)
                  cor_df


                  Finally, the correlaton matrix is well calculated as shown as below:
                  correlation matrix



                  Thanks for your attention, no more question now.






                  share|improve this answer












                  Well, after seeing the soure code, the other propblem added in the comment is also solved.



                  Actually, the parenthesis should be added to call the attribute of SARIMAXResults, so cov_params() will show the covariance-variance matrix, as following:
                  cov_params matrix



                  Next, for sake of calculating the correlation matrix of parameters, I coded as following:



                  # Step1: Pass the covariance-variance matrix to a specified DataFrame
                  df_cov = final_result.cov_params()
                  # Step2: Creat a blank DataFrame which will be used to store correlation values
                  coef_name = [r'$b_1$',r'$b_2$',r'$theta_1$',r'$phi_12$',r'$phi_24$']
                  cor_df = pd.DataFrame(index=coef_name,columns=coef_name)
                  cor_df.loc[:,:]=''
                  # Step3: Loop the covariance-variance matrix and calculate the correlation
                  var=[0]*5
                  for i in range(5):
                  var[i] = df_cov.iloc[i,i]
                  for i in range(5):
                  for j in range(5):
                  if j<=i:
                  corvar = df_cov.iloc[i,j]
                  cor = corvar/np.sqrt(var[i]*var[j])
                  cor_df.iloc[i,j] = round(cor,2)
                  else:
                  continue
                  # Step4: Show the correlation matrix(as type of DataFrame)
                  cor_df


                  Finally, the correlaton matrix is well calculated as shown as below:
                  correlation matrix



                  Thanks for your attention, no more question now.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 12 '18 at 4:46









                  Wei CHENWei CHEN

                  12




                  12



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53079394%2fsarimaxresults-object-has-no-attribute-params-ma%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Use pre created SQLite database for Android project in kotlin

                      Darth Vader #20

                      Ondo