alman filering maimum likelihood esimaion given corruped observaions... Holmes Naional Marine isheries Service Inroducion he alman filer is used o eend likelihood esimaion o cases wih hidden saes such as when observaions are corruped and he rue populaion size is unobserved. he following algorihm is based on secion 3.4 in Harve 989 which was used b Lindle 003 esimaion populaion processes. he alman filer is well-known and widel used in engineering and compuer science applicaions. here are a muliude of books on he alman filer including Harve 989. One of he more penerable inroducions of he alman filer alone bu no on maimum likelihood esimaion is chaper of Mabeck 979. he sae-space model he diffusion approimaion a sochasic eponenial growh model can be wrien as a linear sae space model wrien in he noaion familiar in he engineering lieraure: B w where w ~ normal0 Q [] v where v ~ f 0 R [] where log N is he rue log populaion size and log O is he log observaions of he populaion size. B is µ he mean populaion growh rae. Q is he σ oherwise known as he process error or environmenal variabili. R is he variabili associaed wih sampling error or oher non-process error. Onl is observed; he underling parameers B Q and R and he underling rue populaion size is hidden. If we make he assumpion ha v is normall disribued hen he model is a linear Gaussian sae-space model.
We can calculae he probabili of he observed ime series as follows: [3] where is he probabili of given all he observaions bee ime and 0. Denoe he epeced value of as ~. he condiional probabili is disribued normal wih a mean ~ and some variance denoed which depends on he paricular parameers Ψ B Q R ha generaed he daa. hus he probabili of he ime series given a paricular se of parameers Ψ is Ψ d / ~ ep ϑ π [4] from he probabili densi of a normal wih mean ~ and variance. he log likelihood of ψ given he daa is Ψ L ~ log log log π a consan. [5] or qn. 5 we need esimaes of ~ and. Observe from qn. ha R [6] he alman filer below gives opimal esimaes of and which are hen used in qn. 5 o calculae he log likelihood of ψ.
he maimum likelihood esimaes of B Q and R are found b using some pe of maimizaion rouine on qn. 6 o find he se of parameers ψ B Q R ha maimize he likelihood. Malab code his algorihm is given a he end of his appendi. he alman filer irs some noaion: ] [ ] [ he alman recursion: Sar a and sep ward o. Assume an iniial π and iniial 0 o sar he recursion. One could le hese be free variables and find he maimum likelihood values when maimizing qn. 6 bu ha is no done here and he algorihm should no be ver sensiive o hese saring values. A each sep compue: > > R Q B π his is he well-known alman filer bu i looks a lile differen han wha ou ll see in engineering es. irs generall i is assumed ha is a series of measuremens from muliple insrumens hus he alman filer is alwas wrien in mari m. Here since is one measuremen i can be wrien in scalar m. Second he alman filer is usuall presened
he model A Bu w filer is simplified quie a bi. C v. In his applicaion A C and u so he References Harve A. C. 99. orecasing srucural ime series models and he alman filer. Cambridge Universi ress Cambridge U. Mabeck. S. 979. Sochasic models esimaion and conrol. olume. Academic ress New York USA. Malab code funcion [musigmasigmanp]kalman_essdaa logdaa; %Sar wih some reasonable iniial parameer esimaes muesmean:end-:end-; mpvar:end-:end-; mp4var5:end-:end-4; sigmaesmp4-mp/3; sigmanpesvar:end-:end--ma0.000sigmaes/; pima0.000sigmaesma0.000sigmanpes; %var of %log ransm he variances so he search algorihm doesn give negaive % variances sarvals[mues logma0.000sigmaes logma0.000sigmanpes]; %fminsearch is a Nelder-Mead minimizaion malab funcion afminsearch'kalman_loglik'sarvals[]pi; MLmuesa; MLsigmaesepa; MLsigmanpesepa3; funcion negloglik kalman_loglikvini lengh; B v; %mu Q epv; %s R epv3; %snp %iniialize zeros; zeros; zeros; zeros; zeros; zeros; Jzeros; zeros;
zeros; vzeros; %ward pass ges ou [ given :] 0ini; 0; : if ini; %denoes _^0 ; %denoes _^0 else - B; % denoes _^-; Harve 3..a - Q; %Harve 3..b end /R; R; v -; * - ; %Harve 3..3a -*; %Harve 3.3.3b end %Calculae negaive log likelihood negloglik /*sumv.^./ /*sumlogabs /*log*pi;