biocro: an r package for crop simulation and...
TRANSCRIPT
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
BioCro: an R package for Crop Simulation andStatistics
Fernando E. Miguez
Department of AgronomyIowa State University
Jul 8, 2010
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Outline
1 Background
2 Models
3 Process-based model
4 BioCro
5 Photosynthesis
6 Optimizing Carbon Allocation
7 Methods
8 Results
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Education and Research
Education
B.S. Agronomy (University of Buenos Aires, 2001)
M.S. and PhD in Crop Sciences (University of Illinois, 2004,2007)
M.S. Applied Statistics (University of Illinois, 2007)
Post-Doc at the Energy Sciences Institute (University ofIllinois, 2008 – 2009)
Assistant Professor, Department of Agronomy, Iowa StateUniversity
Research
Miscanthus Production and Modeling
Model Development for Biomass Crops
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Education and Research
Education
B.S. Agronomy (University of Buenos Aires, 2001)
M.S. and PhD in Crop Sciences (University of Illinois, 2004,2007)
M.S. Applied Statistics (University of Illinois, 2007)
Post-Doc at the Energy Sciences Institute (University ofIllinois, 2008 – 2009)
Assistant Professor, Department of Agronomy, Iowa StateUniversity
Research
Miscanthus Production and Modeling
Model Development for Biomass Crops
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Education and Research
Education
B.S. Agronomy (University of Buenos Aires, 2001)
M.S. and PhD in Crop Sciences (University of Illinois, 2004,2007)
M.S. Applied Statistics (University of Illinois, 2007)
Post-Doc at the Energy Sciences Institute (University ofIllinois, 2008 – 2009)
Assistant Professor, Department of Agronomy, Iowa StateUniversity
Research
Miscanthus Production and Modeling
Model Development for Biomass Crops
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Education and Research
Education
B.S. Agronomy (University of Buenos Aires, 2001)
M.S. and PhD in Crop Sciences (University of Illinois, 2004,2007)
M.S. Applied Statistics (University of Illinois, 2007)
Post-Doc at the Energy Sciences Institute (University ofIllinois, 2008 – 2009)
Assistant Professor, Department of Agronomy, Iowa StateUniversity
Research
Miscanthus Production and Modeling
Model Development for Biomass Crops
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Education and Research
Education
B.S. Agronomy (University of Buenos Aires, 2001)
M.S. and PhD in Crop Sciences (University of Illinois, 2004,2007)
M.S. Applied Statistics (University of Illinois, 2007)
Post-Doc at the Energy Sciences Institute (University ofIllinois, 2008 – 2009)
Assistant Professor, Department of Agronomy, Iowa StateUniversity
Research
Miscanthus Production and Modeling
Model Development for Biomass Crops
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Education and Research
Education
B.S. Agronomy (University of Buenos Aires, 2001)
M.S. and PhD in Crop Sciences (University of Illinois, 2004,2007)
M.S. Applied Statistics (University of Illinois, 2007)
Post-Doc at the Energy Sciences Institute (University ofIllinois, 2008 – 2009)
Assistant Professor, Department of Agronomy, Iowa StateUniversity
Research
Miscanthus Production and Modeling
Model Development for Biomass Crops
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Education and Research
Education
B.S. Agronomy (University of Buenos Aires, 2001)
M.S. and PhD in Crop Sciences (University of Illinois, 2004,2007)
M.S. Applied Statistics (University of Illinois, 2007)
Post-Doc at the Energy Sciences Institute (University ofIllinois, 2008 – 2009)
Assistant Professor, Department of Agronomy, Iowa StateUniversity
Research
Miscanthus Production and Modeling
Model Development for Biomass Crops
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Outline
1 Background
2 Models
3 Process-based model
4 BioCro
5 Photosynthesis
6 Optimizing Carbon Allocation
7 Methods
8 Results
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Statistical vs. Process-based models
Statistical modely = f(x; θ) + ε
Process-based model
y =M(X; parm, const)
statistical model is data-driven
M >>> f
parm >>> θ
X >>> x
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Outline
1 Background
2 Models
3 Process-based model
4 BioCro
5 Photosynthesis
6 Optimizing Carbon Allocation
7 Methods
8 Results
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
WIMOVAC
Developed by SteveHumphries and Steve Long(UIUC)
Created mainly 1994-1998
User-friendly
Written in Visual Basic
On-line documentation andbinary (Win XP)
http://www.life.illinois.edu/plantbio/wimovac/model.htm
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Outline
1 Background
2 Models
3 Process-based model
4 BioCro
5 Photosynthesis
6 Optimizing Carbon Allocation
7 Methods
8 Results
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
BioCro (R package)
Features
Statistics Built-in algorithms for parameter estimation, modeldiagnostics and graphics
Interactive Lets the user modify input and parameters andquickly plot the results
Documentation Built-in documentation
Modular Allows the user to directly test components
Computational Written in C/R
Flexibility Easily coupled with other tools and software
Portability Cross-platform and scalable
Maintenance Currently under active development
Limitations
User-friendliness Not as intuitive as WIMOVAC
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
BioCro (R package)
Features
Statistics Built-in algorithms for parameter estimation, modeldiagnostics and graphics
Interactive Lets the user modify input and parameters andquickly plot the results
Documentation Built-in documentation
Modular Allows the user to directly test components
Computational Written in C/R
Flexibility Easily coupled with other tools and software
Portability Cross-platform and scalable
Maintenance Currently under active development
Limitations
User-friendliness Not as intuitive as WIMOVAC
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
BioCro (R package)
Features
Statistics Built-in algorithms for parameter estimation, modeldiagnostics and graphics
Interactive Lets the user modify input and parameters andquickly plot the results
Documentation Built-in documentation
Modular Allows the user to directly test components
Computational Written in C/R
Flexibility Easily coupled with other tools and software
Portability Cross-platform and scalable
Maintenance Currently under active development
Limitations
User-friendliness Not as intuitive as WIMOVAC
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
BioCro (R package)
Features
Statistics Built-in algorithms for parameter estimation, modeldiagnostics and graphics
Interactive Lets the user modify input and parameters andquickly plot the results
Documentation Built-in documentation
Modular Allows the user to directly test components
Computational Written in C/R
Flexibility Easily coupled with other tools and software
Portability Cross-platform and scalable
Maintenance Currently under active development
Limitations
User-friendliness Not as intuitive as WIMOVAC
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
BioCro (R package)
Features
Statistics Built-in algorithms for parameter estimation, modeldiagnostics and graphics
Interactive Lets the user modify input and parameters andquickly plot the results
Documentation Built-in documentation
Modular Allows the user to directly test components
Computational Written in C/R
Flexibility Easily coupled with other tools and software
Portability Cross-platform and scalable
Maintenance Currently under active development
Limitations
User-friendliness Not as intuitive as WIMOVAC
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
BioCro (R package)
Features
Statistics Built-in algorithms for parameter estimation, modeldiagnostics and graphics
Interactive Lets the user modify input and parameters andquickly plot the results
Documentation Built-in documentation
Modular Allows the user to directly test components
Computational Written in C/R
Flexibility Easily coupled with other tools and software
Portability Cross-platform and scalable
Maintenance Currently under active development
Limitations
User-friendliness Not as intuitive as WIMOVAC
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
BioCro (R package)
Features
Statistics Built-in algorithms for parameter estimation, modeldiagnostics and graphics
Interactive Lets the user modify input and parameters andquickly plot the results
Documentation Built-in documentation
Modular Allows the user to directly test components
Computational Written in C/R
Flexibility Easily coupled with other tools and software
Portability Cross-platform and scalable
Maintenance Currently under active development
Limitations
User-friendliness Not as intuitive as WIMOVAC
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Outline
1 Background
2 Models
3 Process-based model
4 BioCro
5 Photosynthesis
6 Optimizing Carbon Allocation
7 Methods
8 Results
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Photosynthesis: an important part of crop models
Measured with a Li-COR6400
CO2 uptake
stomatal conductance
intercellular CO2
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Typical A/Q curve
Quantum flux
CO
2 U
ptak
e
5
10
15
20
25
30
0 500 1000 1500 2000
●●●
●
●
●
●
●
2
0 500 1000 1500 2000
●●
●
●
●
●
●
●
6
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Photosynthesis model from Collatz
Input: light, temperature, relative humidity, atm CO2
Output: CO2 uptake, stomatal conductance, intercellar CO2
Parameters: Vmax, alpha, k, theta
350 lines C code in BioCro R package
In R, package BioCro:
> args(c4photo)function (Qp, Tl, RH, vmax = 39, alpha = 0.04,
kparm = 0.7, theta = 0.83,beta = 0.93, Rd = 0.8, Catm = 380,b0 = 0.08, b1 = 3, StomWS = 1,ws = c("gs", "vmax"))
Collatz et al (1992) Coupled Photosynthesis-Stomatal Conductance Model for Leaves of C4 Plants. Aust. J. Plant
Physiol.
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Testing the photosynthesis modelMiscanthus x giganteus diurnals
hour
Leaf
Ass
imila
tion
0
10
20
30
40
●●
● ●● ●
●
●●
●
●●
●●
●
●
116
5 10 15 20
●
●
●
● ●●
●
●
●●
●
●
● ● ●
●
●
●
128
● ●
●
●●
●●
●●● ●
●
●● ●
●
●●
137
5 10 15 20
●●
●
●
●
●●
●
● ●
143
●●
●
●
●●
●
●
●● ●
●
●
● ●●
●
●
152
●
●
●
●● ●
●
●
●●
●
●
●● ●
●
●
●
159
●
●
●
●
●●
●
●
●●
●
●●
● ●
●
●
●
166
●
●●
● ●●
●
●●
●
●
●●
●
●
●
187
●
●
●
●
●
●
●
●
●●
●
●
●● ●
●
●
●
188
0
10
20
30
40
●●
●
●● ● ●
●
●●●
●
●
● ● ●
●
●
201
0
10
20
30
40
●
●
● ● ●
●
●●
●
●● ●
●
●
214
● ●
●
●
●● ●
●●● ●
●●
●
●
●
●
●
222
●
●
● ●
●
●
● ●●
●
●●
●
●●
●
244
●
●●
●●
●
●
●●
●
●
● ●
●
●
●
245
●
●
● ●●
●
●●●
●
● ●●
●
●
●
258
5 10 15 20
●
●
● ●●
●
●●
●
●
●
● ●
●
265
●
●
●●
●
●
●
●●
●
272
5 10 15 20
●●
●
●●
●
●●●
●
● ●●
●
279
● ● ●● ●
●
●● ● ●
286
5 10 15 20
0
10
20
30
40
●●
● ●●
●●●
● ●●
●
300
ObsSim
●
●
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Optimization
D =M(input, θ)
RSS(θ) =∑
(D′ −D)2
where
D = simulated , D′= observed
Quantum flux
CO
2 up
take
0
10
20
30
0 500 1000 1500 2000
ObsSim
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Optimization in BioCro
Opc4photo function in BioCro
Objective function: RSS(θ)It uses the R built-in function optim internally
mOpc4photo and MCMCc4photo available
> head(aq26, n = 3)A PARi Tleaf RH_S
41 30.1 1958 27.0 0.6042 28.8 1465 26.2 0.6043 26.1 977 25.5 0.59> op6 <- Opc4photo(aq26)...
best lower upperVmax 31.372 30.858 31.886alpha 0.054 0.052 0.056
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Outline
1 Background
2 Models
3 Process-based model
4 BioCro
5 Photosynthesis
6 Optimizing Carbon Allocation
7 Methods
8 Results
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Estimating Dry Biomass Partitioning Coefficients
Objective Model carbon allocation to plant components
Harvestable Biomass Mostly stems are harvested
Carbon Storage How much carbon is stored belowground
Water and nutrient cycling Dynamics during the season
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Stages and Dry Biomass Partition CoefficientsExample for a perennial grass
Stage Thermal Leaf Stem Rhizome RootEmergence 0–562 0.48 0.47 -1e-4 0.05Juvenile 562–1312 0.14 0.64 -8e-5 0.21Induction 1312–2063 0.01 0.53 0.3 0.13Post-induction 2063–2673 0.01 0.53 0.3 0.13Flowering 2673–3211 0.01 0.53 0.3 0.13Post-flowering 3211–4000 0.01 0.53 0.3 0.13
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Estimating Dry Biomass Partitioning Coefficients
24 parameters
Linear restrictions
Constrained parameters
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Outline
1 Background
2 Models
3 Process-based model
4 BioCro
5 Photosynthesis
6 Optimizing Carbon Allocation
7 Methods
8 Results
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Parameter Estimation Methods
DIFF compute the relative difference in biomass increase
UNLOwT unconstrained non-linear optimization withtransformation
CNLO constrained non-linear optimization
SA simulated annealing (stochastic search method)
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Method: DIFF
Thermal Time
Dry
Bio
mas
s (M
g/ha
)
5
10
15
20
25
0 500 1000 1500 2000 2500
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
StemLeafRootRhizomeGrainLAI
●
●
●
●
●
●
Estimate the coefficients by calculatingthe relative increase in biomass for eachstage
Instantaneous
Note: Fails with missing data
idbp function in BioCro package
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Method: UNLOwT
Thermal Time
Dry
Bio
mas
s (M
g/ha
)
5
10
15
20
25
0 500 1000 1500 2000 2500
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
StemLeafRootRhizomeGrainLAI
●
●
●
●
●
●
From the simplex S to <Use the additive logratio transform
θ = alr(z) =(log(
z1zk
), . . . , log(zk−1
zk))
Perform the optimization in theunconstrained space
OpBioGro function which usesoptim
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Method: CNLO
Thermal Time
Dry
Bio
mas
s (M
g/ha
)
5
10
15
20
25
0 500 1000 1500 2000 2500
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
StemLeafRootRhizomeGrainLAI
●
●
●
●
●
●
Impose linear constrains onthe parameters
Example x = (x1, x2, x3, x4)x1 + x2 + x3 ≤ 1xi > 0contrOpBioGro functionwhich uses constrOptim
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Method: SA
Thermal Time
Dry
Bio
mas
s (M
g/ha
)
5
10
15
20
25
0 500 1000 1500 2000 2500
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
StemLeafRootRhizomeGrainLAI
●
●
●
●
●
●
Generate candidate solutions(θ1,θ2,. . . ,θn)
The candidate vectors (θi) aresubjected to the constraints
Accept solutions that improve theobjective function (RSS) andsome that don’t
Gradual improvement of theobjective function exploring theparameter space to avoid gettingstuck in local optima
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Experimental Design
Objective: evaluate the ability of the different methods torecover the “true” coefficients.
Generated simulated data from known (“true”) coefficients
Simulated 6, 8, 10, 15 samples (time points)
Simulated samples with missing data (2,3,4,5)
Run the methods 100 times
Calculated distance from “true” to estimated
Calculated RSS∗T
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Outline
1 Background
2 Models
3 Process-based model
4 BioCro
5 Photosynthesis
6 Optimizing Carbon Allocation
7 Methods
8 Results
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Results (complete cases)
Distance
Res
idua
l Sum
of S
quar
es
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.00 0.05 0.10 0.15 0.20 0.25
6 8
10
0.00 0.05 0.10 0.15 0.20 0.25
0.0
0.1
0.2
0.3
0.4
0.5
0.615
UNLOwTCNLOSA
UNLOwT: preciseand accurate
CNLO: veryprecise andaccurate
SA: less preciseand accurate thanCNLO andUNLOwT
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Results (missing data)
Distance
Res
idua
l Sum
of S
quar
es
0
20
40
60
80
100
0.0 0.5 1.0 1.5
6 8
10
0.0 0.5 1.0 1.5
0
20
40
60
80
100
15
UNLOwTCNLOSA
UNLOwT: mostlyunstable (badstarting values)
CNLO: preciseand accurate(often unstable)
SA: much morerobust thanUNLOwT andCNLO
Background Models Process-based model BioCro Photosynthesis Optimizing Carbon Allocation Methods Results
Real Life Example
Thermal Time
Dry
Bio
mas
s (M
g/ha
)
5
10
15
20
25
0 500 1000 1500 2000 2500
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
StemLeafRootRhizomeGrainLAI
●
●
●
●
●
●
Miscanthusbiomassmeasurementsin England(missing rootdata)
Used theCNLO method
Questions ?