Hi everyone, I have a 'basic' issue and hope someone has a bit of code to solve it. I have two populations plotted as histograms on the same figure. Basically I want to add the moving average (based on hist) for both populations on my graph. I'm also interested in the x coordinate of the curves intersection. Any thoughts? Your help would be much appreciated! Thanks, Gan
Histogram and moving average
2 messages · Vallat Morgan, Dieter Menne
Vallat Morgan <morgan.vallat <at> epfl.ch> writes:
I have a 'basic' issue and hope someone has a bit of code to solve it. I have two populations plotted as histograms on the same figure. Basically I
want to add the moving average
(based on hist) for both populations on my graph. I'm also interested in the x
coordinate of the curves
intersection.
Moving averages are fine if you do not have future data (such as stock markets or temperatures), but suboptimal for densities. R has powerful methods for these: If you have MASS (the book, check ch. 5.6). Or the examples in library/MASS/scripts/ch05.R Dieter