Summary of the invention
In view of this, the invention provides a kind of complaint Forecasting Methodology based on arma modeling and device, to improve the accuracy rate complaining quantitative forecast.
The invention provides a kind of complaint Forecasting Methodology based on arma modeling, comprising:
Obtain the actual complaint quantity in section multiple continuous time, form original data sequence;
Preliminary treatment is carried out to described original data sequence, obtains current data sequence;
Determine to predict the arma modeling function of complaining quantity with corresponding to described multiple continuous time section consecutive next time period according to described current data sequence;
According to described arma modeling function, quantity is complained in the prediction calculating the described next time period.
Preferably,
Comprise further: arrange modeling conditions, described modeling conditions is described original data sequence is steady non-pure random data sequence;
Described preliminary treatment is carried out to described original data sequence, obtains current data sequence, comprising:
Described original data sequence is verified, if check results is described original data sequence meet described modeling conditions, then using described original data sequence as current data sequence; If check results is described original data sequence do not meet described modeling conditions, then calculus of differences is carried out to described original data sequence, obtain current data sequence.
Preferably, describedly determine to predict the arma modeling function of complaining quantity with corresponding to described multiple continuous time section consecutive next time period according to described current data sequence, comprising:
Determine to predict that the arma modeling function of complaining quantity is as follows with corresponding to described multiple continuous time section consecutive next time period according to described current data sequence:
Wherein,
for the prediction of t complains quantity, x
t-px
t-1be respectively t-p moment ... the actual complaint quantity in t-1 moment, φ
1..., φ
pbe the first unknown parameter, θ
1..., θ
qbe the second unknown parameter, ε
t-1..., ε
t-qbe respectively t-1 moment ..., the t-p moment stochastic error.
Preferably,
Comprise further: calculate the first unknown parameter in arma modeling function according to following compute mode: φ
1..., φ
p:
S1: order:
Calculate AR (p):
Wherein, x
ifor the actual complaint quantity in i moment,
for reality complains the average of quantity;
S2: establish median l, Y, X and β, order:
l=max(p,q);
β
1=(φ
1,φ
2,…φ
p);
S3: calculate β
1least-squares estimation β
1=(X
tx)
-1x
ty, solves φ
1..., φ
p; Comprise further: calculate θ in arma modeling function according to following compute mode
1..., θ
q; S4: order:
Calculate MA (q):
S5: calculate:
If median l, Y, X and β
2, order:
l=max(p,q);
β
2=(-θ
1,-θ
2,…,-θ
q);
S6: calculate β
2least-squares estimation β
2=(ε
tε)
-1ε
ty, solves θ
1..., θ
q.
Comprise further: calculate target (p, q) according to following compute mode:
Wherein,
(p, the q) of minimum BIC (p, q) value will be calculated as target (p, q).
Preferably, before the complaint quantity of the next time period of described prediction section described multiple continuous time, comprise further:
Test to described arma modeling function, described test function comprises:
S7: calculate
Max (p, q)≤t≤n; Calculate
1≤t≤n;
S8: calculate
wherein,
S9: draw error sequence ε according to the computing formula of LB statistic and corresponding P value in pure randomness test process
tcorresponding P value;
At P>0.05, upcheck, and perform the complaint quantity of the next time period of described prediction section described multiple continuous time.
Present invention also offers a kind of complaint prediction unit based on arma modeling, comprising:
Acquiring unit, for obtaining the actual complaint quantity in section multiple continuous time, forms original data sequence;
Pretreatment unit, for carrying out preliminary treatment to described original data sequence, obtains current data sequence;
Determining unit, predicts the arma modeling function of complaining quantity for determining according to described current data sequence with corresponding to described multiple continuous time section consecutive next time period;
Computing unit, for according to described arma modeling function, calculates the prediction complaint quantity of described next time period.
Preferably,
Comprise further: memory cell, for preserving modeling conditions, described modeling conditions is described original data sequence is steady non-pure random data sequence;
Described pretreatment unit, for verifying described original data sequence, if check results is described original data sequence meet described modeling conditions, then using described original data sequence as current data sequence; If check results is described original data sequence do not meet described modeling conditions, then calculus of differences is carried out to described original data sequence, obtain current data sequence.
Preferably, described determining unit, predict that the arma modeling function of complaining quantity is as follows for determining according to described current data sequence with corresponding to described multiple continuous time section consecutive next time period:
Wherein,
for the prediction of t complains quantity, x
t-px
t-1be respectively t-p moment ... the actual complaint quantity in t-1 moment, φ
1..., φ
pbe the first unknown parameter, θ
1..., θ
qbe the second unknown parameter, ε
t-1..., ε
t-qbe respectively t-1 moment ..., the t-p moment stochastic error.
Preferably,
Described computing unit, for calculating the first unknown parameter in arma modeling function: φ according to following compute mode
1..., φ
p:
S1: order:
Calculate AR (p):
Wherein, x
ifor the actual complaint quantity in i moment,
for reality complains the average of quantity;
S2: establish median l, Y, X and β, order:
l=max(p,q);
β
1=(φ
1,φ
2,…φ
p);
S3: calculate β
1least-squares estimation β
1=(X
tx)
-1x
ty, solves φ
1..., φ
p; Comprise further: calculate θ in arma modeling function according to following compute mode
1..., θ
q; S4: order:
Calculate MA (q):
S5: calculate:
If median l, Y, X and β
2, order:
l=max(p,q);
β
2=(-θ
1,-θ
2,…,-θ
q);
S6: calculate β
2least-squares estimation β
2=(ε
tε)
-1ε
ty, solves θ
1..., θ
q.Comprise further: calculate target (p, q) according to following compute mode:
Wherein,
(p, the q) of minimum BIC (p, q) value will be calculated as target (p, q).
Preferably, comprise further:
Verification unit, for testing to described arma modeling function, described test function comprises:
S7: calculate
Max (p, q)≤t≤n; Calculate
1≤t≤n;
S8: calculate
wherein,
S9: draw error sequence ε according to the computing formula of LB statistic and corresponding P value in pure randomness test process
tcorresponding P value;
At P>0.05, upcheck, and perform the complaint quantity of the next time period of described prediction section described multiple continuous time.
Embodiments provide a kind of complaint Forecasting Methodology based on arma modeling and device, current data sequence is obtained by carrying out preliminary treatment to the original data sequence obtained, and obtain the arma modeling function that next time period correspondence complains quantity, quantity is complained in the prediction utilizing arma modeling function to calculate the next time period, improves the accuracy rate complaining quantitative forecast.Complain quantity to carry out early warning to user by look-ahead, make user to complain quantity to carry out reply according to prediction in advance and prepare.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described.Obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
As shown in Figure 1, embodiments provide a kind of complaint Forecasting Methodology based on arma modeling, the method can comprise the following steps:
Step 101: obtain the actual complaint quantity in section multiple continuous time, forms original data sequence.
Step 102: preliminary treatment is carried out to original data sequence, obtains current data sequence.
Step 103: determine to predict the arma modeling function of complaining quantity with corresponding to multiple continuous time section consecutive next time period according to current data sequence.
Step 104: according to arma modeling function, quantity is complained in the prediction calculating the next time period.
According to such scheme, current data sequence is obtained by carrying out preliminary treatment to the original data sequence obtained, and obtain the arma modeling function that next time period correspondence complains quantity, quantity is complained in the prediction utilizing arma modeling function to calculate the next time period, improves the accuracy rate complaining quantitative forecast.Complain quantity to carry out early warning to user by look-ahead, make user to complain quantity to carry out reply according to prediction in advance and prepare.
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with drawings and the specific embodiments, the present invention is described in further detail.
As shown in Figure 2, embodiments provide a kind of complaint Forecasting Methodology based on arma modeling, the method can comprise the following steps:
Step 201: obtain the actual complaint quantity in section multiple continuous time, forms original data sequence.
In the present embodiment, multiple continuous time, section can be 00:00:00-23:00:00 on February 1st, 2015, obtained the actual complaint quantity in section during this period of time, form original data sequence, as shown in Figure 3, wherein, abscissa is the moment, and ordinate is actual complaint quantity.
Step 202: carry out preliminary treatment to original data sequence, meets to make the current data sequence obtained the modeling conditions pre-set.
In the present embodiment, pre-set modeling conditions, this modeling conditions is original data sequence is steady non-pure random data sequence.
Therefore, need to carry out preliminary treatment to original data sequence, to judge whether original data sequence is steady non-pure random data sequence, if judged result is original data sequence is steady non-pure random data sequence, so using original data sequence as current data sequence; Otherwise, calculus of differences or demarcation interval prediction are carried out, to make the original data sequence after process be steady non-pure random data sequence, and using the original data sequence after process as current data sequence to original data sequence.
When judging whether original data sequence is steady non-pure random data sequence, judged by following two steps:
1, stationarity verification
When carrying out stationarity verification, sequential chart and unit root can be utilized to verify two kinds of methods.
Sequential chart verification mode is: utilize planar two dimensional coordinate figure, and wherein, horizontal axis representing time, the longitudinal axis represents sequence value.Wherein, if the sequential chart of original data sequence is in the random fluctuation of a constant value annex, and the scope bounded of random fluctuation, so this original data sequence is stationary sequence.If the sequential chart of original data sequence has obvious tendency or periodically, this original data sequence is non-stationary series.
But sequential chart verification mode has certain subjectivity, therefore, in the present embodiment, unit root verification mode can be adopted to carry out theoretical property checking simultaneously.
Unit root verification mode is: determine whether be there is unit root by the original data sequence that verifies, if if there is unit root in arma modeling, show that this original data sequence is non-stationary series.Characteristic equation due to arma modeling is formula (1):
λ
p-φ
1λ
p-1-…-φ
p=0 (1)
Wherein, in formula (1), λ is characteristic root, φ
ifor the coefficient in ARMA function, wherein, i=1,2 ... p, if characteristic root λ=1, then formula (1) turns to 1-φ
1-...-φ
p=0, i.e. φ
1+ φ
2+ ... + φ
p=1, so whether can equal by checkout coefficient sum the stationarity that 1 investigates this sequence.Concrete method of calibration is as follows:
First, statistic is constructed
wherein,
for the sample standard deviation of parameter ρ.Then, the probable value Prob that compute statistics τ is corresponding, when probability P rob<0.05, shows that original data sequence is stationary sequence, otherwise, be non-stationary series.
2, non-pure randomness verification
Pure random sequence: if each data in original data sequence are each other without any correlation, that just means that this sequence is a sequence not having to remember, and the behavior in past does not at all affect development in the future, and this sequence is referred to as pure random sequence.
Non-pure random sequence: namely in original data sequence between each data, the behavior in past has impact to development in the future, and this sequence is referred to as non-pure random sequence.
Whether in the present embodiment, only have non-pure random sequence to set up arma modeling, therefore needing to verify this original data sequence is non-pure random sequence.
In the present embodiment, utilize whether LB statistic conventional in statistical analysis is that non-pure random sequence verifies to original data sequence, when the probable value P<0.05 of LB statistic, this original data sequence is non-pure random sequence.Wherein, following formula (2), (3) calculating LB statistic is utilized:
Wherein, n is sequence observation issue, and m is delay issue,
for the auto-correlation coefficient coefficient correlation of x (namely before current x and the k phase).
Wherein, following formula (4), (5), (6) are utilized to calculate P value:
Such as, the sequential chart according to 1, on February of 2015 in Fig. 3 can be found out, original data sequence has the periodicity first subtracting rear increasing, and has the trend slowly increased progressively.Therefore, demarcation interval prediction mode is utilized to process original data sequence, wherein, original data sequence is divided into 00:00:00-11:00:00 and 11:00:00-23:00:00 two forecast intervals, because data are in the upper and lower random fluctuation of certain value within these two time periods, all meet the stationarity condition of modeling.Wherein, as table 1,
The unit root verification of these two forecast intervals is respectively described in table 2, according to above-mentioned unit root verification principle,
Utilize statistical software EViews can the direct result that must verify.
Table 1:00:00:00-11:00:00 unit root verification index
Table 2:11:00:00-23:00:00 unit root verification index
Be respectively 0.0095<0.05 by Prob value in table, 0.0094<0.05 is known meets stationarity verification really.
Continue the pure randomness of verification original data sequence below: according to above-mentioned pure randomness verification principle, utilize statistic software SPSS directly can obtain the result of statistic LB and P value, as shown in table 3.
Table 3 postpones the 6 phases LB statistic corresponding with 12 phases and P value
Known according to table 3: postponed for 6 phases and postpone the P value of 12 phases have P<0.05, so this sequence is non-pure random sequence, therefore, the original data sequence in Fig. 3 meets ARMA modeling conditions.
Step 203: determine to predict the arma modeling function of complaining quantity with corresponding to multiple continuous time section consecutive next time period according to current data sequence.
In the present embodiment, arma modeling is made up of autoregression (AR) model and rolling average (MA) model two parts.
Wherein, AR model refers to the complaint quantity of the t that will predict and t-1 before, t-2 ... the t-p moment is relevant, and namely AR (p) equation is for shown in formula (7):
Wherein,
the prediction representing t complains quantity, x
t-1..., x
t-prepresent the actual complaint quantity in t-1 ..., t-p moment respectively, ε
trepresent the stochastic error of t, φ
1..., φ
pbe the first unknown parameter;
Wherein, MA model refers to the desired value of the t that will predict and t-1 before, t-2 ... the stochastic error in t-q moment is relevant, and namely MA (q) equation is for shown in formula (8):
Wherein,
represent the prediction complaint amount of t, ε
t-1..., ε
t-qbe respectively t-1 moment ..., the t-p moment stochastic error, θ
1..., θ
qbe the second unknown parameter.
In the present embodiment, the desired value of the t that predict is all relevant with stochastic error with the desired value in moment before, thus according to above-mentioned AR model and MA model, obtains arma modeling function for shown in formula (9):
Step 204: the value determining each unknown parameter in arma modeling function.
In the present embodiment, according to arma modeling function, its function comprises multiple unknown parameter, e.g., and φ
1..., φ
p, θ
1..., θ
q(p, q), altogether p+q+2 unknown parameter.
In the present embodiment, least square method and BIC criterion can be utilized to select optimum p, q value and corresponding parameter Estimation φ
1... φ
p, θ
1... θ
q, Confirming model.Method for selecting is: to parameter p, q assignment, for (p, q) that each is fixing, utilizes the parameter phi of Least Square Method model
1... φ
p, θ
1... θ
q, like this for each (p, q) value, had a models fitting
Below to how determining that the value of unknown parameter is described in detail.
1, least-squares estimation algorithm is utilized
First, utilize AR (p) model, calculate φ
1..., φ
p, concrete operations are as follows:
S1: order:
Calculate AR (p):
Wherein, x
ifor the actual complaint quantity in i moment,
for reality complains the average of quantity;
S2: establish median l, Y, X and β, order:
l=max(p,q); (11)
β
1=(φ
1, φ
2... φ
p); (14) S3: calculate β
1least-squares estimation β
1=(X
tx)
-1x
ty, solves φ
1..., φ
p.
Secondly, utilize MA (q) model, calculate θ
1..., θ
q, concrete operations are as follows:
S4: order:
Calculate MA (q):
S5: calculate residual error item:
If median l, Y, X and β
2, order:
l=max(p,q); (17)
β
2=(-θ
1,-θ
2,…,-θ
q); (20)
S6: calculate β
2least-squares estimation β
2=(ε
tε)
-1ε
ty, solves θ
1..., θ
q.
2, selected optimum (p, the q) value of BIC criterion is utilized
Target (p, q) is calculated according to following compute mode:
Wherein,
(p, the q) of minimum BIC (p, q) value will be calculated as target (p, q).
Step 205: test to described arma modeling function, when upchecking, continues to perform step 206.
In the present embodiment, LB statistic can be utilized to test.When pure randomness test, in order to prove that original data sequence is not pure random sequence, namely correlation is had between data, the P value <0.05 that demand fulfillment LB statistic is corresponding, and here need prove be the most information that model of fit has been extracted original data sequence fully, namely error sequence should be purely random, as long as so draw the corresponding P value >0.05 of the LB statistic of error sequence here, namely provable model have passed significance test.Concrete grammar is as follows:
S7: calculate
Max (p, q)≤t≤n; Calculate
1≤t≤n;
S8: calculate
wherein,
S9: draw error sequence ε according to the computing formula of LB statistic and corresponding P value in pure randomness test process
tcorresponding P value;
When P>0.05, then upcheck.So can conclude that residual sequence is pure random sequence, and then illustrate that this model of fit is significantly effective, can central point prediction be carried out.
Step 206: according to arma modeling function, quantity is complained in the prediction calculating the next time period.
In the present embodiment, utilize arma modeling function, quantity is complained in the prediction calculating t.
It should be noted that, utilize arma modeling function, after calculating the prediction complaint quantity of t, the prediction of t can also be utilized to complain quantity, quantity is complained in the prediction calculating the t+1 moment, also can after the actual complaint quantity determining t, quantity is complained in the prediction continuing to utilize above-mentioned steps to recalculate the t+1 moment.
As shown in Figure 4, for quantity and actual comparison diagram of complaining quantity are complained in the prediction in each moment utilizing arma modeling function to predict.
According to Fig. 4, quantity is complained in the prediction in each moment utilizing arma modeling function to predict, accuracy is higher.
According to such scheme, current data sequence is obtained by carrying out preliminary treatment to the original data sequence obtained, and obtain the arma modeling function that next time period correspondence complains quantity, quantity is complained in the prediction utilizing arma modeling function to calculate the next time period, improves the accuracy rate complaining quantitative forecast.Complain quantity to carry out early warning to user by look-ahead, make user to complain quantity to carry out reply according to prediction in advance and prepare.
As shown in Figure 5, Figure 6, a kind of complaint prediction unit based on arma modeling is embodiments provided.Device embodiment can pass through software simulating, also can be realized by the mode of hardware or software and hardware combining.Say from hardware view; as shown in Figure 5; for the embodiment of the present invention is based on a kind of hardware structure diagram of the complaint prediction unit place equipment of arma modeling; except the processor shown in Fig. 5, internal memory, network interface and nonvolatile memory; in embodiment, the equipment at device place can also comprise other hardware usually, as the forwarding chip etc. of responsible process message.For software simulating, as shown in Figure 6, as the device on a logical meaning, be by the CPU of its place equipment, computer program instructions corresponding in nonvolatile memory is read operation in internal memory to be formed.The complaint prediction unit 60 based on arma modeling that the present embodiment provides comprises:
Acquiring unit 601, for obtaining the actual complaint quantity in section multiple continuous time, forms original data sequence;
Pretreatment unit 602, for carrying out preliminary treatment to described original data sequence, obtains current data sequence;
Determining unit 603, predicts the arma modeling function of complaining quantity for determining according to described current data sequence with corresponding to described multiple continuous time section consecutive next time period;
Computing unit 604, for according to described arma modeling function, calculates the prediction complaint quantity of described next time period.
In an embodiment of the invention, as shown in Figure 7, may further include:
Memory cell 701, for preserving modeling conditions, described modeling conditions is described original data sequence is steady non-pure random data sequence;
Described pretreatment unit 602, for verifying described original data sequence, if check results is described original data sequence meet described modeling conditions, then using described original data sequence as current data sequence; If check results is described original data sequence do not meet described modeling conditions, then calculus of differences is carried out to described original data sequence, obtain current data sequence.
Further, described determining unit 603, predict that the arma modeling function of complaining quantity is as follows for determining according to described current data sequence with corresponding to described multiple continuous time section consecutive next time period:
Wherein,
for the prediction of t complains quantity, x
t-px
t-1be respectively t-p moment ... the actual complaint quantity in t-1 moment, φ
1..., φ
pbe the first unknown parameter, θ
1..., θ
qbe the second unknown parameter, ε
t-1..., ε
t-qbe respectively t-1 moment ..., the t-p moment stochastic error.
Further, described computing unit 604, for calculating the first unknown parameter in arma modeling function: φ according to following compute mode
1..., φ
p:
S1: order:
Calculate AR (p):
Wherein, x
ifor the actual complaint quantity in i moment,
for reality complains the average of quantity;
S2: establish median l, Y, X and β, order:
l=max(p,q);
β
1=(φ
1,φ
2,…φ
p);
S3: calculate β
1least-squares estimation β
1=(X
tx)
-1x
ty, solves φ
1..., φ
p; Comprise further: calculate θ in arma modeling function according to following compute mode
1..., θ
q; S4: order:
Calculate MA (q):
S5: calculate:
If median l, Y, X and β
2, order:
l=max(p,q);
β
2=(-θ
1,-θ
2,…,-θ
q);
S6: calculate β
2least-squares estimation β
2=(ε
tε)
-1ε
ty, solves θ
1..., θ
q.
Comprise further: calculate target (p, q) according to following compute mode:
Wherein,
(p, the q) of minimum BIC (p, q) value will be calculated as target (p, q).
Comprise further:
Verification unit 702, for testing to described arma modeling function, described test function comprises:
S7: calculate
Calculate
1≤t≤n;
S8: calculate
wherein,
S9: draw error sequence ε according to the computing formula of LB statistic and corresponding P value in pure randomness test process
tcorresponding P value;
At P>0.05, upcheck, and perform the complaint quantity of the next time period of described prediction section described multiple continuous time.
The content such as information interaction, implementation between each unit in the said equipment, due to the inventive method embodiment based on same design, particular content can see in the inventive method embodiment describe, repeat no more herein.
It should be noted that, in this article, the relational terms of such as first and second and so on is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element " being comprised " limited by statement, and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical factor.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that program command is relevant, aforesaid program can be stored in the storage medium of embodied on computer readable, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium in.
Finally it should be noted that: the foregoing is only preferred embodiment of the present invention, only for illustration of technical scheme of the present invention, be not intended to limit protection scope of the present invention.All any amendments done within the spirit and principles in the present invention, equivalent replacement, improvement etc., be all included in protection scope of the present invention.