Conversation
|
2 questions probably best for @ilajaait & @iago-lito :
|
|
Hi @Thomalpas, and congratulations for pushing all this work forward into a PR! Regarding the merge, I can have a look into your modifications ASAP and check whether it can be done easily. From what I understand, you have based your work on Regarding your 1. concern, maybe @ilajaait can answer better than I? Regarding 2., I'm sorry I'm not sure I understand :( From what I understand, mp = ModelParameters(...)
trajectories = simulate(mp, ...)
safe_bundle = (mp, trajectories)would ensure that your results and your parameters are "used together". Does this make sense in the context of something you meant? |
|
Hey @Thomalpas congrats for the PR 🎉 Concerning your issues:
A note concerning the variable naming, we have to decide whether or not we put a Otherwise I'm curious about the stability metrics you have implemented because I intend to write a companion package to BEFWM2 to measure the stability of an ecological system with various metrics. 👀 |
1ad0ec0 to
372c070
Compare
|
Hi again @Thomalpas. I have solved conflicts and squashed all your branch into a single commit on top of Your original commit history based on Unfortunately, there are no tests files for stochastic simulations yet. As a consequence, although I can ensure that git flow is restored, I cannot ensure that everything is working as you intend :/ Can you check on your side that everything is alright with the new squashed commit? (372c070) |
|
Regarding internal function naming, prefixing "private" identifiers with In Julia, this distinction is enforced by the # src/BEFWM2.jl
function public_function() ... end
function private_function() ... end
export public_functionThe users are expected to tell the difference this way: using BEFWM2 # Only bring 'export'ed identifiers into scope
public_function() # If I can use it, then it's public.
private_function() # JULIA ERROR: I can't use it, then it's private.
# But if I still want to access it, I can.
using BEFWM2: private_function # Explicit import.
private_function() # I can use it, but I know it's private.As a consequence, the |
Regarding 2, that is exactly what I meant, sorry for not being clear, I wasn't sure if 'safe_bundle' as you've called it was standard procedure but it was what I was using |
|
@iago-lito @ilajaait want to have a quick meeting in the next few days? It would probably be easier to describe the stochastic process and Ismaël to discuss stability metrics aloud rather than typing? I'm free anytime Thursday and anytime except 12:30-1pm Montpellier time tomorrow |
|
Actually no you're an hour ahead it's 2:30-3pm I can't do tomorrow (1:30-2 UK time) |
|
@Thomalpas Sure, Thursday is fine for me, details on the Slack channel ;) |
bea5240 to
b618de0
Compare
3c5ba10 to
1d80fe8
Compare
9c76562 to
3246ab9
Compare
50561ba to
7707ac2
Compare
75ba8c9 to
f3c2f4c
Compare
|
Status: this PR has been automatically, and definitely, closed by github because the underlying branch has been renamed to |
|
Dismissing in favour of #134. |

Hey all!
Ok so these are I think all the changes necessary to add my stochasticity functioning into develop. I'll detail them below but I think apart from small changes to
ModelParameters&simulateeverything is a new function so hopefully merging shouldn't be too much of a headache... Though the changed files below show for instanceusing DiffEqCallbacksas an addition of mine intoBEFWM2.jlbut that's already there in develop (but not main), so maybe I'm doing something wrong.I'm not great at github so if there is a way of creating a copy of the develop branch and then adding my changes to that then starting a pull request then let me know! As it is this a copy of main that I have first tried to make identical to develop and then added my changes on top of.
As a quick summary I've built a module that selects species to be stochastic based on user input, and then gives a parameter for these species (growth for producers, metabolism for consumers) its own differential equation, which along with the biomass equations are passed into an
SDEProblemand solved. I'll detail more below if it helps with mergingKey changes that influence code used by everyone:
I've created a lot of new functions that are only required for stochasticty, but the below files are the only places where I think I have modified code already found in the develop branch.
BEFWM2.jl- 3 new dependencies, 2 new files, export of 2 new functionsmodel/modelparameters.jl- Incorporation ofAddStochasticitymodule intoModelParametersfunction and displaymodel/simulate.jl- Anifloop within thesimulatefunction that uses the unediteddbdt!-ODEProblemroute as a default (if a boolean within the newAddStochasticitymodule is false), but switches to my new SDE solving pathway if trueKey changes that should only affect stochasticity
2 new files
inputs/stochasticity.jlto produce theAddStochasticitymodule forModelParametersmodel/covariance_matrix.jlto produce a covariance matrix that correctly supplies theCorrelatedWienerProcessproviding noise with environmental and demographic stochasticityStochasticity-compatible alternate functions
I've modified a lot of files but mostly this has been creating new versions of functions. These new functions are only called within
simulateif the boolean inAddStochastictyis true and so they shouldn't affect anything else. All the original functions mentioned below have been left untouched.In most cases these new versions are necessary because we're now solving additional differential equations. The vector of biomass
Bhas been expanded to hold stochastic parametersrorxand renameddiffparams(though not too important this probably needs a better name). Here are the main examples to give an idea:stochequations!instead ofdBdt!- produces BEFW equations for the biomasses and OU processes for the stochastic parameters_stoch_logistic_growthinstead oflogisticgrowth- Therterm for stochastic producers is held indiffparamsnotBioRates_stoch_consumptioninstead ofconsumption- Thexterm for stochastic consumers is held indiffparamsnotBioRates_stoch_metabolic_lossinstead ofmetabolic_loss- Thexterm for stochastic consumers is held indiffparamsnotBioRatesDocs and testing files still to come but this should help give an idea of where all my stuff fits into the rest of the package!
Very happy to hear questions and possible changes 😀