Comments (10)
Yes, @gustavdelius this is exactly what I have asked.
I think such a function would very useful for all mizer users. We have tried different diet explorations, and many users were surprised to find out that their species fill up almost entirely on the background spectrum. If the background spectrum has high regeneration rate (r_pp = 10, for example, which is default in mizer), there is not much depletion happening and people effectively end up running a many parallel single species models. So looking at realised diets would be an important step in model development.
Ideally, there would also be a function to plot the realised diets by predator size for each predator. This should not be that difficult to write in ggplot.
from mizer.
I agree with Asta. The plot of the diet also takes a central role in our shiny app for tuning mizer for an ecosystem that we hope to contribute very shortly. The above function I can contribute on the weekend. I also agree that there should be an associated plot function. However it is not entirely clear what the best visualisation would be. We made a line plot that showed one curve for each prey species describing the rate of consumption of that prey against the predator size, for one specified predator species. @astaaudzi made a panel plot with one panel for each predator species showing the proportion of its diet coming from each prey species. So perhaps the plot function should have a style
option.
from mizer.
I guess both options would be very useful and give different information. A prey might have very high mortality from some predator, but still constitute a negligible proportion of predator's diet (who might still be eating mostly background spectrum). By the way, the panel plot was made by Jon Reum using his code to calculate diet proportions by predator x size x prey x size.
from mizer.
from mizer.
@Kenhasteandersen, did you mean to attach a figure?
from mizer.
from mizer.
Thanks. This looks good and makes a lot of sense. I think the issues may arise in a multi-species setup, where species w_inf are nowhere near equally spaced, the interaction matrix has a lot of zeroes (because there is no evidence of those species in diets) and PPMRs are very different across species (some planktivores, some predators, etc).
This is probably quite far from the original idea of size based model in a pelagic system (if I understand it correctly), but it is a direction mizer is now increasingly often used I think.
In summary, a diet output and plot function would be very useful :)
from mizer.
I have added the getDiet() function. I have not yet worked on the plotDiet() function.
from mizer.
@gustavdelius , I have just started looking into using this function for my model. As I understand the getDiet will give me the biomass of prey consumed by all predator individuals in a size class? Since this function gives a rate I suppose the units are in g/year?
Just to make sure I understand this properly:
So to get the amount of prey consumed by a single fish we would need to divide getDiet output by the numbers of predators at a given time step. Otherwise the consumption in grams is decreasing with the size of a predator. Then to get diet proportions we further should divide this by the total amount of prey consumed by each size class of a predator? I imagine it is the last value (diet proportion) that is of most interest to users
from mizer.
@astaaudzi , the function currently returns the biomass of prey that a single predator consumes. The documentation of the current version is at https://sizespectrum.github.io/mizer/dev/reference/getDiet.html. Let me know if it should be clarified.
Given what you say about people being interested in the proportion of the diet coming from each prey species rather than the biomass, I propose that we add a boolean parameter proportion
which causes the function to return the proportion when set to TRUE
and the biomass when set to FALSE
. Does that sound like a good idea?
from mizer.
Related Issues (20)
- Fix colours for species in NS_params
- Set and document default for exponents in `set...()` functions
- Avoid using $ notation for species parameters with short names
- Better error message when `getParams()` is not called with MizerSim object
- Extra parameters to model discards HOT 2
- Iterative method for finding steady state HOT 1
- Release mizer 2.4.0
- Don't warn repeatedly when l_mat and w_mat are inconsistent HOT 2
- Speed up inner loop
- `matchGrowth()` gives error when there is no `w_inf` column HOT 1
- In `addSpecies()` only issue warning if feeding level drops below critical level
- Different resource's default values between newTraitParams() and newMultispeciesParams() HOT 1
- `get_h_default()` should provide default even when no growth info is available
- `get_phi()` should check that it returns valid positive values
- Other components at all time steps are always equal to final time step
- Adapt `plotYieldObservedVsModel()` and `matchYield()` to work with multiple gears
- Append argument in project function appears non-functional HOT 1
- External encounter rate
- `addSpecies()` should get `info_level` argument
- Make `matchGrowth()` work when `n != p`
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 mizer.