kaitlyngaynor / gorongosa-mesocarnivores

2 stars 0 forks source link

inclusion of lion covariates #14

Closed kaitlyngaynor closed 4 years ago

kaitlyngaynor commented 4 years ago

Katie: One concern that I just realized today is that there were only 5 lion detections during the first dry season, at 5 different sites. Do you think that's too few to include in the model as we're planning? You'd said at one point that the camera data generally agreed with Paola's data, so maybe it's fine. Unless the model might not like so few detections to work with?

Kaitlyn: I think those species sound good, though you're right, that is NOT a lot of lion detections! I think it's going to be too few, actually—the model may be a little screwy. Maybe we do want to include "lion-ness" as a covariate in the model.

to do: look at how I quantified lion detections previously from Paola data, share w/ Katie

kaitlyngaynor commented 4 years ago

I just dug up the exploration of Paola's collar data that I did last year. These were intended as notes to myself so they may not be super clear but I will share via e-mail right now. Note that the html file will work better if you download and then open the file in the browser. It's not a perfect method. I then just extracted the values of the resulting "all.wet" and "all.latedry" rasters at each camera location and then used these as covariates.

I'm going to start a new script in this repo for lion exploration. My plan is to have a look at total number of detections of lions across the camera survey, and compare this to the extracted raster values from the collar data, and see how well they are correlated. We may try running two separate occupancy models, one with the lion collar covariate and one with the "all lion camera observation" covariate, and see which one makes for a better model fit.

stay tuned!

kaitlyngaynor commented 4 years ago

See script here.

You'll need to drop the input file into your "data/gorongosa-cameras" folder (I'll e-mail now) and then run this script. It will create a new version of the camera metadata with a) a very rough index of lion activity based on collars in the wet and late dry season from 2014-2016 combined, which is biased towards individuals that have been collared, and b) the total number of lion detections at the camera from 2016-2018. They aren't as correlated as I'd initially thought...

These are both imperfect, but you could potentially explore them as covariates (and potentially as covariates that influence co-occurrence/interaction terms in the model), or we might consider alternatives.

klg-2016 commented 4 years ago

Okay I got everything in and am now taking a look at the output

kaitlyngaynor commented 4 years ago

Okay. We can also go back to the drawing board a little bit with the lion collar data and re-quantify lion activity. I just forwarded an e-mail with the raw data & some background on it

klg-2016 commented 4 years ago

To check that I understand: With the GPS data, you take that for an individual and create an isopleth, which is a shape on the map within which that lion's presence was detected? and then what you did was layer each of those shapes on top of each other to get some measure of lion presence at each spot in the region, and then you can split/look at by camera? so lion_latedry does that for all lions (male and female) during the late dry period as defined by Paola? What's the scale for those values? what does a negative value indicate? Is there some "average" and positive/negative is relative to that?

and then for lion_camera, that's simply the total lion detections at each camera over the whole camera-trapping survey?

And to understand your suggestion [could potentially explore them as covariates (and potentially as covariates that influence co-occurrence/interaction terms in the model)]: you're saying we might include either (or both) way of measuring lion presence as environmental covariates in the model? For the Rota model, I thought the environmental covariates were allowed to influence interaction terms?

klg-2016 commented 4 years ago

Also checking the raw data/readme now, though my computer doesn't seem too happy about opening some of the files

kaitlyngaynor commented 4 years ago

There are several isopleths— 0.95, 0.75, 0.50, 0.25, and 0.10. The 0.95 isopleth represents 95% of the total area used (so removes some outliers; can be thought of as the area in which the lion spends 95% of its time); the 0.10 isopleth represents the 10% of the entire area area that is most-used, or the "core" range.... etc. That's how I understood it, at least.

So what I did... and this is a janky, bootleg approach.... is count how many isopleths a given cell (on the map) fell in. If it was just one (the 0.95 isopleth), then it got a "1". If it fell into the 0.95 and 0.75, it got a 2, etc. etc., up to 5 if it fell into all of them. It was scored a 0 if it fell into none of them. I did this for every individual lion for every season (but if the same lion was collared in a given season for multiple years, I only did it for the most recent year).

