Comments (2)
Here's whats going on.
When standard deviation is low, there are zero predicted workers in the smallest size classes. Currently the code that deals with prop_foraging
assumes workers of all size classes exist. Because there are zero workers in the smallest size class, it creates a divide by zero error.
foraging_index <- match(FALSE, cum_prop < prop_nforaging)
if (is.na(foraging_index)) { #i.e., no foraging workers
wkr_larv[] <- 0
} else if (foraging_index > 1) {
wkr_larv[1:foraging_index - 1] <- 0
border_case_correction <-
1 - (prop_nforaging - max(cum_prop[1:foraging_index - 1])) / prop_wkr_size[foraging_index]
} else if (foraging_index == 1) { #i.e only part of the smallest size class doesn't forage
border_case_correction <-
1 - (prop_nforaging / prop_wkr_size[1]) #if prop_foraging = 1 this equals 1
}
if (!is.na(foraging_index)) {
wkr_larv[foraging_index] <-
wkr_larv[foraging_index] * border_case_correction
}
Here, prop_wkr_size[1]
is zero.
from bumbl.
replaced "1" with a min_wkr_index
(the first instance of a non-zero proportion in prop_wkr_size), but still didn't fix it because when prop_nforaging = 0
the foraging index is 1 when I think it should be the same as min_wrk_index
from bumbl.
Related Issues (20)
- Add column for convergence HOT 1
- Implicit assumption of colony ID column name in bumbl() HOT 1
- Handle dates correctly HOT 1
- Remove `.nb` versions of bumbl() and brkpt()
- Add contributions.md
- Add a timeline to README
- Warning when number of time steps >> number of tau values HOT 1
- Column name conflicts with covariates when agument = TRUE
- Should plots be marginal effects plots? HOT 1
- Citation should include Eric as a co-author HOT 1
- allow user to supply vector of tau, one value per colony HOT 2
- use optim() for finding optimal value of switchpoint HOT 1
- Fit switchpoint model with all colonies and covariates (rework bumbl() internals) HOT 3
- Inconsistency between vignette and code: should time column be edited to be tau when time > tau? HOT 3
- Add Zenodo DOI to package citation
- bumbl() assumes there is a switchpoint, doesn't test for one
- hex logo HOT 1
- remove `broom` dependency
- Convergence errors with `brkpt()` using OpenBLAS HOT 1
- Release bumbl 1.0.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bumbl.