Biosens II Background Biosens II Subproject 2.3 Optimal - - PowerPoint PPT Presentation

biosens ii
SMART_READER_LITE
LIVE PREVIEW

Biosens II Background Biosens II Subproject 2.3 Optimal - - PowerPoint PPT Presentation

Biosens II Background Biosens II Subproject 2.3 Optimal replacement policies for dairy cows based on Overview daily yield measurements MDP intro Dairy HMDP Model Case example: Markov decision processes State space model Embedding


slide-1
SLIDE 1

Optimal replacement policies for dairy cows based on daily yield measurements

Case example: Markov decision processes

Lars R. Nielsen∗ and Erik Jørgensen

  • Dept. of Genetics and Biotechnology, University of Aarhus, Denmark

Søren Østergaard

  • Dept. of Animal Health, Welfare and Nutrition, University of Aarhus, Denmark

Anders R. Kristensen

  • Dept. of Large Animal Sciences, University of Copenhagen, Denmark

∗Contact: lars@relund.dk (www.research.relund.dk)

Biosens II

Background

→ Biosens II → Subproject 2.3

Overview MDP intro Dairy HMDP Model State space model Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 2 / 19

☞ Biosens II: Improved monitoring and management of dairy production based on on-farm biosensors ☞ Goal: Better detection of oestrus and illnesses ☞ Focus on biomarkers in milk (progesterone, LDH, yield, etc.) ☞ Commercial partner Lattec I/S (FOSS A/S and DeLaval AB) ☞ Five year project (2007-2011). Budget ≈5 mill EUR ☞ Commercial product Herd NavigatorTM based on Biosens project (www.herdnavigator.com)

Project 2.3: Economic value of the dairy cow

Life – Oct 16’th 2009 – 3 / 19

Find optimal strategy for each cow w.r.t. replacement, treatment and reproduction (economic point of view). ☞ Many papers about the dairy cow replacement problem but limited use in pratice. Reasons could be:

  • Often large and complex models.
  • Parameters in the model must be estimated, i.e. data collection frameworks

at herd level must exist.

  • Stage length: one month up to a year → no assistance when to inseminate,

treat or cull the cow in the current month. ☞ Bio-sensors and cow specific traits/interventions exists in modern dairy herds → parameters can be estimated on a daily basis. Develop MDP with daily stages based on daily yield measurements.

Problem, models and results

Background Overview

→ Problem and model

MDP intro Dairy HMDP Model State space model Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 4 / 19

Problem ☞ Assign an economic value to a dairy cow during lactation ☞ Calculate the optimal replacement strategy based on the economic value ☞ Assume daily yield measurements available Models ☞ Use a state space model (SSM) for predicting daily milk yield ☞ Use a Markov decision process (MDP) for calculating the optimal strategy with the SSM embedded Results ☞ A strategy saying whether to replace or keep the cow given its current state ☞ An economic value of the cow and forecast of the yield.

slide-2
SLIDE 2

What is an MDP?

Background Overview MDP intro

→ What is an MDP? → Hierarchical MDP

Dairy HMDP Model State space model Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 5 / 19

1 2 3 4 S1 S2 S3 S4

s1,1 s2,1 s3,1 s1,2 s2,2 s3,2 s1,3 s2,3 s3,3 s1,4 s2,4 s3,4 r p

What is an MDP?

Background Overview MDP intro

→ What is an MDP? → Hierarchical MDP

Dairy HMDP Model State space model Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 5 / 19

1 2 3 4 S1 S2 S3 S4

s1,1 s2,1 s3,1 s1,2 s2,2 s3,2 s1,3 s2,3 s3,3 s1,4 s2,4 s3,4

What is an MDP?

Background Overview MDP intro

→ What is an MDP? → Hierarchical MDP

Dairy HMDP Model State space model Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 5 / 19

1 2 3 4 S1 S2 S3 S4

s1,1 s2,1 s3,1 s1,2 s2,2 s3,2 s1,3 s2,3 s3,3 s1,4 s2,4 s3,4

Hierarchical MDP (HMDP)

Background Overview MDP intro

→ What is an MDP? → Hierarchical MDP

Dairy HMDP Model State space model Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 6 / 19

child process child process child process child process child processes

Level 0 Level 1 Level 2

slide-3
SLIDE 3

Lactation cycle of the cow

Background Overview MDP intro Dairy HMDP Model

