We want to know whether a particular species (hereafter, "the species") occurs in a particular site (termed "site of interest"). We do not have any idea on whether the species occurs within the site of interest. Therefore, our prior belief for the species occupying the site of interest is 50%:
prior probability of species occurring within site of interest = 50%
prior_prob = 0.5
Although we do not have any observation data for the site of interest, we do have environmental data for the site of interest. We also have observation and environmental data for 100 other sites in the broader study area (termed "initial dataset"). Since the probability that the species occurs in a given site depends on (and only on) the environmental conditions of that site (and only that site), we can fit a correlative statistical model (e.g. logistic regression)+ to the initial dataset to make predictions on where the species occurs (termed "initial model"). We can then use environmental data for the site of interest and the model to predict the probability that the species occurs within the site of interest. This model has predicted that the species has an 80% chance of occurring in the site of interest++, and so we will take this to mean that the model has predicted that the species occurs within the site of interest. In other words, the model has predicted that the species is "present" in the site of interest (and not "absent" from the site of interest).
initial model prediction probability = 0.8
initial_model_predicted_present = TRUE
To account for possibility that the initial model can make prediction errors, we will calculate statistics to describe its performance. Specifically, we have calculated its sensitivity (true positive rate) and specificity (true negative rate). Briefly, a sensitivity of 0.8 means that the model correctly predicts that the species occurs within a site 80% of the time, and a specificity of 0.7 means that the model correctly predicts that the species does not occur within a site 70% of the time. We will assume that these performance measures are not subject to biases or errors (e.g. they were derived using an independent gold standard+++). Here, we calculated the following performances for the initial model:
initial model sensitivity = 0.81
initial_model_sensitivity = 0.81
initial model specificity = 0.82
initial_model_specificity = 0.82
These performance metrics can then be used to calculate the total probability that the initial model would predict a presence (i.e. predict that the species occurs) and absence (i.e. predict that the species does not occur) within the site of interest (accounting for incorrect predictions):
total probability of initial model predicting presence in site (accounting for false presences)
=
total_prob_pres = (prior_prob * initial_model_sensitivity) + ((1 - prior_prob) * (1 - initial_model_specificity))
= (0.5 * 0.81) + ((1 - 0.5) * (1 - 0.82))
= 0.495
total probability of initial model predicting absence in site (accounting for false absences)
=
total_prob_abs = (prior_prob * (1 - initial_model_sensitivity)) + ((1 - prior_prob) * (1 - initial_model_specificity))
= (0.5 * (1 - 0.81)) + ((1 - 0.5) * 0.82)
= 0.505
We can now use Bayes theorem to update our prior probability using the initial model (whilst accounting for the imperfect predictive ability of the model). Since our model predicted that the species does occur within the site, we use the following equation:
posterior probability of species occupying site of interest given prior probability and the initial model predicting the species to be present in site of interest:
=
post_prob1 = (prior_prob * initial_model_sensitivity) / total_prob_pres
= (0.5 * 0.81) / 0.495
= 0.8181818
Please note that if our model had predicted an absence, then we would use the following equation instead:
posterior probability of species occupying site of interest given prior probability and the initial model predicting the species to be absent from site of interest:
=
post_prob2 = (prior_prob * (1 - initial_model_sensitivity)) / total_prob_abs
= (0.5 * (1 - 0.81) / 0.505
= 0.1881188
We have successfully used established methods++++ to calculate the probability of a species occupying a site of interest given a statistical model. We now have an understanding of the probability that the species occupies the site of interest (i.e. 0.82 probability), and all is well.
Now, let us pretend that time passes. As time continues to elapse, more data becomes available. Several years have now passed and it is now 2023. As such, we now have a lot more observation and environmental data. Although we still do not have any observation data for our site of interest, we have have observation and environmental data for an additional 200 sites in our study area. Our initial dataset comprised 100 sites, and our updated dataset -- containing the initial 100 sites and the additional 200 sites -- comprises 300 sites in total (termed "new dataset").
To leverage the new dataset, we will fit a second statistical model (termed "new model") using the new dataset (containing all 300 sites). We will assume that the species' true state (presence/absence) within the site has remained unchanged over time (e.g. it did not go extinct during the last three years). Similar to the initial model, we will calculate sensitivity and specificity statistics for the new model:
new model sensitivity = 0.91
new_model_sensitivity = 0.91
new model specificity = 0.92
new_model_specificity = 0.92
It would seem that the additional data has markedly improved the performance of the model. We will now use the new model to predict if the species occupies our site of interest. The new model predicts that the species has a 70% chance of the species occupying the site and so -- similar to the initial model -- the new model predicts that the species is present in the site.
My question is: our prior belief for the species occupying the site of interest is currently ~0.82%, how do we use Bayes theorem to update our understanding based on the new model? Please note that we -- unless I am mistaken -- cannot simply re-use the previous equations because the initial model is not independent from the new model (because the 100 sites used to fit the initial model were also used to fit the new model). So, I expect that we will need to account for the non-independence of the two models in these calculations? To describe this non-independence, assume that we have predictions from the initial model for the 300 sites (defined as initial_preds
) and predictions from the new model for the 300 sites (defined as new_preds
). Perhaps these predictions could be used to compute the non-independence of the two models (e.g. using a correlation statistic)?
I would greatly appreciate it if you used the previously defined variables when answering this question. I am not very good at reading equations. I would also greatly appreciate it if you could show how the posterior probability would be updated if the new model predicted an absence (instead of a presence).
+ Logistic regression may not be appropriate depending on exact nature of the observation data. I have provided this method as an example. More advanced machine learning methods could be used (e.g. boosted regression trees), or more advanced statistical methods that account for imperfect detection could also be used.
++ A fixed threshold of 50% probability (i.e. 0.5) may not provide the best model predictions for determining if a species occupies a site or does not occupy a site. However, to keep things simple, we will assume that a fixed threshold of 0.5 provides the best predictions in this question.
++++ Basically, applying the formulas in case-study 1 of this paper.