sizespectrum / mizer

Multi-species size-based ecological modelling in R
https://sizespectrum.org/mizer
36 stars 42 forks source link

Modelling of unstructured resources in mizer #46

Closed gustavdelius closed 5 years ago

gustavdelius commented 5 years ago

In order to be able to model detritus and carrion in shallow soft-bottom fishing grounds, we are adding unstructured resource components to mizer. The currently proposed design of the new feature is described at http://gustavdelius.github.io/mizer/reference/resource_dynamics.html. This is a call for comments.

Kenhasteandersen commented 5 years ago

Nice idea.

A conceptually simpler approach would be to treat the additional resources like the plankton resource spectrum, just with one size bin. The encounter between a predator and resource should be governed by the same encounter procedure as with other resources. The extra is an additional preference parameter between the predator species and the resource type, and possible a nutritional value of the resource (relevant for benthic food). In this way we can deal with these additional resource just by extending the existing resource concept. A resource is then described by:

Then the encounter between the predator and the resource becomes (mass per time):

E_ij(w) = V_i(w) k_j psi(w, wR_j) rho_i_j BR(wR) * dwR_j

where V(w) is the predators’ clearance rate (the same as used for fish) and psi is the normal size preference. The total encountered resource is then:

E_i(w) = sum_j E_ij(w)

In this way the “new” resource is treated just like the “old” plankton resource. The plankton resource will here be represented as vector of resources.

It is just a suggestion; use it as you see fit.

Ken


Ken H. Andersen, http://ken.haste.dkhttp://ken.haste.dk/, twitter: @69kno Professor in theoretical marine ecology, head of section, and deputy director of Centre for Ocean Life http://www.oceanlifecentre.dkhttp://www.oceanlifecentre.dk/

New paper: A trait-based approach to ocean ecologyhttps://www.google.com/url?q=https://academic.oup.com/icesjms/advance-article/doi/10.1093/icesjms/fsy090/5056134&sa=D&sntz=1&usg=AFQjCNFVkw1WnenGUFvOaKHEPxp8I30XKA. ICES Journal of Marine Science 2, 65–70 (2018)

[cid:image001.jpg@01D09493.A377DFB0]

On 15 Mar 2019, at 09.38, Gustav W Delius notifications@github.com<mailto:notifications@github.com> wrote:

In order to be able to model detritus and carrion in shallow soft-bottom fishing grounds, we are adding unstructured resource components to mizer. The currently proposed design of the new feature is described at http://gustavdelius.github.io/mizer/reference/resource_dynamics.html. This is a call for comments.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/sizespectrum/mizer/issues/46, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMp1gRj2YJN-eIJScyKwe0QHXnvTiJnMks5vW1vtgaJpZM4b19Yb.

gustavdelius commented 5 years ago

Hi Ken,

thanks for you comment and your suggestion for modelling size-based feeding on resources using the standard predation kernel. However the purpose of my current proposal is to model feeding that is explicitly not size-based, like feeding on plants or on carrion. So I do not want to use the predation kernel. Also my proposal is concerned with the challenge of setting up mizer in such a way that people can model all kinds of different dynamics for their resources. Our current interest is in investigating the effect of the landing obligation, which affects the influx of carrion. I believe Asta is interested in plants. Mizer should work for all these different situations.

Gustav

Kenhasteandersen commented 5 years ago

However the purpose of my current proposal is to model feeding that is explicitly not size-based, like feeding on plants or on carrion. So I do not want to use the predation kernel.

Makes sense. So just ignore my suggestion.

Ken

astaaudzi commented 5 years ago

Hi Gustav,

apologies for taking so long to reply. I read through the description and it seems like a good compromise between different levels of complexity that detritus or carrion dynamics can introduce.

I have a few questions and comments: 1) It is not clear to me whether size structured species can feed on a mix of unstructured and structured resources? This is probably the case in many real systems, but it adds an extra level of complexity (parameters needed to define preference for and assimilation efficiency of different resources). If a species can only feed on size structured+plankton or unstructured resource - where do we indicate that? Is there an extra parameter in the species_params file?

2) Apologies, but it is still not clear to me how the feeding rate on the unstructured resource is calculated, or more specifically how mizer will calculate the feeding level? At the moment I can only see the parameter rho that defines mass specific encounter rate (similar to search rate). What are the units? But don't we need a mass specific maximum intake parameter for the intake on this resource to estimate the feeding level while feeding on the unstructured resource? Or is it assumed to be identical to the maximum intake rate (g/g/year) of any resource, which is h parameter in mizer?

