Recent developments in Kalman Filter analysis of track data · PFRP Principal Investigators...
Transcript of Recent developments in Kalman Filter analysis of track data · PFRP Principal Investigators...
Recent developments in Kalman Filter analysisof track data
Anders Nielsen
December 2002
Acknowledgments: John R. Sibert, Michael K. Musyl, Yonat Swimmer, and Molly Lutcavage.
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
1
Background: Fish stock assessment
• Deterministic models are still used
• Stochastic models are under development
• Hundreds of model parameters
• Huge uncertainties
• Migration and heterogeneity is most often ignored.
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
2
Models for migration
• Stochastic differential equations at the individual level(
dxt = αdt +√
2DdBt
)
• Partial differential equations at population level(
∂∂t Nx,t = −α ∂
∂xNx,t +D ∂2
∂x2 Nx,t
)
One fish Numerous fish Population
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
3
266 268 270 272 274
810
1214
1618
Longitude
Latit
ude
Track of Olive Ridley 13112
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
4
State equation (describing the movements)
αi = αi−1 + ci +ηi
Here:
• αi is current position (x,y) in Nautical miles from (0,0)
• αi−1 is previous position
• ci = ∆ti(u
v
)
is drift (or preferred movement)
• ηii.d.∼ N(0,2D∆ti · I2×2) is random movement
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
5
Space equation (translation from position to observation)
yi = z(αi)+di + εi
• z(αi) = 160
( αi,1cos(αi,2π/180/60)
αi,2
)
converts state coordinates to longitude and latitude
• di =(
bxby
)
is observation bias
• εii.d.∼ N
(
0,
(
σ2x 0
0 σ2yi
))
is observation error
z
0
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
6
The Kalman Filter
• First observation is know without error
• Second observation
– predict from model, parameters and previous observation
– calculate the difference w2 = (obs2−pred2) and its variance F2
– find best prediction as weighted average of prediction and observation
• Third, then fourth, ...
– like second.
The negative log likelihood becomes:
− logL(X|(u,v,D,bx,by,σ2x,σ
2y, . . .)) = T log(2π)+0.5∑ log(|Fi|)+0.5∑w′
iFiwi
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
7
266 268 270 272 274
810
1214
1618
Longitude
Latit
ude
Predicted track of Olive Ridley 13112
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
8
Most probable track
• Best predicted track points are calculated from previous points only.
ai = E{αi|y1 . . .yi}
• Most probable track points use entire track.
ai|T = E{αi|y1 . . .yT}
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
9
266 268 270 272 274
810
1214
1618
Longitude
Latit
ude
Most probable track of Olive Ridley 13112
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
10
Searching for premature pop–off point
• Important in itself
• First step in identifying behavior switching
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
11
The pop–off model
• Different movement pattern only changes the state equation
• New parameters are: u1, u2, v1, v2, D1, D2 and the pop–off time τ
• Consider for instance D in the interval from ti−1 to ti
– if τ ≤ ti−1 then D = D2
– if τ ≥ ti then D = D1
– if ti−1 < τ < ti then D =τ−ti−1ti−ti−1
D1 + ti−τti−ti−1
D2
t i−2 t i−1 τ t i t i+1
• Same for u and v.
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
12
Reminder: Likelihood ratio test
• Assume model M2 is a sub–model of model M1
– for instance like the basic model is a sub–model of the pop–off model
• Test ratio:
QM1→M2 =LM2(X |θ2)
LM1(X |θ1)
• Test probability:
P-valueM1→M2
app.= P(χ2
nM1−nM2≥−2log(QM1→M2))
• Reject the hypothesis that M2 describes the data as well as M1 if the P-value is below some threshold
(often 5%).
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
13
0 50 100 150
290
310
Days at liberty
Long
itude
Latit
ude
0 50 100 150
3040
Days at liberty
−lo
g lik
elih
ood
415
425
8Oct
99
27N
ov99
16Ja
n200
0
6Mar
2000
Date
290 300 310 320
3035
4045
Logitude
Latit
ude
Estimated track of Bluefin.4934
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
14
Future plans for the KF-track
• Pack it as a documented R-package
• Several segments
• Several tracks
• Include temperature information
• Robust estimation
• . . .
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
15
Preview of the R-package
A typical session could be:
• Load the package into R
R> library(kftrack)
• Read in data, for instance from a simple text file
R> OR.13112 <- read.table("13112.dat", header = TRUE)
R> OR.13112[1:3, ]
day month year lon lat
1 29 11 2001 273.4148 10.4557
2 3 12 2001 273.6600 13.1300
3 4 12 2001 274.0100 13.6800
• Run and save the desired model fit
R> fit.13112 <- kftrack(OR.13112, fix.last = TRUE, var.struct = "uniform")
possibly with more options.
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
16
R> fit.13112
#R-KFtrack fit
#Tue Dec 3 12:57:23 2002
#Number of observations: 57
#Negative log likelihood: 211.815
#The convergence criteria was met
Parameters:
u v D bx by sx sy
Estimates: -6.32409 -1.37745 449.382 0.0683247 1.33927 0.894642 2.01884
Std. dev.: 3.90260 3.90300 195.680 0.6452700 0.85168 0.120750 0.21439
This object contains the following sub-items:
[1] "npar" "nlogL" "max.grad.comp" "estimates"
[5] "std.dev" "nominal.track" "pred.track" "most.prob.track"
[9] "days.at.liberty" "date" "spd" "hdg"
[13] "nobs" "header" "fix.first" "fix.last"
[17] "theta.active" "theta.init" "var.struct" "dev.pen"
[21] "call" "data.name"
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
17
R> plot(fit.13112)
R> addmap(fit.13112)
0 10 20 30 40 50 60
266
270
274
Days at liberty
Long
itude
Latit
ude
812
16
29N
ov20
01
9Dec
2001
19D
ec20
01
29D
ec20
01
8Jan
2002
18Ja
n200
2
28Ja
n200
2
Date
266 268 270 272 2748
1012
1416
18
Logitude
Latit
ude
Estimated track of OR.13112
c© Anders Nielsen, December 2002
PFRP Principal Investigators Workshop
18