Problem 1

In this exercise, you will fit a model that is widely used in wildlife studies called occupancy models. In occupancy models, researchers are interested in determining the proportion of sites that have individuals of the focus species (i.e., sites that are occupied) and how environmental variables influence occupancy status. However, the tricky part is that lack of detection might mean either that:

  1. the site was unoccupied; or
  2. that it was occupied but no individuals were seen.

The generative model for an occupancy model without covariates is given by:

\[s_i \sim Bernoulli (\pi) \]

where \(s_i\) is a binary variable indicating if the site is occupied (1) or not (0). We further assume that:

\[D_i|s_i=1 \sim Binomial (T_i , \delta)\]

where \(D_i\) is the number of times site i was detected to be occupied and \(T_i\) is the number of times site i was visited. This equation states that, assuming that the site is occupied, the number of visits in which we detect at least one individual of the focus species is given by a binomial distribution (i.e., \(D_i\) is an integer between 0 and \(T_i\)).

The goal of this exercise is to estimate the proportion of sites that are occupied (\(\pi\)) and the detection probability (\(\delta\)).

  1. Simulate some data following this generative model.

  2. When you fit these simulated data using JAGS, are we able to estimate well the parameters of our model?

  3. Fit the data provided below using JAGS. What are the posterior means and 95% credible intervals for \(\pi\) and \(\delta\)?

Problem 2

Researchers are interested in understanding the relationship between occupancy probability \(\pi\) and amount of vegetation.

  1. How would you change the model above to enable the study of this relationship? Describe your generative model

  2. Simulate some data following this generative model.

  3. When you fit these simulated data using JAGS, are we able to estimate well the parameters of our model?

  4. Fit the data provided below using JAGS. What do we find regarding the relationship between occupancy and amount of vegetation?

Dataset:

For this exercise, use the data in the file “fake data occupancy.csv”. In this file, each row corresponds to a distinct site and we have the following columns:

  1. “D1” is the number of times each site was detected to be occupied;
  2. “T1” is the number of visits to each site; and
  3. “vegetation” contains information on the amount of vegetation at each site.

Obs.: Don’t forget to add your code to the assignment so that we can see your work

Comments?

Send me an email at