The use of a Markov transition probability model to explain the

The use of a Markov transition
probability model to explain
the distribution of dairy herd
size over time
Chris K. Dake1
Elizabeth Dooley2
Nicola Shadbolt2
April 2012
1
Consultant, Agriculture International Ltd
Centre of Excellence in Farm Business
Management, Massey University
2
Copyright
Copyright in this publication (including text, graphics, logos and icons) is owned by or licensed to DairyNZ
Incorporated. No person may in any form or by any means use, adapt, reproduce, store, distribute, print,
display, perform, publish or create derivative works from any part of this publication or commercialise any
information, products or services obtained from any part of this publication without the written consent of
DairyNZ Incorporated.
Disclaimer
This report was prepared solely for DairyNZ Incorporated with funding from New Zealand dairy farmers
through DairyNZ and the Ministry for Primary Industries under the Primary Growth Partnership. The
information contained within this report should not be taken to represent the views of DairyNZ or the Ministry
for Primary Industries. While all reasonable endeavours have been made to ensure the accuracy of the
investigations and the information contained in the report, OneFarm, Centre of Excellence in Farm Business
Management expressly disclaims any and all liabilities contingent or otherwise to any party other than DairyNZ
Incorporated or DairyNZ Limited that may arise from the use of the information.
Date submitted to DairyNZ: April, 2012
This report has been funded by New Zealand dairy farmers through DairyNZ and the
Ministry for Primary Industries through the Primary Growth Partnership.
Contents
1.0
Introduction ............................................................................................................................. 1
2.0
Data Sources ........................................................................................................................... 1
2.1 Including Entries/Exits category ..................................................................................................... 2
3.0
Methodology ............................................................................................................................ 3
3.1 Non-Stationary MTP ..................................................................................................................... 4
3.2 Stationary MTP ............................................................................................................................ 5
3.3 Prior MTP values .......................................................................................................................... 6
3.4 Values for the support vector ........................................................................................................ 6
4.0
Results .................................................................................................................................... 7
5.0
Conclusion, future model refinement and applications ..................................................................11
6.0 References ....................................................................................................................................12
i
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
ii
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
Introduction
This study explores the application of advanced modelling techniques for the analysis of the dairy farm
business data contained in DairyBase.
The distribution of farms by herd-size at the national level is reported in LIC and DairyNZ annual reports. The
underlying dynamics of the movement of farms between herd-size categories (HSCs) can be described using a
first order Markov process (see for example Stokes, 2006). The first order Markov transition probability (MTP)
matrix together with the proportion of farms in each HSC in a current year can be used to predict the
proportion of farms in each HSC in the following year. This report provides a brief description of an information
theoretic approach used to estimate MTP matrix using 10 years (2001/02 to 2010/11) of data on the
distribution of farms in each HSC. The effect of 3 exogenous variables, (a) milk solids payout, (b) milk solids
production per cow and (c) dairy land sales are used to estimate both a stationary and a non-stationary MTP
model. In the stationary case it is assumed MTP is in-variant between time periods; a non-stationary model
assumes MTP varies annually.
The description of the data used to estimate the MTP is presented in Section 2. The information theoretic
methodology used to estimate the MTP is presented in Section 3. Results including forecasts of the distribution
of dairy herd-size are provided in Section 4 and concluding remarks provided in Section 5.
1.0 Data Sources
Data on the number of herds in each HSC is published annually in the New Dairy Statistics report (LIC and
DairyNZ , 2010). The number of herds and the distribution of herds over 10 years are shown in Table 1 and
Figure 1 for the following 5 HSCs, 10- 249, 250–499, 500–749, 750–999 and 1000+ cows.
Table 1 Total number of herds
2001-02
13,649
2002-03
13,140
2003-04
12,751
2004-05
12,271
2005-06
11,883
2006-07
11,630
2007-08
11,436
2008-09
11,618
2009-10
11,691
2010-11
11,735
1
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
Figure 1 Herd size distribution from 2001/02 to 2010/11
0.600
10-249
250-499
500-749
0.500
750-999
Percentage of herds in herd size class
1000+
0.400
0.300
0.200
0.100
2001-02
2002-03
2003-04
2004-05
2005-06
2006-07
2007-08
2008-09
2009-10
2010-11
Year
There has been a considerable decline over time in the percentage of herds in the HSC 10-249 cows.
The estimated MTP matrix is conditional on 3 exogenous variables (a) milk solids payout ($/kg), (b) annual
milk solids production per cow (kg) and (c) dairy land sales ($ per farm). The time series of the exogenous
variables are published in the 2010/11 LIC/DairyNZ report.
2.1 Including Entries/Exits category
A sixth HSC capturing the entry of new dairy farms and the exit of dairy farms into other uses is added to the
HSC definition. The recorded maximum number of herds is 13,649 in 2001/02 (Table1). Therefore the
maximum potential number of farms has arbitrarily been set to 14,000 farms and number of farms in the
entry/exit category is taken as the difference between the recorded number of herds in the LIC/DairyNZ
reports and 14,000 farms.
The final 6 HSCs (10 - 249, 250 – 499, 500 – 749, 750 – 999, 1000+ and Entry/Exit ), and the percentage of
herds used in the study are shown in Figure 2.
2
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
Figure 2 Herd-size distribution with entry/exit category assuming a maximum of 14,000 herds are
potentially available per annum
0.60
10-249
250-499
500-749
0.50
750-999
1000+
Percentage of herds in herd size class
Entry/Exit
0.40
0.30
0.20
0.10
2001-02
2002-03
2003-04
2004-05
2005-06
2006-07
2007-08
2008-09
2009-10
2010-11
Year
2.0 Methodology
Two approaches are used in this study to estimate the Markov transition probability (MTP) model of annual
dairy herd-size movements. The first approach follows the work of Miller and Plantinga ( 2003) and Miller
(2007) and estimates a non-stationary MTP conditional on 3 exogenous variables (milk solids payout, milk
solids production per cow, dairy land sales). Non-stationary MTP means the MTP varies with time i.e. yearly.
The second approach follows the work of Glennon and Golan (2003) where a stationary MTP is estimated also
conditional on 3 exogenous variables (milk solids payout, milk solids production per cow and dairy land sales).
In this case the estimated MTP is the average over the period of estimation.
Other notable references covering the estimation of MTP are Lee and Judge (1996), Golan, Judge and Miller
(1996) and Golan (2008).
3
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
3.1 Non-Stationary MTP
The model that links the observed proportion of farms in each HSC to the Markov transition probabilities (MTP)
is shown Equation (1) (Miller, 2007).
(
∑
)
∑
(
(
) (
)
(
)
(1)
, for all j, t
)
(2)
Where
t=
1 to 10 years (2001 to 2010).
K=
6 categories of herd classes (10 - 249, 250 – 499, 500 – 749, 750 – 999, 1000+, Entry/Exit).
y (k,t)= Proportion of farms in each category k in year t.
π=
Markov transition probabilities which varies with time t.
e=
Random noise in data of each HSC.
Equation (2) ensures each row of probabilities of MTP transition matrix sums to 1.
The 3 exogenous variables, z′, are captured in the model, Equation (3), by multiplying both sizes of Equation 1
by the exogenous variables over T years (10 years) (Miller, 2007)
∑
( (
)
∑
(
) (
))
(3)
For the non-stationary problem there are 360 (T x K x K) unknown probabilities and 18 (z x K) estimation
equations, Equation (3). The problem is therefore ill-posed or under identified because there are more
variables than equations. To solve the problem, an information theoretic objective function, cross-entropy or
Kullback-Leibler information divergence measure is used (Equation 4) which minimises the divergence
between the MTP to be estimated, π, and reference prior probabilities, ̅
(
∑
̅)
∑
∑
(
)
[ (
) ̅(
)]
(4)
An optimisation solver, such as the Risk Solver Platform Excel add-in, can be used to find π for each time
period by minimising Equation (4) subject to the constraints Equation (1) and Equation (4).
A solution to problem takes the form of Equation (5) where ̃ is a set of Lagrange multipliers corresponding
the estimation Equation (3). The Lagrange multipliers (18 of them in this study i.e. z x K) are applied to the
reference prior probabilities, ̅
̃(
)
)
̅(
∑
)
̅(
)
̅(
( (
( (
and known proportions of herds in each HSC (Miller, 2007).
)
( (
)
̃ )
) ̃ )
̃ )
(5)
The single equation Lagrange function, Equation (6), also known as the concentrated dual, can be formed
from Equations (1) to (4) and can be maximised to yield the optimal λ (Miller, 2007; Golan, 2006) . The
estimated λ can then be used to recover MTP from Equation (5).
( )
∑
4
∑
(
) ́
∑
∑
(
)
(6)
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
3.2 Stationary MTP
Equations similar to Equations (1) to (6) can be used to estimate stationary MTP. The following is based
directly on stationary MTP model described by Glennon and Golan (2003) and Golan (2006).
Equation (7) corresponds to Equation (1) with the difference that MTP, (
(
)
∑
(
The error, (
) (
)
(
) does not vary with time.
)
(7)
), however is defined using a non-stationary probability matrix,
(
) with an error support
vector, ( ) which is symmetric around zero with bounds -1 and 1 since the proportions of HSC, (
) is
defined to have bounds 0 and 1 (Equation (8)).
(
)
∑
(
∑
(
(
) ( )
(8)
)
(9)
)
(10)
Equations (9) and (10) ensure the probabilities sum to 1.
Similar to Equation (3), the exogenous variables, z′, are included by multiplying both sides of Equation 7 by
the exogenous variables (Equation 11).
∑
( (
)
∑
(
) (
)
(
) ( ))
(11)
The minimum power divergent function, the Kullback-Leibler information divergence measure, corresponding to
Equation 4 is shown as Equation (12) with prior values for both MTP ( ̅(
(
∑
̅ ̅)
∑
(
[ (
)
) ̅(
)]
∑
∑
∑
) and error probabilities,
(
) [ (
) ̅(
(
).
)]
(12)
The equations for estimating probabilities given Lagrange multipliers and given prior probability values are
given in Equations (13 and (14).
̃(
)
̅(
)
( (
∑
̃ )
̃ )
)
)
∑
̅(
)
∑
( (
̅(
)
∑
( (
)
̃ )
(13)
and
̃(
)
̅(
)
∑
̅(
̅(
)
(
)
(
(
( )̃ )
( )̃ )
( )̃ )
(14)
Equation 15 is the single equation function that can be maximised to provide estimates of Lagrange multipliers
which can then be used to recover the probability estimates of Equations (13 and (14).
( )
∑
∑
(
) ́
∑
∑
∑
(
)
(15)
The Risk Solver Platform Excel add-in was to used solve Equations (6) and (15) to derive the optimal Lagrange
multipliers which were then used to recover MTPs using Equations (5), (13) and (14).
5
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
3.3 Prior MTP values
The following rules were used to set prior values for MTP required by Equations (5), (13) and (14).
(a) The probability of a farm remaining in a HSC between time periods is high. This has been assigned a
probability value of 0.950.
(b) A farm can only move up one HSC or exit the system. The probability of a farm exiting has been set at
0.010. This number is arbitrary since there is no published or anecdotal information on farm exits
from the dairy sector.
(c) New conversions can enter into any HSC. The probabilities of new entrants have been specified as
0.010. Data on new dairy conversions is not published by LIC or DairyNZ.
The following prior MTP probabilities were used in the study (Table 2).
Table 2 – Prior MTP used in the study for stationary and non-stationary MTP models
TO: Herd class category
̅(
)
10-249
10-249
250-499
0.040
500-749
-
750-999
-
1000+
Exit
-
FROM: Herd class category
0.950
Total
1
0.010
250499
0.950
0.040
-
-
1
0.010
500749
-
750999
-
0.950
0.040
-
1
0.010
-
0.950
0.040
1
0.010
1000+
-
-
-
0.990
1
0.010
Entry
0.010
0.010
0.010
0.010
0.010
1
0.950
There is no information that can be used to set values for the error probabilities, ̅ (
).Without any
information a uniform distribution of probabilities must be used; this was set equally at 1/6 (the number of
herd size categories used in the model).
3.4 Values for the support vector
The error support vector, ( ) used in Equations (14) and (15) is symmetric around zero with bounds -1 and 1.
It is calculated from the number of herd categories (6) and number of years (10 years) used in the study as [1/K√T,...,0,... [-1/K√T) (Courchane et al., 2000, cited in Karantininis, 2002). Another method for calculating
the error support vector is the three-sigma rule (-3σ, -1.5σ, 0, 1.5σ, 3σ) where σ is the standard deviation of
the dependent variable (Golan, Judge and Miller, 1996). This method was not used in this study.
6
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
3.0 Results
The estimated probabilities of the non – stationary Markov transition probability (MTP) matrix vary with time,
and conditional on 3 exogenous variables, milk solids payout, and milk solids production per cow and dairy land
sales (Equation 5). For example, using the prior MTP values shown in Table 2, the variation of probabilities of
farms remaining in their respective herd size categories (HSCs) over time are shown Figure 3; the probability
of a farm remaining in a HSC is high at over 90%. The probability that a farm would remain in the 250-499
HSC has been decreasing in recent years while the probability that a farm would remain in the HSC 1000+ has
remained constant in recent years. The probability of a farm remaining in the HSC 10 – 249 is lower than the
other HSCs and has fluctuated over time; in recent years there appears to be a reduction in the probability of
farms remaining in the 10 – 249 HSC (Figure 3).
Figure 3. The probability that a farm would remain in a given herd size class
1
0.99
0.98
0.97
10-249
0.96
250-499
500-749
750-999
0.95
1000+
Entry/Exit
0.94
0.93
0.92
0.91
2002-03
7
2003-04
2004-05
2005-06
2006-07
2007-08
2008-09
2009-10
2010-11
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
The estimated stationary MTP matrix of the movement of farms between herd classes is shown in Table 3. The
matrix was estimated using Equations (13). Even though the MTP is assumed stationary, forecasts of the
distribution of farms is made with error which varies with time (Equation 7). The time varying error generation
matrix is calculated using Equation (14) and is conditional on 3 exogenous variables, milk solids payout, milk
solids production per cow and dairy land sales.
Table 3. Stationary Markov transition probabilities of movement of dairy farms between herd
classes
TO: Herd class category
10-249
250499
500749
750999
1000+
Exit
Total
0.929
0.045
-
-
-
0.026
1.000
-
0.950
0.030
-
-
0.020
1.000
-
-
0.951
0.036
-
0.013
1.000
-
-
-
0.948
0.041
0.011
1.000
-
-
-
-
0.989
0.011
1.000
0.007
0.008
0.007
0.006
0.006
0.965
1.000
FROM: Herd class category
10-249
250499
500749
750999
1000+
Entry
Estimates and forecasts of farms in each of the 6 HSCs appear identical for both the non-stationary and
stationary model formulations (Figures 4 and 5) indicating that both computational approaches are suitable for
predicting the distribution of farms over time. The formulations predict a decline in the proportion of farms in
HSCs 10-249 and 250-499; by 2015 – 2016 it is expected the proportional farms in these categories would be
about 22% and 32% of total herds respectively.
The models forecast the larger HSCs (500 – 749, 750 – 999, 1000+), would keep on increasing, reaching
values of 16%, 6% and 5% of total herds respectively in 2015-2016.
The proportion of farms in the Entry/Exit category (that is the “pool” from which herds can be recruited into
other HSC) is predicted to be 17% or 21% for the non-stationary and stationary formulations respectively.
8
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
Figure 4 Non-stationary MTP: proportion of farms in herd-size categories. Actual and within sample
estimates and forecasts to 2015-16
Figure 3a
Figure 3b
0.600
0.340
0.335
0.500
0.330
0.400
0.325
0.300
10-249
0.200
10-249 F
0.320
250-499
0.315
250-499 F
0.310
0.100
0.305
Figure 3c
2015-16
2013-14
2011-12
2009-10
2007-08
2005-06
2003-04
2015-16
2013-14
2011-12
2009-10
2007-08
2005-06
0.300
2003-04
-
Figure 3d
0.180
0.080
0.160
0.070
0.140
0.060
0.120
0.050
0.100
0.080
500-749
0.060
500-749 F
0.040
0.040
0.020
0.020
0.010
750-999 F
2015-16
2013-14
2011-12
2009-10
2007-08
2003-04
Figure 3e
2005-06
-
2015-16
2013-14
2011-12
2009-10
2007-08
2005-06
2003-04
-
750-999
0.030
Figure 3f
0.060
0.200
0.180
0.050
0.160
0.140
0.040
0.120
0.030
1000+
0.020
1000+ F
0.100
Entry/Exit
0.080
Entry/Exit F
0.060
0.040
0.010
0.020
9
2015-16
2013-14
2011-12
2009-10
2007-08
2005-06
2003-04
2015-16
2013-14
2011-12
2009-10
2007-08
2005-06
2003-04
-
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
Figure 5 Stationary MTP: proportion of farms in herd-size categories. Actual and within sample
estimates and forecasts to 2015-16
Figure 4a
Figure 4b
0.600
0.340
0.335
0.500
0.330
0.325
0.400
0.320
0.300
10-249
0.200
10-249 F
0.315
250-499
0.310
250-499 F
0.305
0.300
0.100
0.295
Figure 4c
2014-15
2012-13
2010-11
2008-09
2006-07
2004-05
2002-03
2014-15
2012-13
2010-11
2008-09
2006-07
2004-05
0.290
2002-03
-
Figure 4d
0.160
0.070
0.140
0.060
0.120
0.050
0.100
0.040
0.080
500-749
0.060
500-749 F
0.040
750-999
0.030
750-999 F
0.020
0.010
0.020
Figure 4e
2014-15
2012-13
2010-11
2008-09
2006-07
2004-05
2002-03
2014-15
2012-13
2010-11
2008-09
2006-07
2004-05
2002-03
-
Figure 4f
0.050
0.250
0.045
0.040
0.200
0.035
0.030
0.150
0.025
1000+
0.020
Entry/Exit
0.100
1000+ F
0.015
0.010
Entry/Exit F
0.050
0.005
10
2014-15
2012-13
2010-11
2008-09
2006-07
2004-05
2002-03
2014-15
2012-13
2010-11
2008-09
2006-07
2004-05
2002-03
-
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
4.0 Conclusion, future model refinement and
applications
A number of issues need to be considered for future study. They include:
a)
Estimating the potential number of farms used to estimate entries/exits. In this study the maximum
potential number of herds in New Zealand was set at 14,000 farms. This was based on highest
number of farms recorded in the past 10 years. A more reliable data of new farms entering the sector
and exits should be collated.
b)
Estimating prior values shown in Table 3. There is a need to determine from past farm surveys the
probability of herds remaining in the current HSC between consecutive years. Information is also
needed on whether farms can move down a HSC and whether to they move more than 1 HSC
between consecutive years.
c)
This study used national data for the development of the MTP model. The analysis should be repeated
for the regions since the dynamics of farm movements between HSC are likely to be different for each
region.
d)
The marginal effects and the elasticity of MTP with respect to each exogenous variable, milk solids
payout, milk solids production per cow and dairy land sales, can be calculated from the cross entropy
approach used to estimate MTP. This sensitivity analysis should be calculated in future studies.
The Markov transition modelling framework developed in this study can be applied to study structural change
in the agriculture sector at the regional and national levels. See for example studies by Gaffney (1995) on the
use of Markov chain analysis of agricultural change for the EU Common Agricultural Policy Impact Analysis
(CAPRI) project, and the use of the Farm Accountancy Data Network (FADN) with the Farm Structure Survey
(FSS) data to study structural change of farming over time (Gocht et al.; 2012). The application of the Markov
chain analysis in New Zealand agriculture can be found in Dake (2009) where the model was used within an
econometric model of pastoral supply response at the national level.
11
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution
6.0 References
Courchane, M., Golan, A., Nickerson, D., 2000. Estimation and evaluation of loan discrimination—An
information approach. Journal of Housing Research 11, 67–90.
Dake, C.K.G. (2009). The Econometrics of New Zealand Pastoral Agriculture: With Special Reference to
Greenhouse Gas Emissions. Client report to the Ministry of Agriculture and Forestry, Wellington, New Zealand,
March 2009, 53 pages
Gaffney, P. 1997. A Projection of Irish Agricultural Structure Using Markov Chain Analysis. http://www.ilr.unibonn.de/agpo/publ/workpap/pap97-10.pdf
Glennon, D.; Golan, A. 2003. A Markov model of bank failure estimated using an information-theoretic
approach
http://www.occ.gov/publications/publications-by-type/economics-working-papers/2008-2000/index-20082000-economics-working-papers.html#y03
Gocht, A., Röder, N., Neuenfeldt, S., Storm, H., Heckelei, T (2012). Modelling farm structural change: A
feasibility study for ex-post modelling utilizing FADN and FSS data in Germany and developing an ex-ante
forecast module for the CAPRI farm type layer baseline.
http://ipts.jrc.ec.europa.eu/publications/pub.cfm?id=5759
Golan, A., Judge, G.; Miller, D. 1996. Maximum entropy econometrics: robust estimation with Limited Data,
John Wiley & Sons.
Golan, A. 2006. Information and entropy Econometrics - A review and synthesis. Foundations. Econometrics,
Vol. 2, Nos. 1–2 (2006) 1–145.
Karantininis, K. 2002. “Information-based estimators for the non-stationary transition probability matrix: an
application to the Danish pork industry. Journal of Econometrics 107 (2002) 275 – 290
LIC DairyNZ (2010) New Zealand Dairy Statistics, reports 2001/2 to 2010/11
Miller, D. J., Plantinga, A. J. 2003. Modeling Land Use Decisions with Aggregate Data: Dynamic Land Use.
http://www.american.edu/cas/econ/faculty/golan/golan/Papers/MillerPlantinga.pdf
Miller, D. 2007. Behavioral foundations for conditional markov models of aggregate data.
https://mospace.umsystem.edu/xmlui/bitstream/handle/10355/2558/BehavioralFoundationsConditionalMarkov
Models.pdf?sequence=1
Stokes, J. R. 2006. Entry, exit, and structural change in Pennsylvania’s dairy sector.
http://ageconsearch.umn.edu/bitstream/10218/1/35020357.pdf
12
Centre of Excellence in Farm Business Management
The use of a Markov transition probability model to explain dairy herd distribution