gustavdelius / mizer

This is my old mizer fork that is not actively used any more but still has lots of material in its many branches.
http://gustavdelius.github.io/mizer/
0 stars 2 forks source link

Create set_scaling_model() similar to set_trait_model #19

Closed gustavdelius closed 6 years ago

gustavdelius commented 6 years ago

Create a new function that sets up the model with equally spaced species that are scaling copies of each other. So the function is very similar to set_trait_model with four main differences:

  1. The egg size is proportional to the maturity size for each species
  2. The species are properly aligned with the grid
  3. The plankton and background death are chosen so as to produce almost perfect power-law growth and death.
  4. The parameters are chosen so that R_0 is close to 1 for each species Thus this should essentially just wrap our existing stable community code. Then the vignette needs to be extended to describe this setup.
richardsouthwell commented 6 years ago

Additional differences are:

  1. The scale free model we investigated so far had step-like psi function.
  2. The exponents in the scale free model are chosen specially so metabolic loss scales with weight like energy income, and we cannot include scale free death terms like fishing mortality.
  3. We may want to include chi as an initial parameter choice, so we can stabilize the steady state.
richardsouthwell commented 6 years ago

Are we going to define Rmax like they do in the trait based model ?

richardsouthwell commented 6 years ago

I'm trying to decide how to setup the size specifications. In addition to eta=w_mat/w_inf, I think we should include eta_egg=w_egg/w_inf. We also need to coerce the inputs to lie on grid points I guess.

gustavdelius commented 6 years ago

Regarding Rmax, I would introduce an extra argument, say Rfac, and then for each species set Rmax to be larger than the actual number of eggs by a factor of Rfac. I would set the default to something large, like Rfac=10.

richardsouthwell commented 6 years ago

Do we need to include the line params@srr <- function(rdi, species_params) {return(rdi)} ?

richardsouthwell commented 6 years ago

Have got code that runs something presumably close to stable. But there are issues such as:

gustavdelius commented 6 years ago

I agree with your points. Point (4) I think should go into its own issue. Will you create one? Can you explain your question regarding plot(sim) in point (2)? Is that also a proposal to improve the plots? In that case, another issue please.

richardsouthwell commented 6 years ago

In gen_solve_mod_multipliers_chosen.R (in chi_den_sol_2 branch) I Put specific abundance multipliers into general solver which uses fake background and plankton. Now the output looks a lot more like stable_community.R, with some small issues with curling up at the RHS. So gen_solve_mod_multipliers_chosen.R can maybe be used as an alternative way to find the steady state when we setup the scale free model.

richardsouthwell commented 6 years ago

If we have time it would be nice to develop this code into a tools for finding steady states of general heterogeneous systems. In particular, we could include a tool that manipulates the background death/resource artficially in order to create a system at steady state (basically the above). The user could also have the option of using more realistic the background death/resource present in the pure background system we wish to emulate. In this case the output cannot be guaranteed to be an exact steady state. One may add steps (optimizing by varying the abundance multipliers, and background species parameters), in order to make the artificial background resource and background death look as similar to the the background death/resource present in the pure background system we wish to emulate. Doing this can improve the accuracy of the candidate steady state that is the output.

richardsouthwell commented 6 years ago

Remaining tasks are (1) Define Rfac=10 and Rmax = Rfac*getRDI(params,params@initial_n,params@initial_n_pp). The trouble is, when we run the resulting system, it will use RDD, and so it wont be at steady state. I will think about this more. Other issues: (2) Sort out defaults in help, and clean code. (3) Polish code.