→ Lactation cycle → Model overview → State variables → Rewards and prob

State space model Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 7 / 19

Pregnant Oesteus Pregnancy Dry period Calving Lactation Start insem Slut insem

Dairy model overview

Background Overview MDP intro Dairy HMDP Model

→ Lactation cycle → Model overview → State variables → Rewards and prob

State space model Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 8 / 19

☞ Formulate a hierarchical MDP (HMDP) based on lactation cycles

  • f the cow.

☞ Infinite time-horizon, Daily stages, 3 levels ☞ Decisions Replace, Keep and Dry ☞ Maximize the discounted net present reward of the cow

Level cow 1 cow 2 cow 3 cow 4 cow 5 1 parity 1 parity 2 parity 3 parity 10 2

replace replace dry new cow new cow insemination starts insemination ends calving calving

Rewards and transition probabilities

Background Overview MDP intro Dairy HMDP Model

→ Lactation cycle → Model overview → State variables → Rewards and prob

State space model Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 10 / 19

Transition probabilities are a found using ☞ The SSM milk yield model ☞ A reproduction model ☞ An IC model The net reward is a combination of ☞ Milk yield ☞ The calf ☞ Beef ☞ Feeding and treatment costs

SSM models

Background Overview MDP intro Dairy HMDP Model State space model

→ SSM Formulation → Yield SSM → Kalman filter

Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 11 / 19

☞ ... or dynamic linear models are models of phenomena evolving in time e.g. blood pressure and milk yield.

Yt-1 Yt Yt+1

☞ Latent process evolves as a first order Markov process.

θt = Gθt−1 + ωt, (θt | θt−1) ∼ N (Gθt−1, W)

☞ Yt are observations which we model as a function depending on

θt. Yt = F ′θt + νt, (Yt | θt) ∼ N

  • F ′θt, V
slide-4
SLIDE 4

Milk yield SSM

Background Overview MDP intro Dairy HMDP Model State space model

→ SSM Formulation → Yield SSM → Kalman filter

Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 12 / 19

Observed milk yield intensity

Mtc = µt + Ac + Xtc + νtc

t milk yield 10 20 30 40 50 60 50 100 150 200 250 1 50 100 150 200 250 2 50 100 150 200 250 3 M t µt

Milk yield SSM

Background Overview MDP intro Dairy HMDP Model State space model

→ SSM Formulation → Yield SSM → Kalman filter

Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 12 / 19

Observed milk yield intensity

Mtc = µt + Ac + Xtc + νtc

Subtract herd effect (remove index c)

Yt = Mt − µt = F ′θt + νt = ( 1 1 ) A Xt

  • + νt

θt = Gθt−1 + ωt = 1 ρ A Xt−1

  • +

ǫt

  • where

(θt | Y0, . . . , Yt) ∼ N(mt, Ct)

t milk yield 10 20 30 40 50 60 50 100 150 200 250 1 50 100 150 200 250 2 50 100 150 200 250 3 M t µt

Milk yield SSM

Background Overview MDP intro Dairy HMDP Model State space model

→ SSM Formulation → Yield SSM → Kalman filter

Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 12 / 19

Observed milk yield intensity

Mtc = µt + Ac + Xtc + νtc

Subtract herd effect (remove index c)

Yt = Mt − µt = F ′θt + νt = ( 1 1 ) A Xt

  • + νt

θt = Gθt−1 + ωt = 1 ρ A Xt−1

  • +

ǫt

  • where

(θt | Y0, . . . , Yt) ∼ N(mt, Ct)

t milk yield 10 20 30 40 50 60 50 100 150 200 250 1 50 100 150 200 250 2 50 100 150 200 250 3 M t µt t residual milk yield −20 −10 10 20 30 50 100 150 200 250 1 50 100 150 200 250 2 50 100 150 200 250 3 Y t E(Y t | D t−1) E(A 3 | D t−1)

Applying the Kalman filter

Background Overview MDP intro Dairy HMDP Model State space model

→ SSM Formulation → Yield SSM → Kalman filter

Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 13 / 19

Dt−1: data up to time t − 1. Fact: (θt−1 | Dt−1) ∼ N(mt−1, Ct−1)

5 10 15 20 25 30 35 −1.0 −0.8 −0.6 −0.4 −0.2 0.0 0.2 TFC Data θ est. Y est.