3) The key challenge in representing carrion and detritus dynamics is to get some idea about the external losses, i.e. decomposition by bacteria and organisms not included in the model. This will have a substantial effect on the model dynamics. The "external" parameter now defines the positive or negative influx from external sources. What are the units? Presumably we assume the rate of influx is then fixed, and does not change in response to e.g. abundance of the carrion/detritus (so no internal dynamics, which is a good idea).

Asta

gustavdelius commented 5 years ago

Hi Asta, thank you for your comments.

  1. In the current proposal a species could feed on anything. If it should not feed on a particular resource, then the corresponding $\rho{id}$ should be set to zero, if it should not feed on a particular species then the corresponding $\theta{ij}$ should be set to zero and if it should not feed on plankton then a new species parameter interaction_p (perhaps someone can come up with a better name) should be set to zero. You spotted well that such a new parameter is needed. You also mention that we might like to have different assimilation efficiencies for different food sources. Currently mizer does not allow that, having a parameter $\alpha$ that does not depend on the prey species. Maybe that should be generalised, with one $\alpha$ for each prey species and for each resource?

  2. Currently it is indeed envisaged that there shall be only a single $h_i$ parameter specifying the total maximum intake rate of species $i$. So the encounter rates from all species, plankton and unstructured resources are added together before being used to calculate the feeding level with the standard formula involving $h$. Do you think that is too restrictive?

  3. The dynamics that should be chosen for detritus and carrion is still a matter of research. So the formalism is set up so that it can accommodate any dynamics.

You also ask about units of parameters. The units are always fixed by the equations in which the parameters appear. The encounter rate $E_i(w)$ has units of grams/year. Hence $h$ has units of grams^(1-n)/years and $\rho$ has units of $grams^(-n)/year$. One will always get such weird mass dimensions for parameters like $h$ or $\rho$ that are coefficients in allometric power laws. The units of the parameter for the external rate of change of the resource biomass are grams/year.

juliablanchard commented 5 years ago

Hi Gustav,

Apologies for my delayed reply as well (I’m on parental leave).

This approach is similar to how I’ve been modelling size structured and unstructured model components and I agree it would be nice to have these options available in mizer.

I was going to suggest a similar approach as Ken suggested with a couple of additional suggestions for “non size-based feeding” and fluxes into a resource spectrum if it is detritus/carrion.

In terms of how the background resource spectra are set up it is quite handy and already could represent the size dependence of certain parameters if there is an additional parameter that specified what kind of resource it is. If it’s detritus and carrion it might be useful if it could still be size-structured or occupied a size range - discarded fish or whale falls are larger than larval fish faeces. I know Eric Benoit was working on size structured detritus quite a few years back.

The fluxes into and out of the resource size class could be represented in the same way that you have done - it’s just they these could be assigned to the corresponding size class ( or perhaps spread out across a range of size classes). In reality particles may loose weight with sinking depending on depth and sink at rates depending on size so not sure how much detail needs to be represented there...

In terms of detritovire/herbivore consumers that feed on detritus or macroalgae the key aside the is that they do not change what they feed on as they grow larger. This is the reason why we’ve been using the modified feeding kernel that remains fixed on a certain size range throughout life. So in this way consumer species or groups can target different size ranges ( which could even be larger than themselves in terms of scavengers eating carrion for example ) but these are fixed across all sizes classes so they effectively feed on a shared resource. That could be done without changing the framework that much, and again is why we’ve been altering the feeding kernel.

I also wondered if it would be more streamlined to just include the resource spectra into the interaction matrix?

I agree with comments about species specific alpha for different assimilation efficiencies that also reflects prey quality. Awhile back I looked at some data comparing fish and invert and found those to be the biggest differences, but more recently we’ve been looking into differences in C:N:P ratios.

On a different note I like the way you’ve set up github pages to present the vignette info and other Info. I think it would be great to migrate that over to the “official” size spectrum github as well ( is that what you were planning?). I’d be keen to add a section on calibration at some stage.

Hopefully these comments are so coherent- pretty sleep deprived at the moment with a newborn... but happy to chat if it’s helpful. And of course feel free to ignore the above if not helpful. Again I do think the approach suggested will be useful.

Best wishes, Julia

Sent from my iPhone


