SlideShare a Scribd company logo
Where in the World is
Carmen Sandiego?
How Kalman can help find Carmen
Carmen’s True Path
Tim
T=1
T=3
T=4
T=5
Sightings
Tim
True positions
are in 2-d but
shown in 1-d
here
Estimation: Where is Carmen?
At each time point estimate her current
position (distribution)
Combine info from current sighting
with past ones
Why are past sightings important?
Carmen’s moves have only a
limited speed
See slide “Dynamics: How Carmen
Moves”
Y
X more likely at
T=2 than Y X
Key aspects of estimation
All sightings compete to contribute to estimates
Contribution weights determined by recency
Greater concordance of sightings improves accuracy
Putting some FLESH
ON THE BONE
Sightings II
Tim
Density falls
off as we
move away
from the
middle
Sighting
distribution
centered at
true position
Sighting
distributions
are normal
2-d positions
DynaMICS: How Carmen MOves
In the present case we model it as a random walk
Pt = (xt, yt)
Pt+1 = Pt + 𝝐
𝝐 ~ 𝒩(0, σ2 I)
estimation IS RECURSIVE
Prior At time t, we have prob dist Pt
Evidence sightings Sgtt
Posterior Pt+1= Bayes update of Pt by Sgtt
Calculations easier if measurement error is normal
Pt+1 is our estimate of Carmen’s position at time t+1
Predict-Measure-Correct
Post mean estimate of position at time t
Predict Use model of Carmen’s movement to predict position
Predt+1
Measure observed position (sighting) Sgtt+1
Errort+1=Sgtt+1- Predt+1
Correct Post+1 = Predt+1 + Kt+1 Errort+1
GEneralizing to a
framework:
STATE SPACE
REPRESENTATION
STATES
Hidden state Carmen’s position -- unknown except through noisy
measurements (sightings)
State can be a vector
Classical particle: kinematic state
Fair values for stocks in a basket
DYNAMICS
State Update Equations Stochastic and Linear
St+1 = G St + 𝝐
𝝐 ~ 𝒩(𝛍, 𝛀)
In Carmen’s case
G=I
𝛍=0, 𝛀=𝞂2I
Measurement
Measurements are generally noisy
Example: Carmen’s sightings = true position + Gaussian
noise
Sometimes we can only measure a function of the state
Example: iPhone accelerometer measures only
acceleration part of state
In general, we have Observation Equations
Predict-Measure-Correct II
Ss@t estimate of time-s state @time=t
Predict Use dynamics to predict (at time t) mean state at time t+1
St+1@t = G St@t
Measure Ot+1
Errort+1=Ot+1- St+1@t
Correct St+1@t+1= St+1@t + Kt+1 Errort+1
Where Can we APplY THis
A bit different from other types of signal processing filters (eg Fourier filters, PCA
filtering)
We need a model of hidden state dynamics
Linear state updates
Normally distributed updating noise
We need a model of measurement and errors
Observations = Linear function of state
Normally distributed measurement noise
Need to spec
parameters
State update eqns
Observation equations
For a deeper dive
There are many excellent articles. As usual, Wikipedia is a pretty good source.
Here is one of my favorites:
Richard J. Meinhold and Nozer D. Singpurwalla Understanding the Kalman Filter.
The American Statistician, Vol. 37, No. 2. (May, 1983), pp. 123-127.
I have written a Jupyter notebook that lets you play around with the filter for a simple
physics application.
APPLICATION:
NOWCASTING GDP
Nowcasting
Key economic statistics like GDP growth rate delayed
“Higher-frequency” data released on GDP components
Production components like Industrial Production
Demand components like Personal Consumption
Challenges
Differing frequencies of releases
Observation Variables
Examples
Durable Goods Inventories Manufacturing monthly
Personal Consumption Retail & Consumption monthly
Disposable Personal Income Income monthly
Imports Trade monthly
Initial Jobless Claims Labor weekly
Nowcasting Modeling
Model a proxy for GDP growth rate, R, as the hidden state variable
Possible dynamics of R
Random walk
VAR (vector autoregression) model
Rt = a1Rt-1 + a2Rt-2+.. + 𝝐
Each observation has a measurement equation
Model must specify as, ws, 𝝐-
variances, and 𝝐i-covariances.
Estimating GDP growth rate
As observations flow in, the Kalman filter is used to update R
Hidden variable R is only a proxy for the GDP growth rate
Use regression to estimate the GDP growth rate
Average instantaneous growth rates to nowcast quarter growth
rate

More Related Content

Similar to Kalman filtering

Sea Lamprey Locomotion
Sea Lamprey LocomotionSea Lamprey Locomotion
Sea Lamprey Locomotion
sheilsn
 
Quicksort analysis
Quicksort analysisQuicksort analysis
Quicksort analysis
Premjeet Roy
 

