2

I have $n$ values ($n \approx 10^8$) ... I want to plot these, where the $i$-th value is plotted at point $(x,y)$, $x=i$ and $y=$value$[i]$.

Note: The values do NOT follow any pattern or function. They are RANDOM values - that represent load on a machine.

I don't want to handle all $10^8$ values. Instead, I want to plot only $1000$ values that can show a rough idea of how the plot looks.

I've done: (to get $1000$ values from $n$ values) Let $ng=(n/1000)$, for every $ng$ values, take the average and plot it. So I'll have $1000$ values that can represent $n$ values.

Now, my question is, I want a better way to find out $1000$ values. When I try to recalculate for some arbitrary interval, it is highly inaccurate.

//Feel free to suggest appropriate tags and a more appropriate title.

2 Answers2

2

Taking the average will reduce the dispersion. Think if all the values are randomly $\pm 1$. Averaging will get you a value very close to $0$. It would probably be better to randomly select 1000 values and plot them without averaging.

Ross Millikan
  • 374,822
0

If your numbers are as you say, random, then taking a uniform sample will reflect the entire distribution. Thus, select 1000 random samples from your data set, and plot these. This will probably be what you're looking for.