Questions tagged [moving-average]

A calculation of the average value of the most recent (within some window) values in a time series, rather than the average of the entire series.

Moving average is a calculation of the average value of the most recent (within some window) values in a time series, rather than the average of the entire series.

1034 questions
0
votes
1 answer

Moving average for a date without data in the table

Hello I have below data for a table and I'm looking for moving average. Original Data date qty 06/11/15 5 08/11/15 7 09/11/15 8 10/11/15 12 11/11/15 34 15/11/15 45 16/11/15 12 17/11/15 7 The…
0
votes
1 answer

Smoothing Data in Python

I have this data: 8.7530482 1.34E-01 8.7584016 2.68E-01 8.7637563 6.70E-01 8.769111 1.47E+00 8.7744644 2.15E+00 8.7798191 3.08E+00 ... 11.5693578 6.36E+01 11.5747125 6.21E+01 11.5800659 6.17E+01 11.5854193 6.14E+01 11.590774 …
web nocko
  • 1
  • 1
0
votes
2 answers

create a new column conditional on distance traveled between points in R

I am trying to create a new column conditional on another column, a bit like a moving average or moving window but based on distance between points. Take for example row 2 with a CO2 of 399.935. I would like to have the mean of all the points within…
MLavoie
  • 9,671
  • 41
  • 36
  • 56
0
votes
1 answer

Moving Average for ADC

Hi All i am working on a project where I have to calculate the moving average of ADC readings. The data coming out from ADC represent an Sinusoidal wave. This is the code I am using to get moving average of a given signal. longNew = (8 bit data…
Kunal Sonone
  • 43
  • 3
  • 14
0
votes
0 answers

Having trouble creating a moving array.

I'm having problems moving the first input of my array to the end so that I can compute the average of the Window number of inputs. I have to use an array (not a matrix) to compute the moving average of weights. Question: if I set my number of…
BBlove
  • 9
  • 1
0
votes
1 answer

if statement in egen based on current observation and other observations in group (to calculate moving average)

Suppose I have the data generated by this: clear all set seed 100 set obs 36 egen group = seq(), from(1) to(2) block(18) egen year = seq(), from(2000) to(2005) block(3) egen month = seq(), from(1) to(3) gen y = round(runiform()*10) sort group month…
bill999
  • 2,147
  • 8
  • 51
  • 103
0
votes
1 answer

Average every 'x' values in an array in node.js

I have a processing sketch that takes a sound level reading every second. It outputs it to a file, the end result looking like this: 17.51.11, 0.05900923, 0.059008658 17.51.12, 0.4037964, 0.40379566 17.51.13, 0.10111399, 0.101112984 17.51.14,…
Leah Scott
  • 117
  • 1
  • 1
  • 8
0
votes
2 answers

Boost::accumulators initialization failing on mac OSX Yosemite

I am currently trying to use Boost::accumulators, but getting compilation error while initializing in the constructor. Please check the class details below. Environment: Mac OSX Yosemite G++ version: 4.2.1 Boot Version: 1.55 Code: class test { …
0
votes
3 answers

Moving averages with multiple GroupBy

This is a small rep of my data: Team <- rep(c("ind", "sas", "ind", "sas"),c(4,8,2,4)) Player <- c("Paul George", "David West", "Roy Hibbert", "Paul George", "Tim Duncan", "Manuel Ginobili", "Tony Parker", "Boris Diaw","Danny…
Sburg13
  • 121
  • 5
0
votes
1 answer

how can we give index while calculating 3 days moving average

I have a data sets like below and want to calculate the max value 3 days moving average and tried this code pd.rolling_mean(data['prec'], 3).max() this code gives the moving average but without date year month day prec 0 1981 1 …
bikuser
  • 2,013
  • 4
  • 33
  • 57
0
votes
0 answers

about filter in Python

I am really sorry for this stupid question but it waste 1 week of my time and i did not find answer. I have a manual of a tool that manufacturer mentioned : "A T-Filter, a simple digital moving average low-pass filter, is used for the accelerometer…
kian
  • 87
  • 1
  • 11
0
votes
1 answer

Creating a rolling average/window average in tableau

I'm struggling to create a rolling 7 day average in tableau using the calculation below. I can get it to work correctly when I focus on a monthly average but not when I calculate a daily average. The daily is not calculating correctly until there…
Mark
  • 1
  • 1
  • 1
0
votes
1 answer

I want to calculate a moving difference for my dataset below.

How do I add another column with a moving difference of Column2? For Example: I want to add a column where it will have the following values: (0,-372706.6,-284087.1, -119883.7, etc.)
0
votes
1 answer

VHDL average of Array through for loop

I have an Array of X Integer values in VHDL declared as a variable inside a process. I would like to calculate the average of all Values in a for loop. If I write it out for 3 Values manually everything works fine (tested on hardware): entity…
FabianBerlin
  • 105
  • 3
0
votes
3 answers

I tried coding my own simple moving average in C++

I want a function that works. I believe my logic is correct, thus my (vector out of range error) must be coming from the lack of familiarity and using the code correctly. I do know that there is long code out there for this fairly simple…
mwf1234
  • 45
  • 1
  • 10