Similar to Kalman filtering (20)

MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...
MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...
MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...
 
Ch 8 Slides.doc28383&3&3&39388383288283838
Ch 8 Slides.doc28383&3&3&39388383288283838Ch 8 Slides.doc28383&3&3&39388383288283838
Ch 8 Slides.doc28383&3&3&39388383288283838
 
Sea Lamprey Locomotion
Sea Lamprey LocomotionSea Lamprey Locomotion
Sea Lamprey Locomotion
 
Deep Learning Opening Workshop - Statistical and Computational Guarantees of ...
Deep Learning Opening Workshop - Statistical and Computational Guarantees of ...Deep Learning Opening Workshop - Statistical and Computational Guarantees of ...
Deep Learning Opening Workshop - Statistical and Computational Guarantees of ...
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
Signals and System
Signals and SystemSignals and System
Signals and System
 
LECTURES summary .ppt
LECTURES summary .pptLECTURES summary .ppt
LECTURES summary .ppt
 
MCQMC 2020 talk: Importance Sampling for a Robust and Efficient Multilevel Mo...
MCQMC 2020 talk: Importance Sampling for a Robust and Efficient Multilevel Mo...MCQMC 2020 talk: Importance Sampling for a Robust and Efficient Multilevel Mo...
MCQMC 2020 talk: Importance Sampling for a Robust and Efficient Multilevel Mo...
 
Signals and system
Signals and systemSignals and system
Signals and system
 
On probability distributions
On probability distributionsOn probability distributions
On probability distributions
 
1. analisis dimensional
1.  analisis dimensional1.  analisis dimensional
1. analisis dimensional
 
Quicksort analysis
Quicksort analysisQuicksort analysis
Quicksort analysis
 
Selm Falzon Compressed
Selm Falzon CompressedSelm Falzon Compressed
Selm Falzon Compressed
 
R user group presentation
R user group presentationR user group presentation
R user group presentation
 
Recursive State Estimation AI for Robotics.pdf
Recursive State Estimation AI for Robotics.pdfRecursive State Estimation AI for Robotics.pdf
Recursive State Estimation AI for Robotics.pdf
 
Slides erasmus
Slides erasmusSlides erasmus
Slides erasmus
 
ssppt-170414031953.pptx
ssppt-170414031953.pptxssppt-170414031953.pptx
ssppt-170414031953.pptx
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Frequency Estimation
Frequency EstimationFrequency Estimation
Frequency Estimation
 
Slides ineq-4
Slides ineq-4Slides ineq-4
Slides ineq-4
 

Recently uploaded

Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
muralinath2
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
Scintica Instrumentation
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Sérgio Sacani
 
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Sérgio Sacani
 
Plant Biotechnology undergraduates note.pptx
Plant Biotechnology undergraduates note.pptxPlant Biotechnology undergraduates note.pptx
Plant Biotechnology undergraduates note.pptx
yusufzako14
 
Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
muralinath2
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
AADYARAJPANDEY1
 

Recently uploaded (20)

Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
 
insect taxonomy importance systematics and classification
insect taxonomy importance systematics and classificationinsect taxonomy importance systematics and classification
insect taxonomy importance systematics and classification
 
Transport in plants G1.pptx Cambridge IGCSE
Transport in plants G1.pptx Cambridge IGCSETransport in plants G1.pptx Cambridge IGCSE
Transport in plants G1.pptx Cambridge IGCSE
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 
GEOLOGICAL FIELD REPORT On Kaptai Rangamati Road-Cut Section.pdf
GEOLOGICAL FIELD REPORT  On  Kaptai Rangamati Road-Cut Section.pdfGEOLOGICAL FIELD REPORT  On  Kaptai Rangamati Road-Cut Section.pdf
GEOLOGICAL FIELD REPORT On Kaptai Rangamati Road-Cut Section.pdf
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
FAIRSpectra - Towards a common data file format for SIMS images
FAIRSpectra - Towards a common data file format for SIMS imagesFAIRSpectra - Towards a common data file format for SIMS images
FAIRSpectra - Towards a common data file format for SIMS images
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 
Citrus Greening Disease and its Management
Citrus Greening Disease and its ManagementCitrus Greening Disease and its Management
Citrus Greening Disease and its Management
 
insect morphology and physiology of insect
insect morphology and physiology of insectinsect morphology and physiology of insect
insect morphology and physiology of insect
 
Seminar of U.V. Spectroscopy by SAMIR PANDA
 Seminar of U.V. Spectroscopy by SAMIR PANDA Seminar of U.V. Spectroscopy by SAMIR PANDA
Seminar of U.V. Spectroscopy by SAMIR PANDA
 
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
 
SAMPLING.pptx for analystical chemistry sample techniques
SAMPLING.pptx for analystical chemistry sample techniquesSAMPLING.pptx for analystical chemistry sample techniques
SAMPLING.pptx for analystical chemistry sample techniques
 
Plant Biotechnology undergraduates note.pptx
Plant Biotechnology undergraduates note.pptxPlant Biotechnology undergraduates note.pptx
Plant Biotechnology undergraduates note.pptx
 
Anemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditionsAnemia_ different types_causes_ conditions
Anemia_ different types_causes_ conditions
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
 

Kalman filtering

  • 1. Where in the World is Carmen Sandiego? How Kalman can help find Carmen
  • 3. Sightings Tim True positions are in 2-d but shown in 1-d here
  • 4. Estimation: Where is Carmen? At each time point estimate her current position (distribution) Combine info from current sighting with past ones Why are past sightings important? Carmen’s moves have only a limited speed See slide “Dynamics: How Carmen Moves” Y X more likely at T=2 than Y X
  • 5. Key aspects of estimation All sightings compete to contribute to estimates Contribution weights determined by recency Greater concordance of sightings improves accuracy
  • 7. Sightings II Tim Density falls off as we move away from the middle Sighting distribution centered at true position Sighting distributions are normal 2-d positions
  • 8. DynaMICS: How Carmen MOves In the present case we model it as a random walk Pt = (xt, yt) Pt+1 = Pt + 𝝐 𝝐 ~ 𝒩(0, σ2 I)
  • 9. estimation IS RECURSIVE Prior At time t, we have prob dist Pt Evidence sightings Sgtt Posterior Pt+1= Bayes update of Pt by Sgtt Calculations easier if measurement error is normal Pt+1 is our estimate of Carmen’s position at time t+1
  • 10. Predict-Measure-Correct Post mean estimate of position at time t Predict Use model of Carmen’s movement to predict position Predt+1 Measure observed position (sighting) Sgtt+1 Errort+1=Sgtt+1- Predt+1 Correct Post+1 = Predt+1 + Kt+1 Errort+1
  • 11. GEneralizing to a framework: STATE SPACE REPRESENTATION
  • 12. STATES Hidden state Carmen’s position -- unknown except through noisy measurements (sightings) State can be a vector Classical particle: kinematic state Fair values for stocks in a basket
  • 13. DYNAMICS State Update Equations Stochastic and Linear St+1 = G St + 𝝐 𝝐 ~ 𝒩(𝛍, 𝛀) In Carmen’s case G=I 𝛍=0, 𝛀=𝞂2I
  • 14. Measurement Measurements are generally noisy Example: Carmen’s sightings = true position + Gaussian noise Sometimes we can only measure a function of the state Example: iPhone accelerometer measures only acceleration part of state In general, we have Observation Equations
  • 15. Predict-Measure-Correct II Ss@t estimate of time-s state @time=t Predict Use dynamics to predict (at time t) mean state at time t+1 St+1@t = G St@t Measure Ot+1 Errort+1=Ot+1- St+1@t Correct St+1@t+1= St+1@t + Kt+1 Errort+1
  • 16. Where Can we APplY THis A bit different from other types of signal processing filters (eg Fourier filters, PCA filtering) We need a model of hidden state dynamics Linear state updates Normally distributed updating noise We need a model of measurement and errors Observations = Linear function of state Normally distributed measurement noise Need to spec parameters State update eqns Observation equations
  • 17. For a deeper dive There are many excellent articles. As usual, Wikipedia is a pretty good source. Here is one of my favorites: Richard J. Meinhold and Nozer D. Singpurwalla Understanding the Kalman Filter. The American Statistician, Vol. 37, No. 2. (May, 1983), pp. 123-127. I have written a Jupyter notebook that lets you play around with the filter for a simple physics application.
  • 19. Nowcasting Key economic statistics like GDP growth rate delayed “Higher-frequency” data released on GDP components Production components like Industrial Production Demand components like Personal Consumption Challenges Differing frequencies of releases
  • 20. Observation Variables Examples Durable Goods Inventories Manufacturing monthly Personal Consumption Retail & Consumption monthly Disposable Personal Income Income monthly Imports Trade monthly Initial Jobless Claims Labor weekly
  • 21. Nowcasting Modeling Model a proxy for GDP growth rate, R, as the hidden state variable Possible dynamics of R Random walk VAR (vector autoregression) model Rt = a1Rt-1 + a2Rt-2+.. + 𝝐 Each observation has a measurement equation Model must specify as, ws, 𝝐- variances, and 𝝐i-covariances.
  • 22. Estimating GDP growth rate As observations flow in, the Kalman filter is used to update R Hidden variable R is only a proxy for the GDP growth rate Use regression to estimate the GDP growth rate Average instantaneous growth rates to nowcast quarter growth rate