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

model_read_lib visitAggregation is incorrect. #78

Open
matt-har-vey opened this issue Jun 29, 2022 · 5 comments
Open

model_read_lib visitAggregation is incorrect. #78

matt-har-vey opened this issue Jun 29, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@matt-har-vey
Copy link
Collaborator

Setting aggregation to day does not do the right thing (per report in 6/29 meeting).

This issue tracks manual verification of each allowed setting and fixing as necessary.

@mkclapp
Copy link
Collaborator

mkclapp commented Jul 27, 2022

Setting visitAggregation = "day" now suddenly seems to work in the script combined.R without me changing anything else. The values for the # of ML 'hits' per morning appears reasonable. If someone else could confirm, I think we can close this issue? @matth79

The bad news is that simply changing the aggregation didn't seem to make model fit any better (MCMC chain convergence fails the Rhat < 1.1 rule-of-thumb for most parameters monitored) so we still have our work cut out for us in terms of model specification and fit. Some things to check off the top of my head (jotting down here before starting a new issue):

  • prior specification in JAGS model. Right now, they're very uninformative
  • reasonable values/ranges for input data. For example, making sure visit index is an integer between 1 and nvisit, and not the Julian day of the visit - it looks like this is the case for data$indices$visit.aru but not data$indices$visit.pc. (We should also make sure the date corresponding to the visit is stored somewhere, for if/when we use Julian date in the model for detection.)
  • nsite for aru = 84; nsite for pc = 81. This may be causing problems in estimating anything at the site level (eg. z, p) if our PointIndex isn't doing what we want it to do. Need to investigate whether JAGS code is "smart" enough to read the site identifiers rather than just their place in the index of sites (or if we need to be smart enough to explicitly code that)
  • ...probably other things

@ddkapan
Copy link
Collaborator

ddkapan commented Aug 17, 2022

@mschulist Can you confirm this works as @mkclapp says if so this issue and a referring issue #61 can be closed.

@mschulist
Copy link
Collaborator

I reran the script and it does work without errors, but I cannot find the object visitAggregation in combined.R. So it works, but I could be on the incorrect branch.

@mkclapp
Copy link
Collaborator

mkclapp commented Aug 17, 2022

Hi @mschulist,
it is an argument of the readCombined function and can simply be added to the others as such (I think/hope):

data <- readCombined(
species = c(speciesCode),
years = c(year),
visitAggregation = "day", # the other option would be "file"
visitLimit = aruVisitLimit,
thresholdOptions = list(
value = threshold,
is.quantile = F
),
squeeze = T
)

Feel free to add and push if you have an open branch for this issue!

@ddkapan
Copy link
Collaborator

ddkapan commented Aug 23, 2022

  • Looking like aggregation working, correct?

  • But let's discuss and address the great stuff above in Matt's comments before closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants