Disclosure of Invention
In view of this, the present invention provides a complaint prediction method and apparatus based on an ARMA model to improve the accuracy of complaint number prediction.
The invention provides a complaint prediction method based on an ARMA model, which comprises the following steps:
acquiring actual complaint quantity in a plurality of continuous time periods to form an original data sequence;
preprocessing the original data sequence to obtain a current data sequence;
determining an ARMA model function of predicting the complaint quantity corresponding to the next time period which is continuous with the continuous time periods according to the current data sequence;
and calculating the predicted complaint number of the next time period according to the ARMA model function.
Preferably, the first and second electrodes are formed of a metal,
further comprising: setting a modeling condition, wherein the modeling condition is that the original data sequence is a stable non-pure random data sequence;
the preprocessing the original data sequence to obtain a current data sequence includes:
checking the original data sequence, and if the checking result shows that the original data sequence meets the modeling condition, taking the original data sequence as a current data sequence; and if the verification result is that the original data sequence does not meet the modeling condition, performing differential operation on the original data sequence to obtain the current data sequence.
Preferably, the determining, according to the current data sequence, an ARMA model function of the predicted complaint quantity corresponding to the next time period consecutive to the plurality of consecutive time periods includes:
and determining an ARMA model function of the predicted complaint quantity corresponding to the next time period which is continuous with the plurality of continuous time periods according to the current data sequence as follows:
<math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
</mrow>
</math>
wherein,for the predicted number of complaints at time t, xt-p……xt-1Actual complaining numbers phi at the time t-p and … … t-1, respectively1、……、φpAre all the first unknown parameter, theta1、……、θqAre all of the second unknown parameters of the second,t-1、……、t-qrespectively, are random error terms at time t-1, … … and t-p.
Preferably, the first and second electrodes are formed of a metal,
further comprising: calculating a first unknown parameter in the ARMA model function according to the following operation mode: phi is a1、……、φp:
S1: order:
<math>
<mrow>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>-</mo>
<mover>
<mi>X</mi>
<mo>‾</mo>
</mover>
<mo>=</mo>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
calculating ar (p): <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mn>2</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
wherein x isiFor the actual number of complaints at time i,is the average of the actual complaint number;
s2: setting intermediate values l, Y, X and beta, and letting:
l=max(p,q);
<math>
<mrow>
<mi>Y</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>n</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
<math>
<mrow>
<mi>X</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
β1=(φ1,φ2,…φp);
s3: calculating beta1Is estimated by least squares of1=(XTX)-1XTY, solve for phi1、……、φp(ii) a Further comprising: calculating theta in ARMA model function according to the following operation mode1、……、θq(ii) a S4: order:
<math>
<mrow>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>-</mo>
<mover>
<mi>X</mi>
<mo>‾</mo>
</mover>
<mo>=</mo>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
calculating MA (q): <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>;</mo>
</mrow>
</math>
s5: and (3) calculating: <math>
<mrow>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>j</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>p</mi>
</munderover>
<msub>
<mi>φ</mi>
<mi>j</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>j</mi>
</mrow>
</msub>
<mo>,</mo>
<mi>t</mi>
<mo>=</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
<mo>,</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>,</mo>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
setting intermediate values l, Y, X and beta2Order:
l=max(p,q);
<math>
<mrow>
<mi>Y</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>n</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
<math>
<mrow>
<mi>ϵ</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
β2=(-θ1,-θ2,…,-θq);
s6: calculating beta2Is estimated by least squares of2=(T)-1 TY, solving for theta1、……、θq。
Further comprising: the target (p, q) is calculated according to the following operational scheme:
<math>
<mrow>
<mi>BIC</mi>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mi>n</mi>
<mi>ln</mi>
<mrow>
<mo>(</mo>
<msubsup>
<mover>
<mi>σ</mi>
<mo>^</mo>
</mover>
<mi>e</mi>
<mn>2</mn>
</msubsup>
<mo>)</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>+</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
<mi>ln</mi>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
wherein, <math>
<mrow>
<msubsup>
<mover>
<mi>σ</mi>
<mo>^</mo>
</mover>
<mi>e</mi>
<mn>2</mn>
</msubsup>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>-</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>+</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
</mrow>
</mfrac>
<mo>;</mo>
</mrow>
</math>
(p, q) for calculating the minimum BIC (p, q) value is taken as the target (p, q).
Preferably, prior to said predicting the number of complaints for the next of said plurality of consecutive time periods, further comprising:
performing a verification on the ARMA model function, the verification function comprising:
s7: computing <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mn>2</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>,</mo>
</mrow>
</math> T is more than or equal to max (p, q) and less than or equal to n; computing1≤t≤n;
S8: computingWherein, <math>
<mrow>
<msub>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<msub>
<mi>ϵ</mi>
<mi>k</mi>
</msub>
</msub>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</munderover>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>+</mo>
<mi>k</mi>
</mrow>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
</mrow>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
<mo>,</mo>
<mo>∀</mo>
<mn>1</mn>
<mo>≤</mo>
<mi>k</mi>
<mo>≤</mo>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
s9: obtaining an error sequence according to the LB statistic and the corresponding P value calculation formula in the pure randomness test processtThe corresponding P value;
<math>
<mrow>
<mi>LB</mi>
<mo>=</mo>
<mi>n</mi>
<mrow>
<mo>(</mo>
<mi>n</mi>
<mo>+</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>k</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>m</mi>
</munderover>
<mrow>
<mo>(</mo>
<mfrac>
<msubsup>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<msub>
<mi>ϵ</mi>
<mi>k</mi>
</msub>
<mn>2</mn>
</msubsup>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mo>;</mo>
</mrow>
</math>
<math>
<mrow>
<mi>P</mi>
<mo>=</mo>
<mn>1</mn>
<mo>-</mo>
<msubsup>
<mo>∫</mo>
<mn>0</mn>
<mi>LB</mi>
</msubsup>
<mi>f</mi>
<mrow>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
</mrow>
<mi>dx</mi>
<mo>;</mo>
</mrow>
</math>
at P >0.05, the test passes and the predicting of the number of complaints for the next of the plurality of consecutive time periods is performed.
The invention also provides a complaint prediction device based on the ARMA model, which comprises:
the device comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is used for acquiring the actual complaining number in a plurality of continuous time periods to form an original data sequence;
the preprocessing unit is used for preprocessing the original data sequence to obtain a current data sequence;
a determining unit, configured to determine, according to the current data sequence, an ARMA model function of the predicted complaint number corresponding to a next time period that is consecutive to the plurality of consecutive time periods;
and the calculating unit is used for calculating the predicted complaint quantity of the next time period according to the ARMA model function.
Preferably, the first and second electrodes are formed of a metal,
further comprising: the storage unit is used for storing a modeling condition, wherein the modeling condition is that the original data sequence is a stable non-pure random data sequence;
the preprocessing unit is used for verifying the original data sequence, and if the verification result shows that the original data sequence meets the modeling condition, the original data sequence is used as the current data sequence; and if the verification result is that the original data sequence does not meet the modeling condition, performing differential operation on the original data sequence to obtain the current data sequence.
Preferably, the determining unit is configured to determine, according to the current data sequence, an ARMA model function of the predicted complaint number corresponding to the next time segment that is consecutive to the plurality of consecutive time segments as follows:
<math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
</mrow>
</math>
wherein,for the predicted number of complaints at time t, xt-p……xt-1Actual complaining numbers phi at the time t-p and … … t-1, respectively1、……、φpAre all the first unknown parameter, theta1、……、θqAre all of the second unknown parameters of the second,t-1、……、t-qrespectively, are random error terms at time t-1, … … and t-p.
Preferably, the first and second electrodes are formed of a metal,
the calculating unit is used for calculating a first unknown parameter in the ARMA model function according to the following operation mode: phi is a1、……、φp:
S1: order:
<math>
<mrow>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>-</mo>
<mover>
<mi>X</mi>
<mo>‾</mo>
</mover>
<mo>=</mo>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
calculating ar (p): <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mn>2</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
wherein x isiFor the actual number of complaints at time i,is the average of the actual complaint number;
s2: setting intermediate values l, Y, X and beta, and letting:
l=max(p,q);
<math>
<mrow>
<mi>Y</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>n</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
<math>
<mrow>
<mi>X</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
β1=(φ1,φ2,…φp);
s3: calculating beta1Is estimated by least squares of1=(XTX)-1XTY, solve for phi1、……、φp(ii) a Further comprising: calculating theta in ARMA model function according to the following operation mode1、……、θq(ii) a S4: order:
<math>
<mrow>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>-</mo>
<mover>
<mi>X</mi>
<mo>‾</mo>
</mover>
<mo>=</mo>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
calculating MA (q): <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>;</mo>
</mrow>
</math>
s5: and (3) calculating: <math>
<mrow>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>j</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>p</mi>
</munderover>
<msub>
<mi>φ</mi>
<mi>j</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>j</mi>
</mrow>
</msub>
<mo>,</mo>
<mi>t</mi>
<mo>=</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
<mo>,</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>,</mo>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
setting intermediate values l, Y, X and beta2Order:
l=max(p,q);
<math>
<mrow>
<mi>Y</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>n</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
<math>
<mrow>
<mi>ϵ</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
β2=(-θ1,-θ2,…,-θq);
s6: calculating beta2Is estimated by least squares of2=(T)-1 TY, solving for theta1、……、θq. Further comprising: the target (p, q) is calculated according to the following operational scheme:
<math>
<mrow>
<mi>BIC</mi>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mi>n</mi>
<mi>ln</mi>
<mrow>
<mo>(</mo>
<msubsup>
<mover>
<mi>σ</mi>
<mo>^</mo>
</mover>
<mi>e</mi>
<mn>2</mn>
</msubsup>
<mo>)</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>+</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
<mi>ln</mi>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
wherein, <math>
<mrow>
<msubsup>
<mover>
<mi>σ</mi>
<mo>^</mo>
</mover>
<mi>e</mi>
<mn>2</mn>
</msubsup>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>-</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>+</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
</mrow>
</mfrac>
<mo>;</mo>
</mrow>
</math>
(p, q) for calculating the minimum BIC (p, q) value is taken as the target (p, q).
Preferably, further comprising:
a verification unit for verifying the ARMA model function, the verification function comprising:
s7: computing <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mn>2</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>,</mo>
</mrow>
</math> T is more than or equal to max (p, q) and less than or equal to n; computing1≤t≤n;
S8: computingWherein, <math>
<mrow>
<msub>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<msub>
<mi>ϵ</mi>
<mi>k</mi>
</msub>
</msub>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</munderover>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>+</mo>
<mi>k</mi>
</mrow>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
</mrow>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
<mo>,</mo>
<mo>∀</mo>
<mn>1</mn>
<mo>≤</mo>
<mi>k</mi>
<mo>≤</mo>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
s9: obtaining an error sequence according to the LB statistic and the corresponding P value calculation formula in the pure randomness test processtThe corresponding P value;
<math>
<mrow>
<mi>LB</mi>
<mo>=</mo>
<mi>n</mi>
<mrow>
<mo>(</mo>
<mi>n</mi>
<mo>+</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>k</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>m</mi>
</munderover>
<mrow>
<mo>(</mo>
<mfrac>
<msubsup>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<msub>
<mi>ϵ</mi>
<mi>k</mi>
</msub>
<mn>2</mn>
</msubsup>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mo>;</mo>
</mrow>
</math>
<math>
<mrow>
<mi>P</mi>
<mo>=</mo>
<mn>1</mn>
<mo>-</mo>
<msubsup>
<mo>∫</mo>
<mn>0</mn>
<mi>LB</mi>
</msubsup>
<mi>f</mi>
<mrow>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
</mrow>
<mi>dx</mi>
<mo>;</mo>
</mrow>
</math>
at P >0.05, the test passes and the predicting of the number of complaints for the next of the plurality of consecutive time periods is performed.
The embodiment of the invention provides a complaint prediction method and device based on an ARMA model, which are used for preprocessing an obtained original data sequence to obtain a current data sequence, obtaining an ARMA model function corresponding to the complaint quantity in the next time period, calculating the predicted complaint quantity in the next time period by using the ARMA model function, and improving the accuracy of complaint quantity prediction. By predicting the number of complaints in advance to give an early warning to the user, the user can prepare for treatment in advance according to the predicted number of complaints.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a complaint prediction method based on an ARMA model, which may include the following steps:
step 101: and acquiring the actual complaint quantity in a plurality of continuous time periods to form an original data sequence.
Step 102: and preprocessing the original data sequence to obtain the current data sequence.
Step 103: and determining an ARMA model function of predicting the complaint quantity corresponding to the next time period which is continuous with a plurality of continuous time periods according to the current data sequence.
Step 104: and calculating the predicted complaint number of the next time period according to the ARMA model function.
According to the scheme, the current data sequence is obtained by preprocessing the obtained original data sequence, the ARMA model function corresponding to the complaint quantity in the next time period is obtained, the predicted complaint quantity in the next time period is calculated by using the ARMA model function, and the accuracy of complaint quantity prediction is improved. By predicting the number of complaints in advance to give an early warning to the user, the user can prepare for treatment in advance according to the predicted number of complaints.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and specific embodiments.
As shown in fig. 2, an embodiment of the present invention provides a complaint prediction method based on an ARMA model, which may include the following steps:
step 201: and acquiring the actual complaint quantity in a plurality of continuous time periods to form an original data sequence.
In this embodiment, the plurality of consecutive time periods may be 2015, 2, 1, 00:00:00-23:00:00, and the actual complaint number in this time period is obtained to form an original data sequence, as shown in fig. 3, where the abscissa is the time and the ordinate is the actual complaint number.
Step 202: and preprocessing the original data sequence to enable the obtained current data sequence to meet preset modeling conditions.
In the present embodiment, a modeling condition that the original data sequence is a stationary non-purely random data sequence is set in advance.
Therefore, the original data sequence needs to be preprocessed to judge whether the original data sequence is a stable non-pure random data sequence, and if the judgment result is that the original data sequence is a stable non-pure random data sequence, the original data sequence is used as the current data sequence; otherwise, carrying out differential operation or partition prediction on the original data sequence so that the processed original data sequence is a stable non-pure random data sequence and the processed original data sequence is taken as the current data sequence.
When judging whether the original data sequence is a stable non-pure random data sequence, judging by the following two steps:
1. stationarity checking
In the stability check, two methods of timing chart and unit root check can be utilized.
The timing diagram verification mode is as follows: a planar two-dimensional coordinate graph is utilized, wherein the horizontal axis represents time and the vertical axis represents sequence values. If the timing chart of the original data sequence fluctuates randomly around a constant value and the range of the random fluctuation is bounded, the original data sequence is a stable sequence. If the timing diagram of the original data sequence has a significant trend or periodicity, the original data sequence is a non-stationary sequence.
However, the timing chart verification method has a certain subjectivity, and therefore, in this embodiment, a unit root verification method may be simultaneously adopted for theoretical verification.
The unit root check mode is as follows: and determining whether a unit root exists in the checked original data sequence, if so, indicating that the original data sequence is a non-stable sequence. Since the characteristic equation of the ARMA model is formula (1):
λp-φ1λp-1-…-φp=0 (1)
wherein in the formula (1), lambda is a characteristic root, phiiIs a coefficient in the ARMA function, where i is 1,2, … p, and if the characteristic root λ is 1, the formula (1) is changed to1-φ1-…-φp0, i.e. phi1+φ2+…+φpThe stationarity of the sequence can be examined by checking whether the sum of the coefficients is equal to 1. The specific verification method comprises the following steps:
first, a statistic is constructedWherein, is the sample standard deviation of the parameter p. Then, a probability value Prob corresponding to the statistic τ is calculated, and the probability Prob is calculated<At 0.05, the original data sequence is a stationary sequence, otherwise, it is a non-stationary sequence.
2. Non-pure randomness verification
Pure random sequence: if the data in the original data sequence have no correlation with each other, it means that the sequence is a memoryless sequence, and the past behavior has no influence on the future development, and the sequence is called a pure random sequence.
Non-pure random sequences: i.e. between individual data in the original data sequence, past behavior has an impact on future development, and such sequences are referred to as non-purely random sequences.
In this embodiment, the ARMA model can be established only by the non-pure random sequence, and therefore, it is necessary to check whether the original data sequence is the non-pure random sequence.
In this embodiment, whether the original data sequence is a non-pure random sequence is checked by using the LB statistic that is commonly used in the statistical analysis, and when the probability value P of the LB statistic is less than 0.05, the original data sequence is a non-pure random sequence. Wherein, the LB statistic is calculated by the following formulas (2) and (3):
<math>
<mrow>
<mi>LB</mi>
<mo>=</mo>
<mi>n</mi>
<mrow>
<mo>(</mo>
<mi>n</mi>
<mo>+</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>k</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>m</mi>
</munderover>
<mrow>
<mo>(</mo>
<mfrac>
<msubsup>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<msub>
<mi>ϵ</mi>
<mi>k</mi>
</msub>
<mn>2</mn>
</msubsup>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
<math>
<mrow>
<msub>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<mi>k</mi>
</msub>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</munderover>
<mrow>
<mo>(</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>x</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mrow>
<mo>(</mo>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>+</mo>
<mi>k</mi>
</mrow>
</msub>
<mo>-</mo>
<mover>
<mi>x</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
</mrow>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>x</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
<mo>,</mo>
<mo>∀</mo>
<mn>0</mn>
<mo>≤</mo>
<mi>k</mi>
<mo>≤</mo>
<mi>n</mi>
<mo>,</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>3</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
wherein n is the number of observation periods of the sequence, m is the number of delay periods,is the autocorrelation coefficient (i.e. the correlation coefficient between the current x and x before k period).
Wherein the P value is calculated by the following formulas (4), (5) and (6):
<math>
<mrow>
<mi>P</mi>
<mo>=</mo>
<mn>1</mn>
<mo>-</mo>
<msubsup>
<mo>∫</mo>
<mn>0</mn>
<mi>LB</mi>
</msubsup>
<mi>f</mi>
<mrow>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
</mrow>
<mi>dx</mi>
<mo>,</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>4</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
<math>
<mrow>
<mi>Γ</mi>
<mrow>
<mo>(</mo>
<mi>m</mi>
<mo>/</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
<mo>=</mo>
<msubsup>
<mo>∫</mo>
<mn>0</mn>
<mrow>
<mo>+</mo>
<mo>∞</mo>
</mrow>
</msubsup>
<msup>
<mi>t</mi>
<mrow>
<mfrac>
<mi>m</mi>
<mn>2</mn>
</mfrac>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msup>
<msup>
<mi>e</mi>
<mrow>
<mo>-</mo>
<mi>t</mi>
</mrow>
</msup>
<mi>dt</mi>
<mo>.</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>6</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
for example, as can be seen from the timing diagram of year 2015, month 2 and 1 in fig. 3, the original data sequence has a periodicity that decreases first and then increases, and has a tendency to increase slowly. Therefore, the original data sequence is processed by using a partition interval prediction mode, wherein the original data sequence is divided into two prediction intervals of 00:00:00-11:00:00 and 11:00:00-23:00:00, and because data randomly fluctuates above and below a certain value in the two time intervals, the stability condition of modeling is met. Wherein, as shown in the table 1,
Table 2 shows the unit root check for the two prediction intervals, respectively, according to the above-mentioned unit root check principle,
and the verification result can be directly obtained by utilizing statistical software EViews.
Table 1:00: 00:00-11:00:00 unit root check index
Table 2: 11:00:00-23:00:00 unit root check index
The Prob values in the table are 0.0095<0.05 and 0.0094<0.05 respectively, so that the stability check is really satisfied.
The following continues to check the pure randomness of the original data sequence: according to the above principle of pure randomness verification, statistical software SPSS can be used to directly obtain the results of statistical amounts LB and P, as shown in table 3.
TABLE 3 LB statistics and P values corresponding to delay 6 and 12
From table 3, it can be seen that: the P values of delay 6 and delay 12 have P <0.05, so the sequence is a non-pure random sequence, and therefore, the original data sequence in FIG. 3 satisfies ARMA modeling conditions.
Step 203: and determining an ARMA model function of predicting the complaint quantity corresponding to the next time period which is continuous with a plurality of continuous time periods according to the current data sequence.
In the present embodiment, the ARMA model consists of an Autoregressive (AR) model and a Moving Average (MA) model.
The AR model refers to that the complaint quantity at the t moment to be predicted is related to the previous t-1, t-2.
<math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>xϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>,</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>7</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
Wherein,representing the predicted number of complaints at time t, xt-1、……、xt-pRespectively represents the actual complain quantity at the time of t-1, t.. and t-p,trepresents the random error term, phi, at time t1、……、φpAre all first unknown parameters;
the MA model refers to that index values at t moment to be predicted are related to random error terms at previous t-1, t-2,. t-q moments, namely, the MA (q) equation is shown as formula (8):
<math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>,</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>8</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
wherein,representing the predicted complaint volume at time t,t-1、……、t-qrandom error terms theta at t-1, … … and t-p1、……、θqAre all the second unknown parameters.
In this embodiment, the index value at time t to be predicted is related to the index value at the previous time and the random error term, and thus the ARMA model function is obtained from the AR model and the MA model as shown in equation (9):
<math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>9</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
step 204: the values of the various unknown parameters in the ARMA model functions are determined.
In this embodiment, the ARMA model function includes a plurality of unknown parameters, such as φ1、……、φp、θ1、……、θqAnd (p, q), for a total of p + q +2 unknown parameters.
In this embodiment, the least square method and BIC criterion can be used to select the optimal p, q values and the corresponding parameter estimation phi1,…φp,θ1,…θqAnd determining the model. The selection method comprises the following steps: the parameters p, q are assigned values, and for each fixed (p, q), the parameter phi of the model is estimated using the least squares method1,…φp,θ1,…θqThus for each (p, q) value, there is a model fit <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>.</mo>
</mrow>
</math>
The following is a detailed description of how to determine the values of unknown parameters.
1. Using least squares estimation algorithm
First, using AR (p) model to calculate phi1、……、φpThe method comprises the following specific operations:
s1: order:
<math>
<mrow>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>-</mo>
<mover>
<mi>X</mi>
<mo>‾</mo>
</mover>
<mo>=</mo>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>10</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
calculating ar (p): <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mn>2</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
wherein x isiFor the actual number of complaints at time i,is the average of the actual complaint number;
s2: setting intermediate values l, Y, X and beta, and letting:
l=max(p,q); (11)
<math>
<mrow>
<mi>Y</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>n</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>12</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
<math>
<mrow>
<mi>X</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>13</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
β1=(φ1,φ2,…φp) (ii) a (14) S3: calculating beta1Is estimated by least squares of1=(XTX)-1XTY, solve for phi1、……、φp。
Then, using the MA (q) model, θ is calculated1、……、θqThe method comprises the following specific operations:
s4: order:
<math>
<mrow>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>-</mo>
<mover>
<mi>X</mi>
<mo>‾</mo>
</mover>
<mo>=</mo>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>15</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
calculating MA (q): <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>;</mo>
</mrow>
</math>
s5: calculating a residual term:
<math>
<mrow>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>j</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>p</mi>
</munderover>
<msub>
<mi>φ</mi>
<mi>j</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>j</mi>
</mrow>
</msub>
<mo>,</mo>
<mi>t</mi>
<mo>=</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
<mo>,</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>,</mo>
<mi>n</mi>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>16</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
setting intermediate values l, Y, X and beta2Order:
l=max(p,q); (17)
<math>
<mrow>
<mi>Y</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>n</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>18</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
<math>
<mrow>
<mi>ϵ</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>19</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
β2=(-θ1,-θ2,…,-θq); (20)
s6: calculating beta2Is estimated by least squares of2=(T)-1 TY, solving for theta1、……、θq。
2. Selection of optimal (p, q) values using BIC criteria
The target (p, q) is calculated according to the following operational scheme:
<math>
<mrow>
<mi>BIC</mi>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mi>n</mi>
<mi>ln</mi>
<mrow>
<mo>(</mo>
<msubsup>
<mover>
<mi>σ</mi>
<mo>^</mo>
</mover>
<mi>e</mi>
<mn>2</mn>
</msubsup>
<mo>)</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>+</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
<mi>ln</mi>
<mi>n</mi>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>21</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
wherein, <math>
<mrow>
<msubsup>
<mover>
<mi>σ</mi>
<mo>^</mo>
</mover>
<mi>e</mi>
<mn>2</mn>
</msubsup>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>-</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>+</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
</mrow>
</mfrac>
<mo>;</mo>
</mrow>
</math>
(p, q) for calculating the minimum BIC (p, q) value is taken as the target (p, q).
Step 205: the ARMA model function is checked, and when the checking is passed, the step 206 is continued.
In this embodiment, the test may be performed using the LB statistic. In the pure randomness test, in order to prove that the original data sequence is not a pure random sequence, namely, the data has correlation, it is required to satisfy that the P value corresponding to the LB statistic is less than 0.05, and here it is required to prove that most information of the original data sequence is already sufficiently extracted by the fitting model, namely, the error sequence is pure random, so that the model can be proved to pass the significance test only if the LB statistic of the error sequence is obtained to correspond to the P value of > 0.05. The specific method comprises the following steps:
s7: computing <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mn>2</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>,</mo>
</mrow>
</math> T is more than or equal to max (p, q) and less than or equal to n; computing1≤t≤n;
S8: computingWherein, <math>
<mrow>
<msub>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<msub>
<mi>ϵ</mi>
<mi>k</mi>
</msub>
</msub>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</munderover>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>+</mo>
<mi>k</mi>
</mrow>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
</mrow>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
<mo>,</mo>
<mo>∀</mo>
<mn>1</mn>
<mo>≤</mo>
<mi>k</mi>
<mo>≤</mo>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
s9: obtaining an error sequence according to the LB statistic and the corresponding P value calculation formula in the pure randomness test processtThe corresponding P value;
<math>
<mrow>
<mi>LB</mi>
<mo>=</mo>
<mi>n</mi>
<mrow>
<mo>(</mo>
<mi>n</mi>
<mo>+</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>k</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>m</mi>
</munderover>
<mrow>
<mo>(</mo>
<mfrac>
<msubsup>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<msub>
<mi>ϵ</mi>
<mi>k</mi>
</msub>
<mn>2</mn>
</msubsup>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>22</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
<math>
<mrow>
<mi>P</mi>
<mo>=</mo>
<mn>1</mn>
<mo>-</mo>
<msubsup>
<mo>∫</mo>
<mn>0</mn>
<mi>LB</mi>
</msubsup>
<mi>f</mi>
<mrow>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
</mrow>
<mi>dx</mi>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>23</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
<math>
<mrow>
<mi>Γ</mi>
<mrow>
<mo>(</mo>
<mi>m</mi>
<mo>/</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
<mo>=</mo>
<msubsup>
<mo>∫</mo>
<mn>0</mn>
<mrow>
<mo>+</mo>
<mo>∞</mo>
</mrow>
</msubsup>
<msup>
<mi>t</mi>
<mrow>
<mfrac>
<mi>m</mi>
<mn>2</mn>
</mfrac>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msup>
<msup>
<mi>e</mi>
<mrow>
<mo>-</mo>
<mi>t</mi>
</mrow>
</msup>
<mi>dt</mi>
<mo>;</mo>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>25</mn>
<mo>)</mo>
</mrow>
</mrow>
</math>
when P >0.05, the test is passed. Then, the residual sequence can be judged to be a pure random sequence, so that the fitting model is significant and effective, and the central point prediction can be carried out.
Step 206: and calculating the predicted complaint number of the next time period according to the ARMA model function.
In this embodiment, the number of predicted complaints at time t is calculated using the ARMA model function.
After the predicted number of complaints at time t is calculated by using the ARMA model function, the predicted number of complaints at time t +1 may be calculated by using the predicted number of complaints at time t, or the predicted number of complaints at time t +1 may be recalculated by continuing the above-described steps after the actual number of complaints at time t is determined.
As shown in fig. 4, the predicted complaint amount and the actual complaint amount at each time point predicted by the ARMA model function are compared.
As can be seen from fig. 4, the predicted complaint amount at each time predicted by the ARMA model function is highly accurate.
According to the scheme, the current data sequence is obtained by preprocessing the obtained original data sequence, the ARMA model function corresponding to the complaint quantity in the next time period is obtained, the predicted complaint quantity in the next time period is calculated by using the ARMA model function, and the accuracy of complaint quantity prediction is improved. By predicting the number of complaints in advance to give an early warning to the user, the user can prepare for treatment in advance according to the predicted number of complaints.
As shown in fig. 5 and 6, an embodiment of the present invention provides a complaint prediction apparatus based on an ARMA model. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. From a hardware level, as shown in fig. 5, a hardware structure diagram of a device in which a complaint prediction apparatus based on an ARMA model according to an embodiment of the present invention is located is shown, where in addition to the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 5, the device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing a packet. Taking a software implementation as an example, as shown in fig. 6, as a logical apparatus, the apparatus is formed by reading, by a CPU of a device in which the apparatus is located, corresponding computer program instructions in a non-volatile memory into a memory for execution. The complaint prediction apparatus 60 based on the ARMA model according to the present embodiment includes:
an obtaining unit 601, configured to obtain actual complaint numbers in multiple consecutive time periods to form an original data sequence;
a preprocessing unit 602, configured to preprocess the original data sequence to obtain a current data sequence;
a determining unit 603, configured to determine, according to the current data sequence, an ARMA model function of the predicted complaint number corresponding to a next time period that is consecutive to the plurality of consecutive time periods;
a calculating unit 604, configured to calculate the predicted complaint number of the next time period according to the ARMA model function.
In an embodiment of the present invention, as shown in fig. 7, the method may further include:
a storage unit 701, configured to store a modeling condition that the original data sequence is a stationary non-pure random data sequence;
the preprocessing unit 602 is configured to verify the original data sequence, and if the verification result indicates that the original data sequence meets the modeling condition, take the original data sequence as a current data sequence; and if the verification result is that the original data sequence does not meet the modeling condition, performing differential operation on the original data sequence to obtain the current data sequence.
Further, the determining unit 603 is configured to determine, according to the current data sequence, an ARMA model function corresponding to the predicted complaint quantity of the next time segment that is consecutive to the plurality of consecutive time segments as follows:
<math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<mi></mi>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
</mrow>
</math>
wherein,for the predicted number of complaints at time t, xt-p……xt-1Actual complaining numbers phi at the time t-p and … … t-1, respectively1、……、φpAre all the first unknown parameter, theta1、……、θqAre all of the second unknown parameters of the second,t-1、……、t-qrespectively, are random error terms at time t-1, … … and t-p.
Further, the calculating unit 604 is configured to calculate the first unknown parameter in the ARMA model function according to the following operation: phi is a1、……、φp:
S1: order:
<math>
<mrow>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>-</mo>
<mover>
<mi>X</mi>
<mo>‾</mo>
</mover>
<mo>=</mo>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
calculating ar (p): <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mn>2</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
wherein x isiFor the actual number of complaints at time i,is the average of the actual complaint number;
s2: setting intermediate values l, Y, X and beta, and letting:
l=max(p,q);
<math>
<mrow>
<mi>Y</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>n</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
<math>
<mrow>
<mi>X</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
β1=(φ1,φ2,…φp);
s3: calculating beta1Is estimated by least squares of1=(XTX)-1XTY, solve for phi1、……、φp(ii) a Further comprising: calculating theta in ARMA model function according to the following operation mode1、……、θq(ii) a S4: order:
<math>
<mrow>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>-</mo>
<mover>
<mi>X</mi>
<mo>‾</mo>
</mover>
<mo>=</mo>
<msub>
<mi>X</mi>
<mi>i</mi>
</msub>
<mo>;</mo>
</mrow>
</math>
calculating MA (q): <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>;</mo>
</mrow>
</math>
s5: and (3) calculating: <math>
<mrow>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>j</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>p</mi>
</munderover>
<msub>
<mi>φ</mi>
<mi>j</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>j</mi>
</mrow>
</msub>
<mo>,</mo>
<mi>t</mi>
<mo>=</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
<mo>,</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>,</mo>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
setting intermediate values l, Y, X and beta2Order:
l=max(p,q);
<math>
<mrow>
<mi>Y</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>n</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
<math>
<mrow>
<mi>ϵ</mi>
<mo>=</mo>
<mfenced open='(' close=')'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mi>l</mi>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>l</mi>
<mo>-</mo>
<mi>p</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
<mtd>
</mtd>
<mtd>
<mo>·</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
</mtd>
<mtd>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
</mtd>
<mtd>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>;</mo>
</mrow>
</math>
β2=(-θ1,-θ2,…,-θq);
s6: calculating beta2Is estimated by least squares of2=(T)-1 TY, solving for theta1、……、θq。
Further comprising: the target (p, q) is calculated according to the following operational scheme:
<math>
<mrow>
<mi>BIC</mi>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mi>n</mi>
<mi>ln</mi>
<mrow>
<mo>(</mo>
<msubsup>
<mover>
<mi>σ</mi>
<mo>^</mo>
</mover>
<mi>e</mi>
<mn>2</mn>
</msubsup>
<mo>)</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>+</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
<mi>ln</mi>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
wherein, <math>
<mrow>
<msubsup>
<mover>
<mi>σ</mi>
<mo>^</mo>
</mover>
<mi>e</mi>
<mn>2</mn>
</msubsup>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>-</mo>
<msub>
<mi>x</mi>
<mi>t</mi>
</msub>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>p</mi>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>+</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
</mrow>
</mfrac>
<mo>;</mo>
</mrow>
</math>
(p, q) for calculating the minimum BIC (p, q) value is taken as the target (p, q).
Further comprising:
a checking unit 702, configured to check the ARMA model function, where the checking function includes:
s7: computing <math>
<mrow>
<msub>
<mover>
<mi>x</mi>
<mo>^</mo>
</mover>
<mi>t</mi>
</msub>
<mo>=</mo>
<msub>
<mi>φ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mn>2</mn>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>2</mn>
</mrow>
</msub>
<mo>+</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>+</mo>
<msub>
<mi>φ</mi>
<mi>p</mi>
</msub>
<msub>
<mi>x</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>p</mi>
</mrow>
</msub>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mn>1</mn>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo>-</mo>
<mo>·</mo>
<mo>·</mo>
<mo>·</mo>
<mo>-</mo>
<msub>
<mi>θ</mi>
<mi>q</mi>
</msub>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>-</mo>
<mi>q</mi>
</mrow>
</msub>
<mo>,</mo>
<mi>max</mi>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo>,</mo>
<mi>q</mi>
<mo>)</mo>
</mrow>
<mo>≤</mo>
<mi>t</mi>
<mo>≤</mo>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math> Computing1≤t≤n;
S8: computingWherein, <math>
<mrow>
<msub>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<msub>
<mi>ϵ</mi>
<mi>k</mi>
</msub>
</msub>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</munderover>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mrow>
<mi>t</mi>
<mo>+</mo>
<mi>k</mi>
</mrow>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
</mrow>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>t</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>n</mi>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<msub>
<mi>ϵ</mi>
<mi>t</mi>
</msub>
<mo>-</mo>
<mover>
<mi>ϵ</mi>
<mo>‾</mo>
</mover>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
<mo>,</mo>
<mo>∀</mo>
<mn>1</mn>
<mo>≤</mo>
<mi>k</mi>
<mo>≤</mo>
<mi>n</mi>
<mo>;</mo>
</mrow>
</math>
s9: obtaining an error sequence according to the LB statistic and the corresponding P value calculation formula in the pure randomness test processtThe corresponding P value;
<math>
<mrow>
<mi>LB</mi>
<mo>=</mo>
<mi>n</mi>
<mrow>
<mo>(</mo>
<mi>n</mi>
<mo>+</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>k</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>m</mi>
</munderover>
<mrow>
<mo>(</mo>
<mfrac>
<msubsup>
<mover>
<mi>ρ</mi>
<mo>^</mo>
</mover>
<msub>
<mi>ϵ</mi>
<mi>k</mi>
</msub>
<mn>2</mn>
</msubsup>
<mrow>
<mi>n</mi>
<mo>-</mo>
<mi>k</mi>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mo>;</mo>
</mrow>
</math>
<math>
<mrow>
<mi>P</mi>
<mo>=</mo>
<mn>1</mn>
<mo>-</mo>
<msubsup>
<mo>∫</mo>
<mn>0</mn>
<mi>LB</mi>
</msubsup>
<mi>f</mi>
<mrow>
<mo>(</mo>
<mi>x</mi>
<mo>)</mo>
</mrow>
<mi>dx</mi>
<mo>;</mo>
</mrow>
</math>
at P >0.05, the test passes and the predicting of the number of complaints for the next of the plurality of consecutive time periods is performed.
Since the contents of information interaction, execution process, and the like between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.