Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revise model_read_lib to output visit-level covariates for PC data #106

Open
mkclapp opened this issue Nov 23, 2022 · 5 comments
Open

revise model_read_lib to output visit-level covariates for PC data #106

mkclapp opened this issue Nov 23, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@mkclapp
Copy link
Collaborator

mkclapp commented Nov 23, 2022

Automatically generate data list with visit-level data for PC data, for use in adding visit-level covariates to the detection level of the model (ie, covariates on p11).

(Right now, we don't have an analogous parameter for the ML detections. We could add this, and use the start time of the file, the mean of the SongMeter temperature log during that time (or morning, if aggregating by day), etc... but I think that should be another issue).

I have code to do this manually, but it would be nice to have it all generated along with "data".

Creating a standalone list might be good so we can have flexibility to include various combinations of covariates in the models and compare them.

List of candidate covariates:
-date
-time of morning
-observer (relevant for point count data/p11 only, not ARU data)
-temperature*
-wind speed*

*I am not sure whether these two variables are available to us at the moment; we may need to extract them from our point count database.

Covariates should generally be standardized to mean = 0. I am going to branch off this issue and add a script that includes my manual way of generating these.

(TODO: I need to remind myself how categorical covariates (such as observer identity) need to be treated in a jags data object; for now, just use numerical covariates)

@mkclapp mkclapp added the enhancement New feature or request label Nov 23, 2022
@mschulist
Copy link
Collaborator

I can work on this over the next few days. I don't see temp and wind in the PC file, so like you said, I think we need to go to Michael Park's database to access them.

@mschulist
Copy link
Collaborator

@mkclapp I think that I was able to create indices for the observer in read_model_lib. It's currently in the survey-covars branch.

It makes a matrix similar to that of y.ind, but instead of the number of counts it has the observer name.

I can work on adding the time and date to the "data list," but I just want to be sure that this formatting would work when indexing it in the jags model. The date and time would have similar formats (at least in the way that I was planning on implementing them).

@ddkapan
Copy link
Collaborator

ddkapan commented Nov 24, 2022

I need to export the relevant data T and wind and we will need to modify the readPC script to accommodate. Finally we can tidy this up and have a separate table of visits with covariates in order to do data imputation etc. A separate issue is to get and clean the metadata from the ARU temperatures.

@ddkapan
Copy link
Collaborator

ddkapan commented Nov 24, 2022

(after a) Happy Thanksgiving y'all!

@mschulist
Copy link
Collaborator

mschulist commented Nov 24, 2022

I just pushed my changes to 106-visit-covars.

I updated model_read_lib to include the observer, date, and time for PC visits. Date and Time are standardized like they were in @mkclapp 's manual script.

I'll work on doing a similar thing for the ARUs, but I'm not sure if I should put them in a vector similar to that of the Scores or in a matrix like y.aru.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants