Calculation of Trend by Moving Average Method: Formulas and Examples (2024)

Time Series Analysis
Calculation of Trend by Moving Average Method: Formulas and Examples (1)

While watching the news you might have noticed the reporter saying that the temperature of a particular city or a country has brokena record. The rainfall of some state or country has set a new bar. How can they know about it? What are the measures that they have taken and studied to say so? These are the time-series data. You all are familiar with time-series data and the various components of the time series. In this section, we will study how to calculate the trend in a set of data by the method of moving average.

Table of content

1 Suggested Videos

2 A Trend in a Time Series

2.1 Browse more Topics under Time Series Analysis

2.2 Analysis of Time Series

3 Measurement of Trend by the Method of Moving Average

3.1 Moving Average

3.2 Drawbacks of Moving Average

4 Solved Example for You

Suggested Videos

').appendTo(this.scroller));n2const.rtl.isRtl?(this.previous=this.$widget.find(".nextend-thumbnail-next").on("click",this.previousPane.bind(this)),this.next=this.$widget.find(".nextend-thumbnail-previous").on("click",this.nextPane.bind(this))):(this.previous=this.$widget.find(".nextend-thumbnail-previous").on("click",this.previousPane.bind(this)),this.next=this.$widget.find(".nextend-thumbnail-next").on("click",this.nextPane.bind(this))),this.slider.stages.done("BeforeShow",this.onBeforeShow.bind(this)),this.slider.stages.done("WidgetsReady",this.onWidgetsReady.bind(this))},t.prototype.renderThumbnails=function(){var t;this.parameters.invertGroupDirection&&(t=Math.ceil(this.slider.visibleRealSlides.length/this.group));for(var i=0;i

');if(this.parameters.invertGroupDirection?s.appendTo(this.$groups.eq(Math.floor(i/t))):s.appendTo(this.$groups.eq(i%this.group)),s.data("slide",e),e.$thumbnail=s,this.parameters.thumbnail!==c){var h=e.getThumbnailType(),n=p[h]!==c?p[h]:"";d('

'+n+"

").css("background-image","url('"+e.getThumbnail()+"')").appendTo(s)}if(this.parameters.caption!==c){var r=d('');switch(this.parameters.caption.placement){case"before":r.prependTo(s);break;default:r.appendTo(s)}if(this.parameters.title!==c&&r.append('

'+e.getTitle()+"

"),this.parameters.description!==c){var o=e.getDescription();o&&r.append('

'+o+"

")}}}var a="universalclick",l="onDotClick";"mouseenter"===this.parameters.action?(a="universalenter",l="onDotHover"):this.slider.hasTouch()&&(a="n2click"),this.dots=this.scroller.find(".nextend-thumbnail-scroller-group > div").on(a,this[l].bind(this)),this.images=this.dots.find(".n2-ss-thumb-image")},t.prototype.onTap=function(t){i||(d(t.target).trigger("n2click"),i=!0,setTimeout(function(){i=!1},500))},t.prototype.onBeforeShow=function(){var t=!1;switch(this.parameters.area){case 5:t="left";break;case 8:t="right"}t&&(this.offset=parseFloat(this.$widget.data("offset")),this.slider.responsive.addHorizontalSpacingControl(t,this)),this.renderThumbnails(),this.slider.hasTouch()&&(N2Classes.EventBurrito(this.$widget.get(0),{mouse:!0,axis:"x",start:function(){this.bar.width();this._touch={start:parseInt(this.scroller.css(n2const.rtl.left)),max:0},this.getScrollerWidth()this._touch.start?this.previousPane():this.nextPane(),Math.abs(e.x)<10&&Math.abs(e.y)<10?this.onTap(t):nextend.preventClick(),delete this._touch}.bind(this)}),this.slider.parameters.controls.drag||this.$widget.on("click",this.onTap.bind(this))),this.widthPercent=this.$widget.data("width-percent"),this.thumbnailDimension={widthLocal:this.dots.width(),width:this.dots.outerWidth(!0),height:this.dots.outerHeight(!0),widthBorder:parseInt(this.dots.css("borderLeftWidth"))+parseInt(this.dots.css("borderRightWidth"))+parseInt(this.dots.css("paddingLeft"))+parseInt(this.dots.css("paddingRight")),heightBorder:parseInt(this.dots.css("borderTopWidth"))+parseInt(this.dots.css("borderBottomWidth"))+parseInt(this.dots.css("paddingTop"))+parseInt(this.dots.css("paddingBottom"))},this.thumbnailDimension.widthMargin=this.thumbnailDimension.width-this.dots.outerWidth(),this.thumbnailDimension.heightMargin=this.thumbnailDimension.height-this.dots.outerHeight(),this.imageDimension={width:this.images.outerWidth(!0),height:this.images.outerHeight(!0)},this.sideDimension=.25*this.thumbnailDimension.width,this.scroller.height(this.thumbnailDimension.height*this.ratio*this.group+"px"),this.bar.height(this.scroller.outerHeight(!0)+"px"),this.horizontalSpacing=this.bar.outerWidth()-this.bar.width(),this.slider.sliderElement.on({SlideWillChange:this.onSlideSwitch.bind(this),visibleRealSlidesChanged:this.onVisibleRealSlidesChanged.bind(this)})},t.prototype.onWidgetsReady=function(){this.activateDots(this.slider.currentSlide.index),this.slider.sliderElement.on("SliderResize",this.onSliderResize.bind(this)),this.onSliderResize()},t.prototype.filterSliderVerticalCSS=function(t){};var e=!(t.prototype.onSliderResize=function(){if(this.slider.visibleRealSlides.length){if(this.lastScrollerWidth!==this.getScrollerWidth()){var t,i=1,e=this.getScrollerWidth(),s=e-2*this.sideDimension;if((t=e/this.thumbnailDimension.width)=t&&(this.localSideDimension=.1*e,i=(s=e-2*this.localSideDimension)/(this.parameters.minimumThumbnailCount*this.thumbnailDimension.width),t=s/(this.thumbnailDimension.width*i),(t=e/(this.thumbnailDimension.width*i))e;e++)i[e].$thumbnail.addClass("n2-active")},t.prototype.resetPane=function(){this.goToDot(this.currentI)},t.prototype.previousPane=function(){this.goToDot(this.currentI-this.itemsPerPane*this.group)},t.prototype.nextPane=function(){this.goToDot(this.currentI+this.itemsPerPane*this.group)},t.prototype.getPaneByIndex=function(t){return t=Math.max(0,Math.min(this.dots.length-1,t)),this.parameters.invertGroupDirection?Math.floor(t%Math.ceil(this.dots.length/this.group)/this.itemsPerPane):Math.floor(t/this.group/this.itemsPerPane)},t.prototype.getScrollerTargetLeft=function(t){this.lastScrollerWidth=this.getScrollerWidth();var i=0;t===Math.floor((this.dots.length-1)/this.group/this.itemsPerPane)?(i=-t*this.itemsPerPane*this.thumbnailDimension.width*this.ratio,0===t?this.previous.removeClass("n2-active"):this.previous.addClass("n2-active"),this.next.removeClass("n2-active")):(0

