Historigram (2020)

Here we will discuss the graphical representation of time series data, called historigram.

As we have discussed in the introduction to Time Series, given an observed time series, the first step in analyzing a time series is to plot the given series on a graph taking time intervals ($t$) along X-axis (as an independent variable) and the observed value ($Y_t$) on Y-axis (as the dependent variable: as a function of time). Such a graph will show various types of fluctuations and other points of interest.

A historigram is a graphical representation of a time series that reveals the changes that occurred at different time periods. The first step in the prediction (or forecast) of a time series involves an examination of the set of past observations. In this case, the historigram may be a useful tool. The construction of this involves the following steps described below:

  • Use an appropriate scale and take time $t$ along the $x$-axis as an independent variable.
  • Use an appropriate scale, and plot the observed values of variable $Y$ as a dependent variable against the given points of time.
  • Join the plotted points by line segments to get the required graphical representation.

Historigram Example

Draw a graphical representation of the data to show the population of Pakistan in various census years.

Census Year195119611972198119982017
Population (Million)33.4442.8865.3183.78130.58200.17
Historigram

R Programming Language

MCQs General Knowledge

https://itfeature.com statistics help

Time Series Introduction (2020)

Here we will discuss Time Series Data and Time Series Analysis.

The sequence $y_1,y_2,cdots, y_n$ of $n$ observations of a variable (say $Y$), recorded in accordance with their time of occurrence $t_1, t_2, cdots, t_n$, is called a time series. Symbolically, the variable $Y$ can be expressed as a function of time $t$ as

$$y = f(t) + e,$$

where $f(t)$ is a completely determined (or a specified sequence) that follows some systematic pattern of variation, and $e$ is a random error (probabilistic component) that follows an irregular pattern of variation. For example,

Signal: The signal is a systematic component of variation in a time series.

Noise: The noise is an irregular component of variation in a time series.

  • The hourly temperature recorded at a weather bureau,
  • The total annual yield of wheat over a number of years,
  • The monthly sales of fertilizer at a store,
  • The enrollment of students in various years in a college,
  • The daily sales at a departmental store, etc.

Time Series

A time series ${Y_t}$ or ${y_1,y_2,cdots,y_T}$ is a discrete-time, continuous state process where time $t=1,2,cdots,=T$ are certain discrete time points spaced at uniform time intervals.

A sequence of random variables indexed by time is called a stochastic process (stochastic means random). A data set is one possible outcome (realization) of the stochastic process. If history had been different, we would observe a different outcome, thus we can think of a time series as the outcome of a random variable.

Time Series Introduction Data Analysis

Usually, time is taken at more or less equally spaced intervals such as minutes, hours, days, months, quarters, years, etc. More specifically, it is a set of data in which observations are arranged in chronological order (A set of repeated observations of the same variable arranged according to time).

In different fields of science (such as signal processing, pattern recognition, econometrics, mathematical finance, weather forecasting, earthquake prediction, electroencephalography, control engineering, astronomy, and communications engineering among many other fields) Time-Series-Analysis is performed.

Continuous Time Series

A time series is said to be continuous when the observation is made continuously in time. The term, continuous is used for a series of this type even when the measured variable can only take a discrete set of values.

Discrete Time Series

A time series is said to be discrete when observations are taken at specific times, usually equally spaced. The term discrete is used for a series of this type even when the measured variable is continuous.

We can write a series as ${x_1,x_2,x_3,cdots,x_T}$ or ${x_t}$, where $t=1,2,3,cdots,T$. $x_t$ is treated as a random variable. The arcane difference between time-series variables and other variables is the use of subscripts.

Time series analysis comprises methods for analyzing time-series data to extract some useful (meaningful) statistics and other characteristics of the data, while time-series forecasting is the use of a model to predict future values based on previously observed values.

The first step in analyzing time-series data is to plot the given series on a graph taking time intervals ($t$) along the $X$-axis (as an independent variable) and the observed value ($Y_t$) on the $Y$-axis (as dependent variable). Such a graph will show various types of fluctuations and other points of interest.

https://itfeature.com statistics help

R and Data Analysis

Random Walk Model (2016)

The random walk model is widely used in the area of finance. The stock prices or exchange rates (Asset prices) follow a random walk. A common and serious departure from random behavior is called a random walk (non-stationary) since today’s stock price is equal to yesterday’s stock price plus a random shock.

Types of Random Walk Model

There are two types of random walks

  1. Random walk without drift (no constant or intercept)
  2. Random walk with drift (with a constant term)

