Mathematica: find mean value of an increasing list

Click For Summary

Discussion Overview

The discussion revolves around finding the mean values of progressively increasing sublists from a given list in Mathematica, with a focus on how to efficiently compute and plot these means.

Discussion Character

  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant seeks a method to compute the mean of sublists L_{i} for a list L={a_{1}, ..., a_{n}} and plot these means.
  • Another participant suggests using built-in mean functions and proposes a method involving List and Mean to generate the means.
  • A different participant points out that the L_{i} can be constructed using the Take function but expresses difficulty in plotting the means.
  • One participant confirms that the means will be scalars and suggests creating a list from these means for plotting.
  • A participant provides a specific example using a list of numbers and demonstrates how to compute the means using Table and ListPlot.
  • Another participant shares their initial approach using a For loop to generate means but acknowledges that the suggested method was more effective.

Areas of Agreement / Disagreement

Participants generally agree on the methods to compute the means and plot them, but there are varying levels of clarity and effectiveness in the approaches discussed.

Contextual Notes

Some participants express uncertainty about the best way to plot the means, indicating potential limitations in their understanding of Mathematica's plotting capabilities.

Who May Find This Useful

This discussion may be useful for Mathematica users interested in statistical analysis and data visualization, particularly those working with lists and seeking efficient computation methods.

skitapa
Messages
4
Reaction score
0
I have a list L={a_{1}, ..., a_{n}}. I would like to find the mean of
L_{i} := {a_{1}, ... , a_{i}} for each 1<i<n, and then plot the means.
How do to do that in a smart way?
 
Last edited:
Physics news on Phys.org
I'm not suite sure what you're asking but there are build in mean funcitons.

So couldn't you do something like :

MeanList= List[Mean[L],{i,0,n}]
ListPlot[MeanList]
 
The L_{i} can be constucted by the Take function. But it seems hard to plot the means afterwards. Thats the real problem, how to get something that can be plotted
 
Well, your means will be scalars, one for each list, yes? well, make a list out of them and listplot.
 
L = {11, 12, 13, 14, 15, 16}
MeanList = Table[Mean[Take[L, i]], {i, 1, 6}]
ListPlot[MeanList]
 
Thank you very much.
I did generate the means by:
Code:
For[i = 1, i < 1000, i++, Print[Mean[Take[R, i]]]]
and from there I was not able to make a list will all the means. Anyhow, your way was way better.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K