hasbeenapplied. Theanalytialsolutionsare:
ˆ
x i j+1 | j = ˆ x i j | j + A − 1 (Φ s − I) f 0
+ A − 1 (Φ s − I) − Iτ s
A − 1 Bα
(4.28)
P j+1 i | j = Φ s P j i | j Φ T s + Z τ s
0
e A s σσ T e A T s ds
(4.29)where
τ s = t i j+1 − t i j
andΦ s = e Aτ s
,andwhere:α = u i j+1 − u i j
t i j+1 − t i j
(4.30)has been introdued to allowassumption of either zero order hold (
α = 0
) orrst order hold (
α 6 = 0
) on the inputs between sampling instants. Zero holdorder is when the value of the input is held onstant, while rst hold order
method estimatesalinearinterpolationbetweentheinputs.
theorem. The useof the maximum likelihood estimation makes it possible to
ndboththepreditionerrorestimatesoftheparametersandthevariane. The
ovarianeisequalto
H − 1
. ThematrixH
isapproximatelygivenby:h ij ≈ − ∂ 2
∂θ i ∂θ j
ln (p(θ | Y, y 0 )) θ
= ˆ θ
for
i, j = 1, . . . , p
.h ij
is the i,j-elementinH
. The expressionin theequationaboveis theHessianmatrixevaluatedat themaximumofthelikelihoodvalue,
inCTSMdenotedasthenegativeobjetivefuntion. Sinetheaimistoidentify
theunertaintiesofthe individual estimatesof theparameters,it is neessary
tomakeadeompositionoftheovarianematrix,likein Equation4.31
Σ θ ˆ = σ θ ˆ Rσ θ ˆ
(4.31)Σ θ ˆ
isthediagonalmatrixofthestandarddeviationsoftheparameterestimatesand
R
is theorrelationmatrix. Theasymptoti Gaussianitydesribed above anbe appliedwhen testing forsignianeof theestimated parameters. Thenullhypothesisofthetestis:
H 0 : θ j = 0
(4.32)andthealternativehypothesisis:
H 1 : θ j 6 = 0
(4.33)Thiskindofhypothesis,whereitistestedwhetheraparameteranbeassumed
equalto aspei value,leads toa two-tailed test. This impliesthat the null
hypothesis isrejetedforvaluesoftheteststatistiplaedat eithertail-endof
itssamplingdistribution. The
Z
-valueisalulatedas:Z(ˆ θ j ) = θ ˆ j
σ θ ˆ j
(4.34)
θ ˆ j
andσ θ ˆ j
are both alulated in CTSM.
Z
belongs to a t-distribution with the degree of freedom equal to the number of observations, the length of thetimeseries, subtrated the numberof estimate parameters. Havingalulated
the
Z
-valueitispossibleto estimatetheprobability,p-value,oftheparameter beingequaltozero.Thetheoryisalsooutlinedin[Madsen&Holst2000℄and[Kristensen&Madsen
2003a℄.
4.2.2 Stable parameter estimates
WhenCTSMestimatestheparametersseveralvaluesareestimatedin parallel.
limits. In order to estimate the models in CTSM it is neessaryto dene an
intervalbyminimum,initialandmaximumvalues. Thelimitsaretheminimum
and maximum values. If the parameter estimate is well free of the limits, it
meansthattheparametersaresatisfatorilyestimated. Thevaluesthathaveto
beinvestigatedinordertodetermineiftheparametersareadequate,arestated
in thethree pointsbelow[Kristensen&Madsen2003b℄.
•
Thevalue of thepenalty funtion has to besigniantompared to thevalueoftheobjetivefuntion
• dP ar dF
,thederivativeoftheobjetivefuntionhastobelosetozero• dP en dP ar
,thederivativeofthepenaltyfuntionhastobesigniantomparedto
dF dP ar
If the three points above are not fullled it is neessary to loosen the intial
limits. Whenthenewlimitsaresetthemodelhasto bereestimated.
Alsotheorrelationmatrixof theparameterestimatesgivesindiationsabout
themodelestimationbeingappliable. Whenanalyzingtheorrelationvaluesin
CTSMasaruleofthumborrelationvaluesupto0.96areaeptable. Results
ontaining orrelation values above 0.96 is an indiation of the model being
overparameterized. Inthis aseit an beneessaryto remove oneormoreof
theparametersfromthemodel. Sinetheparametersareorrelateditisalways
preferabletoremoveoneparameteratatimestartingwiththeparameterhaving
thehighestp-value. Inspeialasespriorknowledgeabouttheparametersmay
leedtoanotherproedure.
4.2.3 Analysis of the residuals
After estimating and testing the parameters the last analysis that has to be
arriedouttoverifytheappliabilityofthemodelistheresidualanalysis. The
analysisoftheresidualsanbeused intwoways:
•
Tovalidateamodel•
Togiveinputastohowtofurther developthemodel in ordertogiveanimproveddesriptionofthedata
In this setion several dierent analyses of the residuals are examined. The
valueoftheoutputvariable, seeEquation4.35.
ǫ t (θ) = Y t − Y ˆ t | t − 1,θ
(4.35)Ifthe modelis adequatetheresidualsmustbewhitenoise. White noiseis
de-nedasbeingrandommutuallyunorrelatedidentially distributed stohasti
variableswithmeanvalue0andonstantvariane,
σ 2 ǫ
[Madsen2001℄. Dierentanalyses identify various interpretations of the residuals. This implies that it
is not suient to perform one ortwo of the analyses to get a harateristi
line of the residuals. If theanalysis of theresiduals provesthat theresiduals
anbeassumedtobedistributedlikewhitenoise,anditanbeonludedthat
the model ts the data well. In the opposite situation the residuals angive
guidelinesofhowto expandorhangethemodel.
Theinitialanalysisoftheresidualsistoplottheresidualversusthetime. This
plotmay reveal non-stationaritiesand potentialoutliers. When analyzingthe
residualsfurther,therearetwomainapproahes: atestinthetimedomainand
atest in thefrequenydomain. Dierentmethods in the twodomains will be
outlinedin thetwonextsetions.
4.2.3.1 Residualanalysisin the time domain
Test ofthe autoorrelationfuntion
Inonnetionwiththetimedomainteststhemostdominanttestistoplotthe
estimated autoorrelation funtion,
ρ ˆ ǫ
, with the approximate 95% ondene interval forthe time lags. The autoorrelation funtion mayreveal if someofthe variations in data are not desribed in the model, for instane periodial
tendenies. Thelimitsarefoundasthe
±
2standarddeviation. Themeanandvarianeoftheautoorrelationaregivenas:
e
[ ρ(k)] b ≃ 0; k 6 = 0,
(4.36)V [ ρ(k)] b ≃ 1/N; k 6 = 0.
(4.37)Iftheresidualsarewhitenoisetheautoorrelationfuntion isdenedas:
ˆ ρ ǫ (k) =
1 k = 0
0 k = ± 1, ± 2, . . .
Inmostasesnoteveryvalueoftheestimated autoorrelationfuntion,
ρ ˆ ǫ
,fork > 0
isexatlyzero. Thisisthereasonwhythe95%limitisusedfordeidingto alulatetheautoorrelationfuntion.
First theautoovarianefuntion needsto beintrodued,Equation4.38.
γ(k) =
Cov[X (t), X(t + k)]
(4.38)X (t)
isastationaryproess,t
isthetimeindiatorandk
denotesthetimelag.Whentheautoovarianefuntion hastobeworkedout,Equation4.39anbe
usedfordening theautoorrelationfuntion.
ρ(k) = γ(k)/γ(0)
(4.39)FromEquation4.39it isobviousthat
ρ(0) = 1
, f. the denition oftheauto-orrelationfuntion above.
Usingthetheoryabovetheautoovarianefuntionisalulatedinthefollowing
way:
C(k) = C(k) = 1 N
N X −| k | t=1
(Y t − Y )(Y t+ | k | − Y )
(4.40)for
| k | = 0, 1, . . . , N − 1
. Furthermore,Y = ( P N
t=1 Y t )/N
.Based ontheestimated autoovarianefuntion theestimated autoorrelation
funtion anbealulatedas:
ρ(k) = b r k = C(k)/C (0),
(4.41)Test ofthe partial autoorrelation funtion
Similartotheautoorrelationfuntion thepartialautoorrelationfuntion an
beusedfordetermining iftheestimatedmodelsareadequate. Thepartial
au-toorrelationfuntionisfavourableto unovertheneessityofaddinganextra
state to the model. The partial autoorrelation an be estimated when few
values need to be estimated by using the Yule-Walker equations. A
preva-lent numerial method is the reursive method desribed in the Appendix of
[Madsen2001℄.
Test ofhange in the signs
If the residualsare assumed to bewhite noisethe meanwill be loseto zero.
Onthis basisit mustbeassumedthat in averagethere willbeahangein the
signoftheresidualeveryseondtime,therefore
p = 1 2
. Sinethereareonlytwopossible outomes the hange in sign test is binomiallydistributed. As
men-tioned the probability of hange in sign will be loated lose to
1
2
, and whenthe numbers of residuals are high it is possible to approximate the binomial
distributionbyusingthenormaldistribution. Asaruleofthumbthisapproah
an be applied when
np
andn(1 − p)
are above 15. Whenp
hasto beloseto
1
2
, the numberof residuals just have to be above 30. TheZ
-value an bealulatedas:
Z = X − np p np(1 − p)
(4.42)
Torejetthenullhypohesis
p = 1 2 Z
shalleitherbelargerthanz α/2
orlessthan− z α/2
.α
isthelevelofsigniane. Thetheoryanbefoundin[Madsen2001℄.Portmanteaulak-of-t-testApartfromthetestoftheautoorrelation
fun-tionthePortmanteaulak-of-ttestanrevealifthevaluesofthe
autoorrela-tionfuntionarenotomplyingwiththerandomerror.
Q 2 = ( √
N ρ ˆ ǫ( ˆ θ) (1)) 2 + ( √
N ρ ˆ ǫ( ˆ θ) (2)) 2 + · · · + ( √
N ρ ˆ ǫ( ˆ θ) (k)) 2
(4.43)whih anbereduedto:
Q 2 = N X k i=1
ρ(i) 2
(4.44)N
isthenumberofobservations.k
isthenumberofonsideredautoorrelations.Textbooks suggest that theappropriatevalue of
k
lies within 15 and 30. Thealulatedvalueof
Q 2
hastobeweighedagainsttheχ 2
-distributionwithm − n
degreesoffreedom. Itis assumedthatthedistribution of
Q 2
is approximatelyχ 2
-distributed.n
isthenumberofestimatedparametersin themodel[Madsen2001℄.
4.2.3.2 Residualanalysisin the frequeny domain
Test in theumulatedperiodogram
All the previously mentioned analyses analyze the residuals in the time
do-main. Thenormalizedumulativeperiodogramisusedfortestingtheresiduals
in the frequeny domain. This test an reveal if there are any spei
ar-eas ofthefrequeny domainwhen theresidualsare over-represented. Suh an
over-representation ould be due to seasonalorperiodi skew behaviorof the
residuals. The variationof whitenoiseis uniformly distributed,whih implies
thatnofrequeniesoughttobeover-represented.Similartotheautoorrelation
funtion the periodogram ontains are 95% limit band. A straight line from
(0,0)to (0.5,1)inside thelimitin theperiodogramindiates thattheresiduals
arewhitenoise.
Theperiodogramisalulatedin thefollowingway: Theequationforthe
peri-odogramforthe residuals,
I(ν i )
, anbeseeninEquation4.45,havingthefre-quenies
ν i = N i
, wherei
isdened in thefollowinginterval;i = 0, 1, . . . , N/2
.N
denotesthetotalnumberofobservations.I(ν ˆ i ) = 1 N
X N
t=1
ǫ t cos2πν i t 2
+ X N
t=1
ǫ t sin2πν i t 2
(4.45)
I(ν ˆ i )
denotes the amount of variation ofǫ t
related to the frequenyν i
Thenormalizedperiodogramis
C(ν ˆ j ) = [ X j i=0
I(ν ˆ i )/
N
X 2
i=0
I(ν ˆ i )]
(4.46)The onndenelimitsforthe periodogram arealulatedby
± K ǫ
√ q
, where qisq = (n − 2 2)
forn
evenandq = (n − 2 1)
forn
odd. TheapproximatedoeientK ǫ
fortheprobabilitylimit5%is1.36[Box&Jenkins1976℄.