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

Two simulation thoughts #16

Open
erex opened this issue Jul 11, 2016 · 0 comments
Open

Two simulation thoughts #16

erex opened this issue Jul 11, 2016 · 0 comments
Assignees

Comments

@erex
Copy link
Member

erex commented Jul 11, 2016

@Kieran-96

I see in your simulations you are choosing to maintain stochasticity in the survey (single.transect.set=FALSE), yet you do not introduce stochasticity in the population process (via load.data=TRUE). I understand the interest of speeding the simulations, but the inconsistent treatment of stochasticity is unusual--probably best to allow stochasticity to operate both upon the survey and the animals.

Secondly, good programming practice does not use concatenation within loops because of inefficiency (http://www.r-bloggers.com/faster-for-loops-in-r/). Your loop over truncation distances uses c(sims, sim). However, you know the number of elements this list will have:

sims <- vector("list", length(Trun.dists))

so allocate that space prior to entering the loop and use the list element operator [[]] to store each of your simulation objects. That will make the final loop more tidy.

@LHMarshall LHMarshall self-assigned this Jan 17, 2017
@LHMarshall LHMarshall added this to the DSsim 1.1.1 milestone Jan 17, 2017
@LHMarshall LHMarshall modified the milestones: DSsim 1.1.1, DSsim 1.1.2 Jan 24, 2017
@LHMarshall LHMarshall modified the milestones: DSsim 1.1.3, DSsim 1.1.2 Mar 15, 2017
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

2 participants