slide-5
SLIDE 5

Applying the Kalman filter

Background Overview MDP intro Dairy HMDP Model State space model

→ SSM Formulation → Yield SSM → Kalman filter

Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 13 / 19

Given (θt−1 | Dt−1) ∼ N(mt−1, Ct−1) we have that

(Yt | Dt−1) ∼ N(f(mt−1), Qt)

5 10 15 20 25 30 35 −1.0 −0.8 −0.6 −0.4 −0.2 0.0 0.2 TFC Data θ est. Y est.

Applying the Kalman filter

Background Overview MDP intro Dairy HMDP Model State space model

→ SSM Formulation → Yield SSM → Kalman filter

Embedding the SSM HMDP results Status/future work Life – Oct 16’th 2009 – 13 / 19

Given (θt−1 | Dt−1) ∼ N(mt−1, Ct−1) we have that

(Yt | Dt−1) ∼ N(f(mt−1), Qt)

5 10 15 20 25 30 35 −1.0 −0.8 −0.6 −0.4 −0.2 0.0 0.2 TFC Data θ est. Y est.

Embedding the SSM into a MDP

Background Overview MDP intro Dairy HMDP Model State space model Embedding the SSM

→ Overview → Uniform → Non-uniform

HMDP results Status/future work Life – Oct 16’th 2009 – 14 / 19

☞ Can find P(mt+1 | mt) if store the mean mt and variance Ct in each state. ☞ Discrete states → discretize mt with { ˜

m(1), . . . , ˜ m(q)} and

calculate P( ˜

m(i)

t+1 | ˜

m(j)

t )

☞ Discretization can be done uniform or non-uniform. (mt = (E(At), E(Xt))).

Embedding the SSM into a MDP

Background Overview MDP intro Dairy HMDP Model State space model Embedding the SSM

→ Overview → Uniform → Non-uniform

HMDP results Status/future work Life – Oct 16’th 2009 – 14 / 19

☞ Can find P(mt+1 | mt) if store the mean mt and variance Ct in each state. ☞ Discrete states → discretize mt with { ˜

m(1), . . . , ˜ m(q)} and

calculate P( ˜

m(i)

t+1 | ˜

m(j)

t )

☞ Discretization can be done uniform or non-uniform. (mt = (E(At), E(Xt))).

slide-6
SLIDE 6

Embedding the SSM into a MDP

Background Overview MDP intro Dairy HMDP Model State space model Embedding the SSM

→ Overview → Uniform → Non-uniform

HMDP results Status/future work Life – Oct 16’th 2009 – 14 / 19

☞ Can find P(mt+1 | mt) if store the mean mt and variance Ct in each state. ☞ Discrete states → discretize mt with { ˜

m(1), . . . , ˜ m(q)} and

calculate P( ˜

m(i)

t+1 | ˜

m(j)

t )

☞ Discretization can be done uniform or non-uniform. (mt = (E(At), E(Xt))).

Uniform discretization

Background Overview MDP intro Dairy HMDP Model State space model Embedding the SSM

→ Overview → Uniform → Non-uniform

HMDP results Status/future work Life – Oct 16’th 2009 – 15 / 19

Discretize every variable separately (many states, independent of ˜

m(·)).

−5 5 10 2 4 6 8 x y x y 2 4 6 8 − 5 5 1

−10 −5 5 10 15 2 4 6 8

KL = 0.482 , i = 800

Non-uniform discretization

Background Overview MDP intro Dairy HMDP Model State space model Embedding the SSM

→ Overview → Uniform → Non-uniform

HMDP results Status/future work Life – Oct 16’th 2009 – 16 / 19

Discretize the regions of the density (fewer states, dependent on ˜

m(·)).

−5 5 10 2 4 6 8 x y x y 2 4 6 8 − 5 5 1

−15 −10 −5 5 10 15 −15 −10 −5 5 10 15 m1 m2

Status

Background Overview MDP intro Dairy HMDP Model State space model Embedding the SSM HMDP results Status/future work

→ Status → Extensions

Life – Oct 16’th 2009 – 18 / 19

☞ Model running (Linux) using MLHMP Java library. ☞ Manuscript accepted in JDS. ☞ Currently working on evaluating different reproduction strategies in the model. Challenge: Number of state variables (complexity) ☞ Other spinoffs: A MDP and dairy package in R.