-
Notifications
You must be signed in to change notification settings - Fork 5
/
Seminar_06_Model_Programming.Rmd
18 lines (10 loc) · 1.5 KB
/
Seminar_06_Model_Programming.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
## Seminar 6: Model Programming {#model_programming}
<!-- reference with [Model programming](#model_programming) -->
Welcome to the model programming seminar of **Decision Analysis and Forecasting for Agricultural Development**. In this seminar we will look into different options for model programming in the `R` programming environment [@R-base]. In case you have not already installed `R` and `RStudio` you may want to go back to the [Using R and Rstudio](#r_rstudio) seminar and follow the instructions there. Feel free to bring up any questions or concerns in the Slack or to [Dr. Cory Whitney](mailto:[email protected]?subject=[Seminar_4]%20Decision%20Analysis%20Lecture) or the course tutor.
Remember to start simple then move on to other steps, make sure that you always have a working model at each of the steps in the process, i.e. starting with a skateboard rather than a car part as in this example from [MetaLab](https://twitter.com/metalab).
!['Skateboard, Bike, Car'](images/Model_stages_car_analogy.png)
### Monte Carlo Simulation of Apples and Sheep Agroforestry
Follow this hypothetical example of a silvopastoral system as your first Monte Carlo simulation in base R.
![](images/MC_apples_sheep.png){width=50%}
In this video we walk you through the process of running this model. Please follow along and write your own R script. If you ask nicely we might also share the R script.
<iframe width="560" height="315" src="https://www.youtube.com/embed/Wj49RrvjQ5M" frameborder="0" allowfullscreen></iframe>