Open In Colab   Open in Kaggle

Modeling Steps 5 - 6#

By Neuromatch Academy

Content creators: Marius ‘t Hart, Megan Peters, Paul Schrater, Jean Laurens, Gunnar Blohm

Production editor: Spiros Chavlis

Step 5: Selecting the toolkit#

Video 6: Selecting the toolkit#

Once you have completed Steps 1-4 to your satisfaction, you are now ready to model. You have a specific question, a goal in mind, and precise hypotheses expressed in mathematical language. All these components will empower you to chose an appropriate modeling approach.

In selecting the right toolkit, i.e. the right mathematics, computer science, engineering, or physics, etc approaches, you should consider the following important rules:

  1. Determine the level of abstraction

  2. Select the toolkit that best represents the ingredients and hypotheses

  3. Toolkit should express all needed relationships, mechanisms and concepts

  4. Keep it as simple as possible!

Guiding questions:

  • What is the most appropriate approach to answer your question?

    • What level of abstraction is needed?

    • Determine granularity / scale based on hypotheses & goals

    • Stay as high-level as possible, but be as detailed as needed!!!

  • Select the toolkit

    • Requires prior knowledge about flexibility / limitations of toolkit

    • Often more than one option possible

    • Some toolkits are more flexible, span a wider range of behaviour and/or are lumpable

    • Also determines how the model will be solved, i.e., simulated

      • Analytical? Numerical?

      • e.g., spatial, temporal resolution?

    • Don’t forget to estimate the data and/or compute resources your toolkit will need…

      • make sure this is available to you!

Viewing modeling as a decision process might help providing clarity regarding different model types, and how framing the problem and stating your goals influences the toolkit selection. Don’t be afraid to pursue goals that no one else pursues; diversity of models should be encouraged because it results in complementary model considerations.

Make sure to avoid the pitfalls!

Click here for a recap on pitfalls
  1. Choosing a toolkit for the toolkit’s sake (e.g., DL because it’s cool to do deep learning)

  • this will prevent you to really answer your research question and/or speak to your hypotheses

  1. Being at the wrong level of abstraction (see W1D1)

  • too complex toolkits will have too many parameters you can’t meaningfully constrain, and/or that add needless complexity

  • too simple toolkits will lack means to implement the details you care about

  1. Not knowing any toolkits

  • this highlights a lack of literature review and/or background work to learn about the tools used by the field

Step 6: Planning / drafting the model#

Video 7: Drafting the modeling#

Planning the model involves thinking about the general outline of the model, its components and how they might fit together. You want to draw a model diagram, make some sketches and formalize necessary equations. This step will thus outline a plan of implementation. Once you have that plan, this will hugely facilitate the actual implementation of the model in computer code.

Your model will have:

  • inputs: the values the system has available - this can be broken down into data, and parameters

  • outputs: these are the predictions our model will make that you could portentially measure (e.g. in your idealized experiment)

  • model functions: A set of functions that perform the hypothesized computations.

You will thus need to define a set of functions that take your data and some parameters as input, can run your model, and output a prediction for a hypothetical measurment.

Guiding principles:

  • Keep it as simple as possible!

  • Don’t get lost in details

  • Draft on paper: start with a flow diagram

    • Draw out model components (boxes)

    • What influences what? (arrows)

  • Then consider each model box separately

    • Draft internal workings in terms of equations

    • This might require a lot of work…

    • Relate box inputs to box outputs!

    • Keep in mind that the model should include a way to relate model variables to measurements

    • Use the question, ingredients, and hypotheses to ensure you have all required components

Goal: Put in place all the components of the hypothesized relationships and explanations.

Make sure to avoid the pitfalls!

Click here for a recap on pitfalls
  1. I don’t need to draft the model, I have it clearly in my mind

  • you might think you do, but experience shows you’re likely missing many important aspects

  1. I can just make a rough draft

  • the more detailed the draft, the easier it will be to implement the model in computer code

  • rough drafts tend to forget important details that you need to think about, e.g. signals needed (where do they come from?), parameters to specify (how to constrain them?), etc.

  1. Draft is too detailed or not detailed enough

  • too detailed: you’re writing our recursions, etc.

  • not detailed enough: you have no idea what’s inside “boxes”