THEN I added it up for ALL of the lions combined, for each season. I scaled it so that it had a mean value of 0 and a standard deviation of 1, so it's a relative index. It doesn't have a "unit" or anything. Does that clarify?

And yes they are raw shape files, so you'll need to open in GIS software (including R, if you want to go that route—that's what I did in that .html code I shared with you)

And to understand your suggestion [could potentially explore them as covariates (and potentially as covariates that influence co-occurrence/interaction terms in the model)]: you're saying we might include either (or both) way of measuring lion presence as environmental covariates in the model? For the Rota model, I thought the environmental covariates were allowed to influence interaction terms?

Yes, that's what I'm suggesting. You're right, the Rota model allows covariates to influence the interaction terms. So you can look at the effect of tree cover on civet occupancy, the effect of tree cover on genet occupancy, and/or the effect of tree cover on the interaction between civet and genet. (In this case, we'd be talking about lion activity rather than tree cover)

kaitlyngaynor commented 4 years ago

Oh and one last clarification, I then took the resulting map of "relative lion activity" and then extracted the value at each of the camera locations. That's what is in that .csv file that I sent you.

klg-2016 commented 4 years ago

Starting to make more sense, thank you for explaining. Okay so we've decided definitely not to include lions as a species due to low detections during the dry season, and now we're deciding how to include their activity as a covariate with our options being 1) the number you already derived from the GPS data, 2) the overall lion detections from the camera trap data, or 3) something else with the GPS data.

Mmmm I don't have a strong initial feeling as to what would be best. A pro for using the GPS data is that it records spatial use all the time, but it only gives information from 16 lions. A pro of using the camera trap data would be its ability to record any lion that goes by, but we know the detection rates are low.

(I'm just thinking out loud here)

kaitlyngaynor commented 4 years ago

Yes, I think you've outlined the options clearly.

Another benefit of the camera records is that we know the lion was AT that location, vs. just in the general vicinity (the collar data polygons don't necessarily mean that the lion was in every spot within them). But then again, maybe general lion activity in the vicinity is more relevant anyway. Of course, we are using a period that extends far longer than the survey period, which isn't great.

I was going to suggest trying another collar-based approach that just uses the 2016 late dry lion data, but it looks like they only cleaned up the data through 2016 early dry, unfortunately (and it's only a handful of individual lions).

Either way, there will be caveats. I might suggest just trying both 1 and 2 and going with whatever model has a lower AIC, but it's always a good idea to be intentional up front rather than cherry pick. Hmm.

On Thu, Jul 16, 2020 at 12:11 PM klg-2016 notifications@github.com wrote:

Starting to make more sense, thank you for explaining. Okay so we've decided definitely not to include lions as a species due to low detections during the dry season, and now we're deciding how to include their activity as a covariate with our options being 1) the number you already derived from the GPS data, 2) the overall lion detections from the camera trap data, or 3) something else with the GPS data.

Mmmm I don't have a strong initial feeling as to what would be best. A pro for using the GPS data is that it records spatial use all the time, but it only gives information from 16 lions. A pro of using the camera trap data would be its ability to record any lion that goes by, but we know the detection rates are low.

