Home > other >  Statsmodel do time series analysis, pacf result is not correct
Statsmodel do time series analysis, pacf result is not correct

Time:10-01

Compile environment:
Python3.6.6 win64

Statsmodels library file:
Statsmodels 0.9.0 - cp36 cp36m - win_amd64

Runtime always prompt:
. \ python36 \ lib \ site - packages \ statsmodels \ regression \ linear_model py: 1283: RuntimeWarning: invalid value encountered in SQRT 
Return rho, np. SQRT (sigmasq)


Output of pacf graphics is also far from correct, and error code as follows, accurate figure below

 import pandas as pd 
The import numpy as np
The import matplotlib. Pyplot as PLT
The from statsmodels. Graphics. Tsaplots import plot_acf, plot_pacf

Dta=[10930103 18105 95109 72770 6675 6909 2105 51972 2109 13111 51818 6642 2,
6337116 49116 52103 10120 43793 7647 6966 2957 0998 1933 1944 9677 3630 4935,
10477101 48103 95112 61871 3729 9104 24107 95110 69116 02114 27909 5770 7107 67,
12136128 12120 06125 28103 29781 8117 19116 83126 03114 95136 70113 37102, 32,
13261132 30155 35168 37195 98148 23116 22193 91181 77199 94147 23156 94132, 48,
9543128 72131 01150 53126 19137 49102 28972 5147 29125 18145 64150 85147 22,
11999939 0134 81147 95158 45152 71146 86110 54103 95]
Dta_list=np. Arange (2001209 1)
data=https://bbs.csdn.net/topics/pd.DataFrame (dta, index=dta_list)
PLT. Figure
Data. The plot ()
PLT. The show ()

D_data=https://bbs.csdn.net/topics/data.diff (1). Dropna ()
D_data. The plot ()
PLT. The show ()

Plot_acf (D_data.) the show ()
Plot_pacf (D_data.) the show ()


CodePudding user response:

Could you tell me how to solve the building Lord, I also met the same problem,

CodePudding user response:

Brothers, I solved, calculation method is added in the function plot_pacf='ywm'

CodePudding user response:

Excuse me how to solve this problem?? Know urgently?
  • Related