CODAP
  • About
  • Forums
  • Contact
  • Help
  • Launch CODAP
Please complete this two-question survey to help us improve our website!

Browse:

  • Home
  • Forums
  • CODAP Help Forum
  • Moving Averages

Moving Averages

CODAP › Forums › CODAP Help Forum › Moving Averages

Tagged: average, formulas, functions, NetLogo

  • This topic has 2 replies, 2 voices, and was last updated 7 years, 9 months ago by Mitchell Estberg.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 8, 2017 at 3:10 pm #386 Score: 0
    Mitchell Estberg
    Participant

    Hello!

    We are using Codap for a physics lesson that uses a NetLogo model. We know we can use a summary table with parent level functions to get a summarizing average for data, but we’d like students to be able to compute running/moving averages for current as the model runs or retroactively after they have collected data for an entire run. What I mean by this is an average at each stage of the model run. We could do this with the data for the table in excel with the formula =average(instantaneous current$1, instantaneous current1) and drag the formula down through other cells of the table such that it changes to =average(instantaneous current$1, instantaneous current3) and etc. [Here I am using “instantaneous current” as the column header that would normally be a letter in excel].

    Is there any way to perform a similar function in Codap with the mean formula?

    You can view our model here:

    https://codap.concord.org/app/#shared=22289

    Thanks so much,

    Mitchell Estberg

    August 8, 2017 at 4:34 pm #387
    Bill Finzer
    Keymaster

    Hello Mitchell,

    We don’t have a moving average function. (But I’m adding a feature request for one on your behalf.)

    But if I’ve understood correctly, you can compute what you are after as follows.

    1. Create an attribute named runningSum with the formula prev(runningSum,0)+current
    2. Create an attribute named runningAvg with the formula runningAvg/caseIndex

    Is this is the kind of average you’re looking for? When I tried it, I got a nice graph for three runs. Note that I had to define an attribute named ticks with the formula caseIndex.

    Hope this helps,

    Bill

    Attachments:
    1. runningAvg.png

    August 9, 2017 at 11:50 am #389
    Mitchell Estberg
    Participant

    Hi Bill!

    Thanks so much for this explanation and help. It definitely works for our purposes. Also, thanks for putting in the feature request.

    Have a great day!

    Mitchell

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CODAP Help Forum’ is closed to new topics and replies.

Forum Login

Log In
Web Client 1

Forums

  • CODAP Help Forum

About

  • About CODAP
  • CODAP Contributors
  • For Educators
  • For Developers

Community

  • Community Guidelines
  • Discussion Forums
  • GitHub Wiki
  • Meetups

Support

  • Help Page
  • FAQ
  • Privacy Policy
  • Contact Us

Legal

  • Terms of Use

© 2025 Copyright The Concord Consortium.

The Concord Consortium