Giter Club home page Giter Club logo

Comments (10)

astaaudzi avatar astaaudzi commented on August 23, 2024

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.

gustavdelius avatar gustavdelius commented on August 23, 2024

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.

astaaudzi avatar astaaudzi commented on August 23, 2024

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.

Kenhasteandersen avatar Kenhasteandersen commented on August 23, 2024

from mizer.

astaaudzi avatar astaaudzi commented on August 23, 2024

@Kenhasteandersen, did you mean to attach a figure?

from mizer.

Kenhasteandersen avatar Kenhasteandersen commented on August 23, 2024

from mizer.

astaaudzi avatar astaaudzi commented on August 23, 2024

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.

gustavdelius avatar gustavdelius commented on August 23, 2024

I have added the getDiet() function. I have not yet worked on the plotDiet() function.

from mizer.

astaaudzi avatar astaaudzi commented on August 23, 2024

@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.

gustavdelius avatar gustavdelius commented on August 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.