## You are here

Homemoving average

## Primary tabs

# moving average

A moving average is a sequence of arithmetic means taken over a fixed interval moved along consecutive data points from an infinite (or sufficiently large) set of data points. That is, given a sequence $a_{x},\ldots,a_{{x+k}}$ and an interval $n$, the average

$\frac{a_{{i-\frac{n}{2}}}+\ldots+a_{{i+\frac{n}{2}}}}{n}$ |

is taken for each value $(x+n)<i<(x+k-n)$.

Plotting a moving average can help to smooth out an extremely jagged curve so as to allow one to see larger patterns. For example, take this plot of the number of (nondistinct) prime factors function $\Omega(n)$ for $20<n<120$:

If instead we plot a moving average with an interval of 40, we get a smoother curve:

Though in all honesty, moving averages are not all that useful in number theory. They are much used, however, in statistics and fields using statistics, such as physics and economics. In economics, for example, a moving average over an interval of say, 3 months, helps investors worry less about the wild hectic fluctuations in a day of trading and focus on the overall direction of a given stock. In physics, to give another example, a yearly moving average of parts per million of carbon dioxide in the atmosphere of the Earth smooths out the yearly dips of summer to show that overall carbon dioxide is going up, contributing to significant global warming.

## Mathematics Subject Classification

62M10*no label found*26D15

*no label found*11-00

*no label found*91B84

*no label found*

- Forums
- Planetary Bugs
- HS/Secondary
- University/Tertiary
- Graduate/Advanced
- Industry/Practice
- Research Topics
- LaTeX help
- Math Comptetitions
- Math History
- Math Humor
- PlanetMath Comments
- PlanetMath System Updates and News
- PlanetMath help
- PlanetMath.ORG
- Strategic Communications Development
- The Math Pub
- Testing messages (ignore)

- Other useful stuff
- Corrections

## Comments

## LaTeX rendering problem

I don't know why the LaTeX is not rendering. I tried removing the pictures. I tried copying the syntax from the Poincare entry more closely. I even tried taking out the statement about global warming. Nothing worked.

As for the images being PNG rather than EPS, Photoshop Elements keeps crashing on me for some reason.

## Re: LaTeX rendering problem

> I don't know why the LaTeX is not rendering. I tried

> removing the pictures. I tried copying the syntax from the

> Poincare entry more closely. I even tried taking out the

> statement about global warming. Nothing worked.

In the first paragraph, you write:

$$\frac{a_{i - \frac{n}{2}} + \ldots + a_{i + \frac{n}{2}}{n}$$ .

The braces are not balanced. It should instead read:

$$\frac{a_{i - \frac{n}{2}} + \ldots + a_{i + \frac{n}{2}}}{n}$$

I tried creating a dummy entry with the same code as

yours, but PM wouldn't tell me what the error was, just

that there was an error. So I had to run LaTeX locally

to find this. In case you're interested, the proper

error message is

Runaway argument?

{a_{i - \frac {n}{2}} + \ldots + a_{i + \frac {n}{2}}{n}$$ is taken f\ETC.

! File ended while scanning use of \frac.

<inserted text>

\par

## Re: LaTeX rendering problem

Thank you very much for taking the time to look at this problem. Now I wish that my mistake had been something more elegant, some subtle interaction of heuristics. I've now gotten the fractions to display like I wanted. Thanks again.

## Images still not showing

By now I hope you've had one of your grandkids come over and fix your Photoshop, perhaps you could get the illustrations of moving averages to show up. Have you tried uploading your images to your GeoCities website first and then bringing them to PlanetMath from GeoCities? That might solve the filename problem, but other problems might remain.

## Re: Images still not showing

Thanks. One problem down, many to go. The GeoCities roundabout worked, the files are now properly named. The problem of the rendering engine being unable to determine the size of the graphics remains.

## Apple's moving average "spiking sharply higher" while price ...

What do you make of this?

http://www.tradingmarkets.com/.site/news/MOMENTUM/534784/

"(RTTNews) - Apple Computer Inc. (AAPL | charts | news | PowerRating) gapped down a the open and has been climbing steadily . the stock is suddenly spiking higher and is bouncing off it's 50 day moving average."

I'm looking at it with Google Finance in 3-month view and I don't see how the moving average could be "spiking." If anything, a moving average would show that you should've sold Apple a couple of weeks ago and cut your losses.

## Re: Apple's moving average "spiking sharply higher"

Well, it has spelling and grammar mistakes, so I wouldn't trust it enough to make financial decisions based on it.

I don't know if Google offers this, but Yahoo! has both "simple" moving averages and "exponential" moving averages (I will have to find out what that last one is so I can add it to the entry). The 50-day simple moving average shows a gradual, steady rise from $87 to $90. Hardly "spiking."

I'd tell young people to hold Apple until it reaches the target price they called when they bought it. As for me, I'm too old to have any tech stocks in my portfolio. I don't think any of my mutual funds have tech stocks in their top 10 holdings.