Dsims error for run.simulation

39 views
Skip to first unread message

Janet

unread,
Nov 3, 2022, 2:37:43 PM11/3/22
to distance-sampling
Hello,
I am new to distance sampling and am learning dsims as I run through the various tutorials and vignettes but adapting them to my survey design. I am attempting to run simulations to compare the use of different strata using the same survey design and population descriptions. When I run a single instance of a simulation using run.survey, things display correctly. However, when I attempt to run.simulation, it is giving me the following error: 

Error in Distance::unflatten(dist.data) :
  Region areas are not consistent.

Can anyone provide some context about why dsims might be giving me this error? Thanks!
Janet

Laura Marshall

unread,
Nov 3, 2022, 5:48:38 PM11/3/22
to Janet, distance-sampling
Hi Janet,

This sounds like an issue with the data generation in dsims, the error is then generated at the analysis stage.
Can you please send me your code / additional files off list directly to l...@st-andrews.ac.uk and I'll take a look.

Kind regards,
Laura


Dr. L Marshall

Centre for Research into Ecological & Environmental Modelling

University of St. Andrews

Tel: +44 (0)1334 461808


Please note that my core working hours are now concentrated between 9am Tuesday and 1pm Thursday. There may be a delay in my response to E-mails outwith these times.




From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Janet <jlmo...@dal.ca>
Sent: 03 November 2022 18:37
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] Dsims error for run.simulation
 
--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/153ed7ae-4a22-4454-9a55-4fe6c0441e28n%40googlegroups.com.

Lisa Marie Leclerc

unread,
Sep 6, 2023, 11:11:29 AM9/6/23
to distance-sampling
Hi Laura, 

I recently experienced the same issue that Janet. Everything is ok,  until I run the simulation, than the same error message come up. 

sim <- run.simulation(simulation = sim)
Error in Distance::unflatten(dist.data) :
 Region areas are not consistent.

My region file is broken down into strata. If I set it to 5 simulations and under, this error message doesn't come up. Of course, I would like to run it at least 100 times ...

Your help will be appreciated!

Lisa

Eric Rexstad

unread,
Sep 6, 2023, 11:27:47 AM9/6/23
to Lisa Marie Leclerc, distance-sampling
Lisa

Your problem does sound similar to that reported last November. I suspect the solution to your problem may be shapefile-specific. Hence, if you would be willing to send your shapefile as well as your dsims​ code directly to me at eric.r...@st-andrews.ac.uk and we can have a look.

From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Lisa Marie Leclerc <lisalec...@gmail.com>
Sent: 06 September 2023 16:11
To: distance-sampling <distance...@googlegroups.com>
Subject: Re: [distance-sampling] Dsims error for run.simulation
 

Laura Marshall

unread,
Sep 13, 2023, 3:12:21 PM9/13/23
to Lisa Marie Leclerc, distance-sampling, Janet Mossman
Dear Lisa, Janet and List

This was an issue with observations which occurred across stratum boundaries. In this situation there was a mismatch between the stratum ID's for the individual and the transect resulting in NA values in the Area column which results in the error.

I have now resolved this so detections currently cannot be made across stratum boundaries. 

dsims can be installed with these fixes using the following code (we also plan to have dsims back on CRAN with these changes during October)

# First, ensure you have a copy of the devtools package
if (!nzchar(system.file(package = "devtools"))) install.packages("devtools")
# install dsims from github:
devtools::install_github("DistanceDevelopment/ds...@CRAN-1.0.3",
                         build_vignettes = TRUE)

Best wishes,
Laura

Dr. L Marshall

Centre for Research into Ecological & Environmental Modelling

University of St. Andrews

Tel: +44 (0)1334 461808


While I may send emails outside of my normal office hours, I have no expectation of a response outside of yours.

Please note that my core working hours are now concentrated between 9am Monday and 2pm Thursday. There may be a delay in my response to emails outwith these times.





Sent: Wednesday, September 6, 2023 4:11 PM
To: distance-sampling <distance...@googlegroups.com>
Subject: Re: [distance-sampling] Dsims error for run.simulation
 
Reply all
Reply to author
Forward
0 new messages