Simulation II An infinite population of flocks each having its own - - PDF document

simulation ii
SMART_READER_LITE
LIVE PREVIEW

Simulation II An infinite population of flocks each having its own - - PDF document

State of Nature concept The Hyper distribution: Simulation II An infinite population of flocks each having its own state of nature defining average growth, mortality, SimFlock laying performance etc. McAinsh CV & Kristensen AR, 2004


slide-1
SLIDE 1

1

Advanced Herd Management Jehan Ettema

Simulation II

SimFlock

McAinsh CV & Kristensen AR, 2004

State of Nature concept

  • We can draw as many random (but realistic!) flocks from the hyper

distribution as we wish The Hyper distribution: An infinite population of flocks each having its own state of nature defining average growth, mortality, laying performance etc.

Flock 1 Flock 2 Flock 3 Flock 4

SimFlock: an object oriented model

User interface: visible objects

All birds and eggs are presented with their states Icons for altering decision variables

SimFlock: Elements – where are they?

Decision rule Θ State of Nature Φ0 Hyper distribution P(Φ0=φ0 ) State variables Φs1, Φs2,...,ΦsT Output variables Ω

SimFlock: Decision variables Θ

Built-in decisions (farmer icon):

Intended flock size: Hens Cocks Egg removing policy: Days from start laying Season Policy for buying breeding birds Hens Cocks

Other decisions are modeled through expected effects (e.g. on mortality)

slide-2
SLIDE 2

2

SimFlock: State of Nature Parameters

  • In SimFlock, a state of nature is described by 42

parameters:

Survival rates, logistic model

Logit (pij) = µ + αj + Fi + (αF)ij

µ = intercept

α1, α2 ,α 3,α 4 are the systematic effects of bird groups (i.e. chick,

growers, pullets and cockerels) Fi ~ N(0,σF) is the random effect of flock (αF)ij ~ N(0, σαF) is the random interaction between flock and bird group

The SimFlock survival rate model

Hyper parameters in Simflock: Intercept: µ: 0.2526 Effect chick:

α1: 0.559

Effect grower:

α2: -0.398

Effect pullet:

α 3: 0.000

Effect cockerel:

α 4: 0.000

Random effect flock:

σF: 0.156

Fi ~ N(0,0.156) Random interaction:

σαF: 0.557

(αF)ij ~ N(0, 0.557)

Logit (pij) = µ + αj + Fi + (αF)ij µ = intercept

α1, α2 ,α 3,α 4 systematic effects of bird groups

Fi ~ N(0,σF) random effect of flock

(αF)ij ~ N(0, σαF) random interaction flock and bird group

The SimFlock survival rate model

Logit (p11) = µ + α1 + F1 + (αF)11 : mortality chick (group 1), in flock 1 Hyper parameters in Simflock: Intercept: µ: 0.2526 Effect chick:

α1: 0.559

Random effect flock: F1 ~ N(0,0.156): draw sample > 0.111 Random interaction:

(αF)11 ~ N(0, 0.557) draw sample > -0.222

Logit (p11) = 0.2526 + 0.559 + 0.111 + -0.222 Logit (p11) = 0.7006 = yij P11 =1/(e-y

ij + 1) = 0.668 = survival rate for chick:

1 parameter of the State of Nature...1 down, 41 to go!

The SimFlock survival rate model

Logit (p11) = µ + α1 + F1 + (αF)11 : mortality chick (group 1), in flock 1 Hyper parameters in Simflock: Intercept: µ: 0.2526 Effect chick:

α1: 0.559

Random effect flock: F1 ~ N(0,0.156): draw sample > 0.050 Random interaction:

(αF)11 ~ N(0, 0.557) draw sample > 0.345

Logit (p11) = 0.2526 + 0.559 + 0.050 + 0.345 Logit (p11) = 1.2066 = yij P11 =1/(e-y

ij + 1) = 0.770 = survival rate for chick:

SimFlock: State of Nature Parameters

  • In SimFlock, a state of nature is described by 42

parameters:

Daily gains of birds, general linear model Yijk = µ + αi + Fj + (αF)ij + BK Egg fertilization probability, beta distribution

Beta ~ (a,b)

SimFlock: State of Nature Parameters

  • In SimFlock, a state of nature is described by 42

parameters:

Full grown weights, normal distribution Age at puberty Number of eggs before incubation

N ~ (µ, σ2)

  • Each time a parameter is defined, a hyper

distribution is specified.

Egg hatching probability, logistic model Logit (pij) = µ + Ai

slide-3
SLIDE 3

3

SimFlock: Hyper distribution

The hyper distribution of the state of nature is specified through 64 hyper parameters. Logit (pij) = µ + αj + Fi + (αF)ij

Survival rate for 4 groups (j=1,2,3,4): 4 State of Nature parameters

7 Hyper parameters: Intercept: µ: 0.2526 Effect chick:

α1: 0.559

Effect grower:

α2: -0.398

Effect pullet:

α 3: 0.000

Effect cockerel:

α 4: 0.000

Random effect flock:

σF: 0.156

Fi ~ N(0,0.156) Random interaction:

σαF: 0.557

(αF)ij ~ N(0, 0.557)

SimFlock: Hyper distribution

Most of the hyper parameters estimated from the field data collected in 30 flocks. The hyper distribution represents the whole population of flocks under the conditions in question. A state of nature drawn from the hyper distribution represents one (hypothetical) flock.

By drawing e.g. many states of nature we can generate many realistic hypothetical flocks. Decision rules may have different effects in different flocks.

SimFlock: State variables

The state variables of day i are the states of the individual birds and eggs on that day: Eggs:

Fertilized /not fertilized