Definition

A time series is said to follow a random walk if the first differences (difference from one observation to the next observation) are random.

Note that in a random walk model, the time series itself is not random, however, the first differences in time series are random (the differences change from one period to the next).

A random walk model for a time series $X_t$ can be written as

[X_t=X_{t-1}+e_t, , ,]

where $X_t$ is the value in time period $t$, $X_{t-1}$ is the value in time period $t-1$ plus a random shock $e_t$ (value of error term in time period $t$).

Since the random walk is defined in terms of first differences, therefore, it is easier to see the model as

[X_t-X_{t-1}=e_t, , ,]

where the original time series is changed to a first difference time series, that is the time series is transformed.

The transformed time series:

  • Forecast the future trends to aid in decision-making
  • If the time series follows a random walk, the original series offers little or no insights
  • May need to analyze the first differenced time series

Real World Example

Consider a real-world example of the daily US-dollar-to-Euro exchange rate. A plot of the entire history (of daily US-dollar-to-Euro exchange rate) from January 1, 1999, to December 5, 2014, looks like

Random Walk model

The historical pattern from the above plot looks quite interesting, with many peaks and valleys. The plot of the daily changes (first difference) would look like

Random Walk Model first difference

The volatility (variance) has not been constant over time, but the day-to-day changes are almost completely random.

Key Characteristics of a Random Walk

  • No Pattern: The path taken by a random walk is unpredictable.
  • Independence: Each step is independent of the previous one.
  • Probability distribution: The size and direction of each step can be defined by a probability distribution.

Applications of Random Walk Models

Beyond finance, random walk models have applications in:

  • Physics: Brownian motion and diffusion processes
  • Biology: Population dynamics and genetic drift
  • Computer science: Algorithms and simulations

Remember that, random walk patterns are also widely found elsewhere in nature, for example, in the phenomenon of Brownian Motion that was first explained by Einstein.

Computer MCQs Test Online

R and Data Analysis

Stationary Stochastic Process (2016)

Stationary Stochastic Process

A stationary stochastic process is said to be stationary if its mean and variance are constant over time and the value of the covariance between the two time periods depends only on a distance or gap or lag between the two time periods and not the actual time at which the covariance is computed. Such a stochastic process is also known as weak stationary, covariance stationary, second-order stationary, or wide-sense stochastic process.

In other words, a sequence of random variables {$y_t$} is covariance stationary if there is no trend, and if the covariance does not change over time.

Stationary Stochastic Process

Strictly Stationary (Covariance Stationary)

A time series is strictly stationary if all the moments of its probability distribution are invariance over time but not for the first two (mean and variance).

Let $y_t$ be a stochastic time series with

$E(y_t) = \mu $    $\Rightarrow$ Mean
$V(y_t) = E(y_t -\mu)^2=\sigma^2 $  $\Rightarrow$ Variance
$\gamma_k = E[(y_t-\mu)(y_{t+k}-\mu)]$  $\Rightarrow$ Covariance = $Cov(y_t, y_{t-k})$

$\gamma_k$ is covariance or autocovariance at lag $k$.

If $k=0$ then $Var(y_t)=\sigma^2$ i.e. $Cov(y_t)=Var(y_t)=\sigma^2$

If $k=1$ then we have covariance between two adjacent values of $y$.

If $y_t$ is to be stationary, the mean, variance, and autocovariance of $y_{t+m}$ (shift or origin of $y=m$) must be the same as those of $y_t$. OR

If a time series is stationary, its mean, variance, and autocovariance remain the same no matter at what point we measure them, i.e., they are time-invariant.

Non-Stationary Time Series

A time series having a time-varying mean or a time-varying variance or both is called a non-stationary time series.

Purely Random/ White Noise Process

A stochastic process having zero mean and constant variance ($\sigma^2$) and serially uncorrelated is called a purely random/ white noise process.

If it is independent also then such a process is called strictly white noise.

White noise denoted by $\mu_t$ as $\mu_t \sim N(0, \sigma^2)$ i.e. $\mu_t$ is independently and identically distributed as a normal distribution with zero mean and constant variance.

A stationary time series is important because if a time series is non-stationary, we can study its behavior only for the time period under consideration. Each set of time series data will, therefore, be for a particular episode. As a consequence, it is not possible to generalize it to other time periods. Therefore, for forecasting, such (non-stochastic) time series may be of little practical value. Our interest is in stationary time series.

R Frequently Asked Questions