A time series is broadly classified into three categories of long-term fluctuations, short-term or periodic fluctuations, and random variations. A long-term variation or a trend shows the general tendency of the data to increase or decrease during a long period of time. The variation may be gradual but it is inevitably present.

Suppose you have a time series data. What will you do with it? How can you calculate the effect of each component for the resulting variations in it? The main problems in the analysis of time series are

This method uses the concept of ironing out the fluctuations of the data by taking the means. It measures the trend by eliminating the changes or the variations by means of a moving average. The simplest of the mean used for the measurement of a trend is the arithmetic means (averages).

The moving average of a period (extent) m is a series of successive averages of m terms at a time. The data set used for calculating the average starts with first, second, third and etc. at a time and m data taken at a time.

In other words, the first average is the mean of the first m terms. The second average is the mean of the m terms starting from the second data up to (m + 1)th term. Similarly, the third average is the mean of the m terms from the third to (m + 2) th term and so on.

If the extent or the period, m is odd i.e., m is of the form (2k + 1), the moving average is placed against the mid-value of the time interval it covers, i.e., t = k + 1. On the other hand, if m is even i.e., m = 2k, it is placed between the two middle values of the time interval it covers, i.e., t = k and t = k + 1.

When the period of the moving average is even, then we need to synchronize the moving average with the original time period. It is done by centering the moving averages i.e., by taking the average of the two successive moving averages.

Problem: Calculate the 4-yearly and 5-yearly moving averages for the given data of the increase Ii in the population of a city for the 12 years. Make a graphic representation of it.

Here, the 4-yearly moving averages are centered so as to make the moving average coincide with the original time period. It is done by dividing the 2-period moving totals by two i.e., by taking their average. The graphic representation of the moving averages for the above data set is

As someone deeply immersed in the field of time series analysis, I bring a wealth of expertise to shed light on the intricacies of this complex subject. My understanding extends beyond the basics, allowing me to unravel the nuances and provide insights that go beyond surface-level comprehension.

In the realm of time series analysis, the news reports you encounter about record-breaking temperatures or unprecedented rainfall are rooted in the meticulous study of time-series data. This type of data is fundamental to understanding and predicting patterns in various phenomena. In the following discussion, we delve into the essential concepts related to time series analysis, with a focus on calculating trends using the moving average method.

Concepts Covered in the Article:

  1. Time Series Data:

    • Definition: Time series data represents observations or measurements taken sequentially over time.
    • Significance: It allows for the analysis of trends, patterns, and fluctuations in data over specific time intervals.
  2. Components of Time Series:

    • Long-Term Fluctuations: Trends that show the overall direction of data over an extended period.
    • Short-Term or Periodic Fluctuations: Regular, repeating patterns in the data.
    • Random Variations: Unpredictable, irregular fluctuations.
  3. Measurement of Trend by Moving Average:

    • Definition: Moving average is a method to smooth out fluctuations by calculating the mean of data within a specified period.
    • Arithmetic Mean: The simplest form of moving average, calculated by averaging data points over a given period.
    • Period (Extent) 'm': The number of data points considered for calculating each average.
  4. Calculation of Moving Average:

    • Calculation involves taking successive averages of 'm' terms at a time.
    • Odd Period (m = 2k + 1): The moving average is centered against the mid-value of the time interval it covers.
    • Even Period (m = 2k): The moving average is centered between the two middle values of the time interval.
  5. Solved Example - 4-Yearly and 5-Yearly Moving Averages:

    • Problem: Calculate moving averages for a city's population increase over 12 years.
    • Solution: The 4-yearly moving averages are centered to coincide with the original time period.
    • Graphic Representation: A visual representation of the calculated moving averages.

In conclusion, time series analysis is a powerful tool for extracting meaningful insights from temporal data. By understanding the components and employing techniques like moving averages, analysts can uncover trends and make informed predictions about future occurrences. The article's exploration of these concepts serves as a valuable resource for anyone seeking a deeper comprehension of time series analysis.

Calculation of Trend by Moving Average Method: Formulas and Examples (2024)
Top Articles
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 5857

Rating: 4.3 / 5 (64 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.