Running and Weighted Averages

Both running and weighted averages are important filtering methods for statistical analysis.

Running Average

Example: Calculate a 3-year running average of gridded temperature anomaly data.

Locate Dataset and Variable
  • Select the "Datasets by Catagory" link in the blue banner on the Data Library page.
  • Click on the "Atmosphere" link.
  • Select the NOAA NCEP CPC CAMS dataset.
  • Select the "anomaly" link under the Datasets and Variables subheading.
  • Choose the "temperature anomaly" link, again located under the Datasets and Variables subheading. CHECK
Select Spatial Domain
  • Click on the "Data Selection" link in the function bar.
  • Enter the text 130W to 30W and 70S to 70N, in the appropriate text boxes.
  • Press the Restrict Ranges button and then the Stop Selecting button. CHECK
Calculate Running Average
  • Click on the "Expert Mode" link in the function bar.
  • Enter the following text below the text already there:

    T 3 runningAverage
    
  • Press the OK button. CHECK
    The command above will compute the 3-month running average.
View Running Average
  • To see your results, choose the viewer with coasts drawn. CHECK
    The image depicts the running average of the first three months of the dataset, Jan-Mar 1950. The anomlies may be easier to see if we change the color scale.
  • Click on the right most link in the blue source bar to exit the viewer.
  • Enter the following text in the Expert Mode text box below the text already there:

    DATA 1. STEP
      startcolormap DATA
        -10. 10. RANGE
        white purple purple
           -10. VALUE
           cyan
            -1. VALUE
            white white
              1. bandmax
              yellow
               1. VALUE
               red
                10. VALUE
                firebrick endcolormap
    
  • Press the OK button. CHECK
    These commands format the color scale so that anomalies are easier to observe.
  • Replace the range with a three month period during an El Niño event: Jun-Aug 1983.
  • Click the Redraw button. CHECK
Running Average of Gridded Temperature Anomaly Data at 130W-30W, 70S-70N

The high positive anomalies off the western coast of South America are assocaiated with the El Niño event that summer.
Example: Calculate the 20-year running average of April precipitation for a location in the Pampas Region of Southern South America.
Locate Dataset and Variable
  • Select the "Datasets by Catagory" link in the blue banner on the Data Library page.
  • Click on the "Atmosphere" link.
  • Select the NOAA NCEP CPC CAMS dataset.
  • Select the "mean" link under the Datasets and Variables subheading.
  • Choose the "precipitation" link, again located under the Datasets and Variables subheading. CHECK
Select Spatial Domain
  • Click on the "Data Selection" link in the function bar.
  • Enter the text 60W and 25S, in the appropriate text boxes.
  • Press the Restrict Ranges button and then the Stop Selecting button. CHECK
Select Temporal Domain
  • Click on the "Expert Mode" link in the function bar.
  • Enter the following lines below the text already there:

    T 12 splitstreamgrid>
      T (Apr) VALUES
    
  • Press the OK button. CHECK
    The splitstreamgrid function splits the time grid into two new time grids. The T grid has a period of 12 months and a step of 1. This grid represents data from January, Februrary, March, etc. The T2 grid has a step of 12 and is unperiodic. This grid represents the years from the beginning of the dataset to the end of the dataset. The next command, T (Apr) VALUES, will retain only the April values from the T grid.
View April Precipitation
  • To see the results of this operation, choose the time series viewer. CHECK
    Precipitation is labeled on the Y-axis in mm/month and time is labeled on the X-axis in years. Each X-axis value represents mean April precipitation for that year.
Mean April Precipitation at 60W, 25S for 1950 to 2000
Without smoothing the data, it may be difficult to recognize any trends over the 50-year span pictured above. Applying a running average, however, will often make any trend in the data more distinguishable.
Calculate Running Average
  • Click on the right most link in the blue source bar to exit the viewer.
  • Scroll down to the Grids subheading.

    Notice under the Grids subheading that the new time grid created, T2, represents months since 1950 ordered from 1950 to 2000 by 12. Every 12 grid points in T2 correspond to 1 year. The 20-year running average is calculated over the T2 variable, and must be evaluated in months, not years.

  • In the Expert Mode text box, enter the following line below the text already there:
    T2 240 runningAverage
  • Press the OK button. CHECK

    This command computes the 20-year (12*20 = 240 months) running average over T2.

View Running Average
  • To see the results of this operation, choose the time series viewer. CHECK
Running Mean of April Precipitation at 60W, 25S for 1950 to 2000.
The increasing trend in April precipitation from 1950 to 2000 becomes visible after running averages are employed. Note that the time grid extends from 1960 - 1990. This is due to the fact that each successive mean in the running average is labeled according to its midpoint. For example, the first mean in the running average includes the interval April 1950 - April 1969, and is labled as April 1960.

Weighted Average

Example: Find spatially weighted averages of monthly solar radiation.
Locate Dataset and Variable
  • Select the "Datasets by Catagory" link in the blue banner on the Data Library page.
  • Click on the "Air-Sea Interface" link.
  • Select the OSUSFC dataset.
  • Select the "Data" link under the Datasets and Variables subheading.
  • Choose the "solar radiation" link, again located under the Datasets and Variables subheading. CHECK
    Notice under the Grids subheading that the time variable is periodic from January to December. The OSUSFC dataset consists of monthly climatologies for each variable.
Select Domains
  • No ranges will be adjusted in this example.
    The dataset will be analyzed over its entire temporal and spatial grids.
Calculate Weighted Average
  • Click on the "Expert Mode" link in the function bar.
  • Enter the following text below the text already there:
    {Y cosd} [X Y]weighted-average
    
  • Press the OK button. CHECK
    The above command calculates a spatial average, weighted with the cosine of the latitude. The resulting dataset is a time series from Jan to Dec of average solar radiation in W/m2.
View Weighted Average
  • To see the results of this operation, choose the time series viewer. CHECK
Weighted Spatial Average of Monthly Climatological Solar Radiation


Averaged over the world, solar radiation is at a minimum near July and at a maximum near January.

View Differences Between Weighted Average and Non-weighted Average
  • Click on the right most link in the blue source bar to exit the viewer.
  • In the Expert Mode text box, enter the following text below the text already there:

    SOURCES .OSUSFC .DATA .solr
      [X Y]average
       sub
    
  • Press the OK button. CHECK
    The commands above subtract the non-weighted average from the weighted average.
  • To see the results of this operation, choose the time series viewer. CHECK
Difference Between Weighted Average and Non-weighted Average of Monthly Climatological Solar Radiation
The largest difference between the weighted average and the regular average occurs sometime near April and October. Refering to the previous graph of the weighted average, these are times when solar radiation is changing most rapidly.