Birds:

Age Weight Growth potential Full grown weight Laying capacity Gender

Farmer:

Needs meat

There are millions of state variables in a simulation run

States of a bird

All birds: Unique ID (given at hatching, next integer) Age (updated daily) Weight (updated daily) Gender (drawn at random hatching) Full grown weight (drawn at random at hatching) Grown potential (permanent, drawn at hatching) Cocks: No further states Chicks and growers: Growth state (drawn at hatching/transition)

States of a pullet and cockerel

In addition to the general states: Pullet Age at first egg ”puberty” (drawn at transition) Growth state (drawn at transition) Cockerel Age at ”puberty” (drawn at transition) Growth state (drawn at transition)

In addition to the general states:

Laying capacity (drawn at transition) State in cycle (laying, incubating, brooding,

barren) – updated daily.

Days since transition in cycle – updated daily Eggs at incubating (drawn at transition in cycle) Eggs in nest – updated daily. Fertile eggs in nest – updated daily. Behavior, not used? (drawn at transition)

States of a Hen

slide-4
SLIDE 4

4

SimFlock: Output variables Ω

A total of 40 are defined:

Realised gain Realised mortality Eggs removed Chickens produced ...

Usual technical and economical key figures

Total income Total costs Net returns ...

SimFlock: Simulation

The farmer, birds and eggs are represented as

  • bjects in the model

Each simulated day, the states of all objects are updated:

Age Weight Survival Transition (e.g. egg→chick, chick→grower, etc.) Eggs in the nest ...

Use of the simulation model

System comprehension

Answering ”what if” questions What if decision rules Θ change

General decision support (at population level)

Main purpose of SimFlock

Decision support at (specific) flock level

Not yet possible

System comprehension

Usually carried out under one state of nature Answer questions like:

If we assume the state of nature parameters are Φ0=φi, what are then the consequences? What if we could improve the survival rate of chicks? Vary the survival rate systematically – run simulations and explore the results Etc.

Weakness: State of nature parameters are mutually correlated!

General decision support

Population level Carried out under multiple states of nature Questions like:

Under what circumstances does it pay to change the decision rule from Θ1 to Θ2? Generate multiple states of nature (Random flocks) Run a simulation job under Θ1 Run a simulation job under Θ2 Identify the states of nature where it pays

Decision support at flock level

Should “Jens Hansen” change his management from decision rule Θ1 to Θ2? Not yet possible in any simulation model?

In Simherd it has been done: generalize, assume and ignore

Problems:

We don’t know the state of nature for JH’s flock

Mortality in his flock? Age at puberty in his flock?

Not so difficult in SimFlock (only) 42 parameters Tough in SimHerd (Kudahl) 353 parameters

slide-5
SLIDE 5

5

Decision support at flock level

How to support decision in specific herds: solution!

Combine the simulation model with a Bayesian network Distinguish between true underlying levels and observed conquences Observe the consequences, enter evidence and propagate to

  • btain a distribution for the SoN of the particular herd/flock

Possible project for a Master’s thesis or even a PhD thesis My PhD goal: improve decision making on herd level concerning the control of the diseases causing lameness

Enter herd specific evidence on lameness prevalence Propagate to obtain a distribution for the probability of a cow becoming lame

A Bayesian Network (BN) for the State of Nature in a flock

Hyper distribution inititally set to the distribition in the population State of Nature Observed in JH’s flock. When observed, we can update the rest.

Defining a simulation job in SimFlock

Create an initial flock Specify Number of states of nature (if more than 1)

Matter of obtaining a representative sample of flocks from the abstract population

Number of replications per state of nature

How precise do you want the results of each flock to be? Mean values Distribution

Number of days to simulate

A long simulation period will increase the precision

Burn-in days

We want to ignore the effect of the initial flock

Simulation jobs: Considerations

Monte Carl simulation involves huge amounts of numerical calculations It produces huge amounts of data Computer capacity may still be a problem

Start the simulation on Friday afternoon See the results on Monday morning Buy the biggest hard disk in the catalogue in order to store the output

Analyzing the results

A herd simulation model produces output of the same kind as real world herds Must be analyzed according to the same principles as field data:

Calculations of means, SD’s etc. Graphical plots Variance and regression analysis

Be carefull with the usual significance concept!

Result example

100 states of nature, 50 replications per SoN

Chickens produced in 3 years

20 40 60 80 100 120 20 40 60 80 100 State of nature Chickens produced in 3 years

slide-6
SLIDE 6

6

The significance concept

In simulated data we know that the tested policies (parameters settings) are different:

If we have simulated with

Enough replications Sufficiently long periods

Then all differences are significant

Estimate the size of the difference with any desired precision Limited resources may “persuade” us to use significance tests…

Results in SimFlock

In Shown in tables Exported to files for analysis with other tools

Excel SAS ...

The excercises

When do we use Monte Carlo simulation

When other methods fail

Evaluation of decision strategies Consequences of deviating production results Consequences of implementing research results in practice

A good answer to the (almost) mandatory question at the exam:

Could you have used an other method to analyze the problem you have worked with? How?

Search for optimum

In general simulation models are used for evaluation of pre-defined strategies No optimization is carried out – the user must come up with the good ideas: ”What if we use/do/treat...” Methods to perform search for optimum exist – refer to textbook notes

Extremely demanding from a computational point of view

Simulation as a project in AHM

It is probably far too time consuming and demanding to build a complete simulation model from scratch You are welcome to sketch how to integrate SimFlock (SimHerd) with a Bayesian Network in order to use it at flock (herd) level

Exercise with SimFlock, Tuesday 20/9

Quick introduction through all the menu’s and tables