- Install
rethinking
,greta
and their dependencies TensorFlow and RStan
The rethinking
package requires rstan
which might require you somewhat special compiling configurations. If you have trouble with the C++ compiler try adding the line CXX14 = g++ -std=c++1y -Wno-unused-variable -Wno-unused-function -fPIC
to the file ~/.R/Makevars
(create if necessary).
The greta
in turn, requires the Python modules tensorflow
and tensorflow_probability
. To install those you can either:
- i) use the following code in a fresh terminal,
conda create --name greta
conda activate greta
conda install tensorflow==1.12.0
conda install tensorflow-probability
conda update --all
to create a Conda environment called greta
, or
- ii) use the
greta.yml
file to copy mygreta
Conda enviroment,
conda env create -f greta.yml
I propose using CPU-only TensorFlow within Conda environments, but feel free to use alternatives at your own discretion. Quick side note: to create a .yml
file you can use the command conda env export --no-builds > greta.yml
.
-
Install all packages listed on top of the two R scripts
zipoisEggs.R
anddbinomSuccessful.R
. All of them are available on CRAN. -
Run either or both scripts - the first implements a
rethinking
-based zero-inflated Poisson regression on the number of fledglings, and a Poisson regression on the number of laid eggs, whereas the second implements agreta
-based logistic regression on whether a female has successfully produced fledglings or not.
The dataset used in this work pertains to the publication:
I want to thank the author Christina Riehl for all insighful discussions and suggestions. I also want to thank Nick Golding and the community at the greta
forum for their kind contributions.
Enjoy, all feedback is welcome!
Francisco