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

Perhaps a warning when region objects differ between 'make.design' and 'make.population.description` #88

Open
erex opened this issue Jan 29, 2024 · 2 comments

Comments

@erex
Copy link
Member

erex commented Jan 29, 2024

I created a study region of non-default dimensions:

area <- 1300000 # Table 12 of GRAM report
side1 <- 1000
side2 <- area/side1
outer <- matrix(c(0,0,side1,0,side1,side2,0,side2,0,0),ncol=2, byrow=TRUE)
mp1 <- sf::st_polygon(list(outer))
risso.region <- make.region(shape=mp1, units = "km")

I used risso.region to specify the population description

pop.desc <- make.population.description(region = risso.region,
                                        density = make.density(region=risso.region),
                                        covariates = covariate.list, 
                                        N=groups.studyarea)

However, I failed to specify risso.region when calling make.design

transects <- make.design(samplers=12, truncation=trunc.ship)

The resulting mismatch caused half of the transects to fall within a region where there were animals and the other half of the transects falling in a region without animals. Because I had not specified plot(size.cov.survey) to visualise this problem, I stupidly ran hundreds of simulations producing poor precision in my estimates because of the crazed encounter rate variance I had induced.

Suggested code change

Perhaps somewhere in make.simulation there could be a check of the region object from make.population.description matches the region object used in the specification of make.design

@lenthomas
Copy link
Member

Perhaps it could generate a warning if the region object does not match? That way the user could still proceed if they have some good reason for a mis-matched population and design region? (I can't think of a reason offhand, but I'm sure there are some!...)

@LHMarshall
Copy link
Member

I have it on my todo list to re-assess the validation function for Simulation creation. I will do this at the same time as #76

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

No branches or pull requests

3 participants