From: Gustav W Delius notifications@github.com Sent: Tuesday, April 2, 2019 6:10 pm To: sizespectrum/mizer Cc: Subscribed Subject: Re: [sizespectrum/mizer] Modelling of unstructured resources in mizer (#46)

Hi Asta, thank you for your comments.

  1. In the current proposal a species could feed on anything. If it should not feed on a particular resource, then the corresponding $\rho{id}$ should be set to zero, if it should not feed on a particular species then the corresponding $\theta{ij}$ should be set to zero and if it should not feed on plankton then a new species parameter interaction_p (perhaps someone can come up with a better name) should be set to zero. You spotted well that such a new parameter is needed. You also mention that we might like to have different assimilation efficiencies for different food sources. Currently mizer does not allow that, having a parameter $\alpha$ that does not depend on the prey species. Maybe that should be generalised, with one $\alpha$ for each prey species and for each resource?

  2. Currently it is indeed envisaged that there shall be only a single $h_i$ parameter specifying the total maximum intake rate of species $i$. So the encounter rates from all species, plankton and unstructured resources are added together before being used to calculate the feeding level with the standard formula involving $h$. Do you think that is too restrictive?

  3. The dynamics that should be chosen for detritus and carrion is still a matter of research. So the formalism is set up so that it can accommodate any dynamics.

You also ask about units of parameters. The units are always fixed by the equations in which the parameters appear. The encounter rate $E_i(w)$ has units of grams/year. Hence $h$ has units of grams^(1-n)/years and $\rho$ has units of $grams^(-n)/year$. One will always get such weird mass dimensions for parameters like $h$ or $\rho$ that are coefficients in allometric power laws. The units of the parameter for the external rate of change of the resource biomass are grams/year.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/sizespectrum/mizer/issues/46#issuecomment-478872901, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEw_uliN7Fn8WsnKp5L21n-iN3_TYNRMks5vcwJpgaJpZM4b19Yb.

University of Tasmania Electronic Communications Policy (December, 2014). This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.

gustavdelius commented 5 years ago

Hi Julia, thank you very much for your comments. I'll comment on them one-by-one.

  1. Like Ken, you argue for size-resolved resources. I see that that is more versatile than the unstructured resources I am proposing and that the feeding on unstructured resources could be seen as a special case of feeding on size-resolved resources where the feeding kernel is size-independent. This would mean that the unstructured resources are not be needed. However, modelling size-structured resources, especially if fed upon with feeding kernels that do not have constant predator/prey size ratio, is slow. So I think we really would like both in mizer: unstructured resources (for situations where that is good enough) and size-structured resources (like plankton but more of them).

  2. The reason why I do not extend the theta matrix to include the unstructured resources is that the information on which species feeds on which resource is included in the rho matrix. I don't want to include rho in the interaction matrix, because unlike the entries in the interaction matrix, the entries in rho are dimensionful (they are rates). Combining them into one matrix I think could be confusing.

  3. Having an alpha matrix that depends on prey species seems very sensible. It even seems to me that the conversion efficiency will depend more on the prey species than on the predator species, so it is a bit surprising that currently it depends only on predator species. What would be a convenient way for uses to specify the alpha matrix? Would it be reasonable to factorise it as alpha[i, j] = alpha_pred[i] * alpha_prey[j]?

  4. Yes, I was going to propose to give the official mizer code a website similar to the one for my fork. I was just waiting until it is a bit more polished. But given that you would like to contribute a calibration section, which would be extremely useful, it might be a good idea to make that website soon. I'll create a separate issue for that.

juliablanchard commented 5 years ago

Very valid reasons Gustav. It sounds like going with unstructured pools as you suggest is the way forward. Agree with the other points too.

Sent from my iPhone


From: Gustav W Delius notifications@github.com Sent: Tuesday, April 2, 2019 10:13 pm To: sizespectrum/mizer Cc: Julia Blanchard; Comment Subject: Re: [sizespectrum/mizer] Modelling of unstructured resources in mizer (#46)

Hi Julia, thank you very much for your comments. I'll comment on them one-by-one.

  1. Like Ken, you argue for size-resolved resources. I see that that is more versatile than the unstructured resources I am proposing and that the feeding on unstructured resources could be seen as a special case of feeding size-resolved resources where the feeding kernel is size-independent, so that the unstructured resources would not be needed. However, modelling size-structured resources, especially if fed upon with feeding kernels that do not have constant predator/prey size ratio, is slow. So I think we really would like both in mizer: unstructured resources (for situations where that is good enough) and size-structured resources (like plankton but more of them).

  2. The reason why I do not extend the theta matrix to include the unstructured resources is that the information on which species feeds on which resource is included in the rho matrix. I don't want to include rho in the interaction matrix, because unlike the entries in the interaction matrix, the entries in rho are dimensionful (they are rates). Combining them into one matrix I think could be confusing.

  3. Having an alpha matrix that depends on prey species seems very sensible. It even seems to me that the conversion efficiency will depend more on the prey species than on the predator species, so it is a bit surprising that currently it depends only on predator species. What would be a convenient way for uses to specify the alpha matrix? Would it be reasonable to factorise it asalpha[i, j] = alpha_pred[i] * alpha_prey[j]?

  4. Yes, I was going to propose to give the official mizer code a website similar to the one for my fork. I was just waiting until it is a bit more polished. But given that you would like to contribute a calibration section, which would be extremely useful, it might be a good idea to make that website soon. I'll create a separate issue for that.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/sizespectrum/mizer/issues/46#issuecomment-478950646, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEw_uts-zQkmih7WgL6wM-qevQtM_NV2ks5vcztVgaJpZM4b19Yb.

University of Tasmania Electronic Communications Policy (December, 2014). This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.

astaaudzi commented 5 years ago

Hi Gustav,

I think that having several background spectra, both size structured and/or unstructured would definitely be useful and needed, especially in multi-species models. A parameter defining availability of these spectra to consumers is also required. How to setup up these parameters in the most efficient and clear way should be discussed. In my fork of mizer I have added two additional size structured background resources (which now has plankton, benthos and algal spectra) and introduced three additional parameters in the species parameter file, defining availability of these resources to consumers (avail_pp, avail_bb, avail_aa). As plankton and benthos resources have different minimum and maximum sizes this produces a natural ontogenetic diet transition from plankton to benthos and then to fish, if a species is a predator. For planktivores and herbivores the availability of benthos is set to 0 and for benthivores the availability of plankton is small, so they switch to benthic food when it fits into the predation kernel.

In this way the availability parameter could be added into the interaction matrix, because it is just a scalar. The rate with which the resource is consumed would then be determined by the standard gamma and h parameters. It seems to me that defining another rate parameter rho might be confusing and harder to justify. Is there a good reason why rate rho (encounter of unstructured resource) should be different from gamma? Or perhaps I misunderstood something?

I also agree that different food items have different assimilation rates, but this will produce a potentially huge number of additional parameters. Other ecosystem models (my experience here is only with Atlantis) have four different assimilation efficiencies for each species: animals, plants, labile detritus and refractory detritus. I suppose it could be up to the users to decide if they like to deal with many parameters :) If the setup of alpha matrix is straightforward and we still have the option to use one alpha in the species_params matrix, this could be useful.

Finally, since the post was asking for feedback about the detritus dynamics, I can mention that I thought about it quite a bit while writing a manual for the Atlantis model (the model was written by Beth Fulton and Bec Gorton, I only wrote the documentation). Detritus dynamics can get complicated (see chapter 10.7 in the manual part 1, which is available through https://research.csiro.au/atlantis/home/useful-references/ or search for the word detritus to see how it affects various processes). The key challenge is to ensure that availability of detritus to consumers is set as a very small fraction of the total pool. Otherwise consumers just eat detritus and species interactions disappear.

gustavdelius commented 5 years ago

Hi Asta, I very much like what you write about the usefulness of multiple size-structured resource components. I have created a new issue #49 with the request to enhance mizer to allow that and copy your description there as a start of discussing how to best set it up in detail.

You ask why I gave a different name rho to the encounter rates for unstructured resource from the gamma used for size-structured resources. The reason is that gamma is only one factor in a complicated expression for the encounter rate, also containing the predation kernel. On the other hand rho just needs to be multiplied by the resource biomass to give the encounter rate. I felt that giving the same name to both would be confusing. People might think that similar numerical values for the rates gamma and rho might have similar meaning, which is not the case.

I have put the discussion of extending alpha to a matrix into a separate issue #50 to keep our discussions organised.

Thank you for the link to the Atlantis user guide. Very impressive. The fact that some people may want to write a rather detailed detritus model is the reason why in my proposal the dynamics of the unstructured resources is handled via user-defined functions, rather than being dictated by mizer.