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

Creating a seven day, average-by-week-of-year (or moving average?) in R

I have a ton of data that I'm feeding through R in order to generate averages. The relevant data involves dates and temperature readings. There are often multiple temperature readings for a single day. The dates span approximately 6 months. Two to…
TheNovice
  • 1,277
  • 3
  • 16
  • 23
0
votes
0 answers

Generate moving average for stackedbarchart in JFreeChart

I would like to generate a chart which combines both stackedbarchart and a moving average line in the same chart. I am currently using a DefaultCategoryDataset object for my stackedBarChart, and am unsure how I can use the data I am passing into…
stretchr
  • 615
  • 2
  • 9
  • 24
0
votes
2 answers

SQL Moving Average based on Artful Common Queries Just Won't Work

Can't get Moving Average to work on my table. It's just spitting back the row data for each row, instead of producing the average value I seek. Based on ACQ's Moving Average SQL:(http://www.artfulsoftware.com/infotree/qrytip.php?id=445) SELECT…
cjr
  • 25
  • 6
0
votes
1 answer

R: Very basic example for averaging a Time Series

I am qute new to R and studied several posts and websites about time series and moving averaging but simply cannot find a useful hint averging a special period of time. My data is a table via readcsv with a date and time in one column and several…
Martin
  • 1,395
  • 1
  • 11
  • 33
0
votes
4 answers

VBA: How to put the calculated solution into a new worksheet?

I have a very basic problem, but somehow just don't find the solution to it. I tried to write a little program, which takes the given stock prices from a worksheet and calculates the moving average of it over a given period of time. So far that was…
user3186278
  • 3
  • 1
  • 2
0
votes
1 answer

Update table with data from same table (Moving average)

I am trying to find the query for updating a table, so that it have a column with a moving average value. Table: person_ID test_date test_results test_MA_3 Unique(person_ID, test_date) Currently the value for all rows is 0 for the column…
Easyrider
  • 3,199
  • 5
  • 22
  • 32
0
votes
1 answer

How to calculate moving average?

I have a field in my database named "Value" and I need to calculate the moving average of this "value". The table has a primary key "index" which is used as the sort order for the table. There appears several approaches to this problem in broad…
0
votes
6 answers

How to create a moving average in Java

I need a program that will calculate the moving average of a set of numbers (I used 4, 9, 3.14, 1.59, 86.0, 35.2, 9.98, 1.00, 0.01, 2.2, and 3.76). When I run this, it prints out "17.859999999999996" nine times. Do you guys see any errors? import…
gdhc21
  • 107
  • 6
  • 18
0
votes
1 answer

3 Month Rolling Average

I need some help calculating a rolling 3 month average cost from the two dataset below. Which is the 3 month Average of Dataset1 / Dataset 2. I'm not sure if using cte is the correct route. Any insight is appreciated. Dataset 1: …
Brice
  • 1
  • 1
0
votes
1 answer

Running Mean/SD: How can I select within the averaging window based on criteria

I need to calculate a moving average and standard deviation for a moving window. This is simple enough with the catools package! ... However, what i would like to do, is having defined my moving window, i want to take an average from ONLY those…
user1959078
  • 25
  • 1
  • 2
  • 5
0
votes
4 answers

Create a running average from a list

First time Python user and I am lost. I need to create a table from a list that displays the daily temperature and the running average of temperature up to that day. xData = arange(1,32) tData = [86,87,84,86,86,86,84,83,90,89,88,85,86,79,83,81,…
0
votes
1 answer

How to calculate daily running mean on a condition

I want to calculate daily running mean from hourly values of a pollutant. For this at least 16 valid hourly measurements must be available. How could I do that? Sample data as dput is found is below. structure(list(X = 1:48, year = c(2007L, 2007L,…
Meso
  • 1,375
  • 5
  • 17
  • 36
0
votes
0 answers

How to implement pandas (moving) rolling statistics functions performance in my own code

I need to implement moving average in my own way: the input includes only samples from not zero values, but the output should be calculated for each time tick, also for the empty ones, those that are not in the input. Code example: time_step = 120 …
Vyacheslav Shkolyar
  • 1,926
  • 2
  • 14
  • 12
0
votes
0 answers

Python Convolution equivalent in Java? - Java - Python

I am implementing a Weighted Moving Average algorithm with the help of convolution. It is quite easy in Python using the convolution function provided by numpy. The codes are as follows: # Method 2 WMA WINDOW_SIZE = 70 DATA_SET_NUMBER =…
Sibbs Gambling
  • 19,274
  • 42
  • 103
  • 174
0
votes
1 answer

parametric method Autoregression moving average(ARMA) to AR process

i want to know how to convert ARMA (Autoregression moving average) process to AR(Autoregression) process by PARAMETRIC METHOD. i.e. i have a transfer function H(z) = (a + b*z)/(c +d*z) e.g. H(z) = (0.26 + 0.073*z^-1)/(1 - z^-1) i.e.…
Shafqat
  • 55
  • 1
  • 1
  • 5