(I'm just thinking out loud here)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kaitlyngaynor/gorongosa-mesocarnivores/issues/14#issuecomment-659613363, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WTY3KQI7MGOEQIKNAB3R35GE5ANCNFSM4O3JX3MA .

-- Kaitlyn Gaynor Postdoctoral researcher National Center for Ecological Analysis and Synthesis University of California - Santa Barbara

klg-2016 commented 4 years ago

I'm going to see if how many lion detections there were across both dry seasons as we've now decided to define them from the camera trap records to see if that might be an option (use camera trap but have it be limited to the "right" months)

kaitlyngaynor commented 4 years ago

good thinking!

On Thu, Jul 16, 2020 at 12:35 PM klg-2016 notifications@github.com wrote:

I'm going to see if how many lion detections there were across both dry seasons as we've now decided to define them from the camera trap records to see if that might be an option (use camera trap but have it be limited to the "right" months)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kaitlyngaynor/gorongosa-mesocarnivores/issues/14#issuecomment-659625429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT7RB2BOGUOADJ4FCLLR35JALANCNFSM4O3JX3MA .

-- Kaitlyn Gaynor Postdoctoral researcher National Center for Ecological Analysis and Synthesis University of California - Santa Barbara

klg-2016 commented 4 years ago

Okay the first dry season has 9 total detections across 6 cameras (all right along the water) The second dry season has 16 detections across 10 sites (mostly right by the water) and the third dry season, if we only look at Aug 1 to cameras being taken down, has 1 detection at a single site

so 25/6 total detections, which is still low but maybe not too bad? and addresses the issue of using lion data outside the time period of interest. I still don't know that this would be better than the late dry data from the collars though

kaitlyngaynor commented 4 years ago

I couldn't find the scripts where you were doing all of this but I added some of it into the lion-exploration script so I could have a closer look, and I exported 2016 dry, 2017 dry, and 2016+2017 dry camera records of lions alongside the other lion data. If you re-run the script it will append to the metadata and overwrite the old version.

This is in contrast to 87 detections across 19 cameras if we look at the entire two-year period, just for the record. I was interested to see how the number of lion records across ALL seasons matched up to the lion records in the dry season only (of course the dry season records are part of all records so we assume they'll be correlated to some extent...)

The lion distributions (from collars) don't shift all that much in wet vs dry, so I kind of feel like if we are going to include the second season of late dry, we may as well include the first season of wet, and maybe even all of the data... lion densities are also changing year-to-year, so the first year wet may even be more similar to the first year dry than the second year dry is to the second year dry.

This will allow for slightly more variability in the covariate (as opposed to having 44 sites with a value of 0, and then 16 sites with a slightly higher value... and it also seems like they are fairly correlated.

Have a look at the lion exploration script and sorry if I duplicated another script you had elsewhere!

klg-2016 commented 4 years ago

Even having spent good chunks of this week working on coding, it did not even occur to me to work to get those numbers for comparison by writing a script. I just went to the shiny app and counted. So you absolutely didn't duplicate anything I did, thank you for adding what you did!

Taking a look now

klg-2016 commented 4 years ago

When you say that the lion distributions (from collars) don't shift much wet vs dry, is that based on something in this script or somewhere else? Just to understand where it's coming from.

Also, when you say "this will allow for slightly more variability in the covariate", you mean including wet season camera data instead of limiting only to dry?

Do you think the lion density changed enough over the total period to warrant not including the second year at all?

klg-2016 commented 4 years ago

I plotted lion late dry vs lion wet from the collar data and there didn't seem to be a correlation, but I'm not sure if that's what you're referring to (re: my first question)

kaitlyngaynor commented 4 years ago

When you say that the lion distributions (from collars) don't shift much wet vs dry, is that based on something in this script or somewhere else? Just to understand where it's coming from.

Just based on visual observations... if you have a look at the .html file that I sent you with the isopleths, the 3rd to last map is the wet season, and the last map is the late dry season—there are similar hotspots. Also, reading Bouley et al. it seems like home ranges expand slightly in the late dry but I think if you plot it for a single individual over time, it doesn't move much.

Also, when you say "this will allow for slightly more variability in the covariate", you mean including wet season camera data instead of limiting only to dry?

Yes. But including ALL data, we can clearly identify the hot spots of lion activity, identify some moderate and low activity sites, vs. no activity sites. But looking at only a single season gets you high vs no lion activity. Not as much variation in the covariate.

Do you think the lion density changed enough over the total period to warrant not including the second year at all?

No, I don't think so... it IS going to be an imperfect measure, no matter how we slice it... we need to be prepared to defend the decision if/when it comes to it!

We may also see that this variable doesn't improve the models and drops out, which I wouldn't be surprised to see.

klg-2016 commented 4 years ago

Makes sense, thank you!