Assignment On R Software

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

ASSIGNMENT OF TIME SERIES ANALYSIS

AND FORECASTING

SUBMITTED TO: Dr. Said Farooq shah

SUBMITTED BY:
M.HAROON Roll No: 13
Tahir Khan Roll No: 15
Jalal Khan Roll No: 21
BS. 8th SEMESTER

DEPARTMENT OF STATISTICS
UNIVERSITY OF PESHAWAR
METHODOLOGY
R Language
R is an integrated suite of software facilities for data manipulation, calculation and graphical
display. Among other things it has

• an effective data handling and storage facility,

• a suite of operators for calculations on arrays, in particular matrices,

• a large, coherent, integrated collection of intermediate tools for data analysis,

• graphical facilities for data analysis and display either directly at the computer or on hardcopy,
and

• a well-developed, simple, and effective programming language (called ‘S’) which includes
conditionals, loops, user-defined recursive functions, and input and output facilities. (Indeed
most of the system-supplied functions are themselves written in the S language.)

The term “environment” is intended to characterize it as a fully planned and coherent system,
rather than an incremental accretion of very specific and inflexible tools, as is frequently the case
with other data analysis software. R is very much a vehicle for newly developing methods of
interactive data analysis. It has developed rapidly and has been extended by a large collection of
packages. However, most programs written in R are essentially ephemeral, written for a single
piece of data analysis.

DATA SOURCE

It was secondary data. The Data was taken from google. Data contain the GDP of Pakistan and
Bangladesh from 1990 to 2000.

METHOD OF DATA ANALYSIS

The secondary data was arranged in an excel CSV sheet. I use R-Language for my data analysis. The data
was analyzed by using plots, summary statistics, and after that used time series model.
PAKISTAN GDP GROWTH RATE (1990-2020)

This graph presents that the Pakistan GDP growth rate (1990-2020) is a non-stationary time

series plot because the mean and variance both change with the passage of time, so the mean is

not equal to zero, and the variance variates from time to time. From the evidence of this graph

the GDP of Pakistan in 2020 mostly rapidly decreasing, I think it’s the issue of covid-19.
This graph represents that the first seven values shown are “significantly far from zero,” and the

only pattern is perhaps a linear decrease with increasing lag. Now the pattern emerges much

more clearly—after differencing, a moving average model of order 1 seems appropriate. The

model for time series would be a nonstationary IMA(1,1) model.

Covariance and correlation function estimation for GDP Pakistan

The dashed horizontal lines in the graph are intended to give critical values for testing whether or

not the autocorrelation coefficients are significantly different from zero. These limits are based

on the approximate large sample standard error that applies to a white noise process, namely

1/√𝑛. Notice that the sample ACF values do not exceed these rough critical values at every lag.

Of course, the true autocorrelations at every lag are not zero.

The graph shows that the sample autocorrelation function ACF value is insignificant.
In time series analysis, the partial autocorrelation function (PACF) gives the partial correlation of

a stationary time series with its own lagged values, regressed the values of the time series at all

shorter lags. It contrasts with the autocorrelation function, which does not control for other lags.

The graph shows that the sample Partial autocorrelation function PACF value is insignificant.

BANGLADESH GDP GROWTH RATE (1990-2020)


This graph presents that the Bangladesh GDP growth rate (1990-2020) is a non-stationary time

series plot because in early it seems like stationary but with passage time it becomes like

nonstationary time series. The mean and variance both change with the passage of time, so the

mean is not equal to zero, and the variance variates time to time. From the evidence of this graph

the GDP of Bangladesh in 2020 mostly rapidly decreasing, I think it’s the issue of covid-19.

This graph represents that the first four values shown are “significantly far from zero,” and the

only pattern is perhaps a linear decrease with increasing lag. Now the pattern emerges much

more clearly—after differencing, a moving average model of order 1 seems appropriate. The

model for time series would be a nonstationary IMA(1,1) model.


Covariance and correlation function estimation for GDP Bangladesh

The dashed horizontal lines in the graph are intended to give critical values for testing whether or

not the autocorrelation coefficients are significantly different from zero. These limits are based

on the approximate large sample standard error that applies to a white noise process, namely

1/√𝑛. Notice that the sample ACF values do not exceed these rough critical values at every lag.

Of course, the true autocorrelations at every lag are not zero.

The graph shows that the sample autocorrelation function ACF value is insignificant.
In time series analysis, the partial autocorrelation function (PACF) gives the partial correlation of

a stationary time series with its own lagged values, regressed the values of the time series at all

shorter lags. It contrasts with the autocorrelation function, which does not control for other lags.

The graph shows that the sample Partial autocorrelation function PACF value is insignificant.

SUMMARY (Data1):

Year GDP.PAK GDP.BANG


Min. :1990 Min. :0.5255 Min. :2.376
1st Qu.:1998 1st Qu.:2.6493 1st Qu.:4.726
Median :2005 Median :4.3965 Median :5.443
Mean :2005 Mean :4.0413 Mean :5.568
3rd Qu.:2012 3rd Qu.:5.2942 3rd Qu.:6.529
Max. :2020 Max. :7.7059 Max. :8.153

This Figure show that the summary of data1 set there are three variables “Year” minimum year is

1990, maximum year is 2020, now the first quartile is 1998, and mean is 2005.

“GDP.PAK” minimum value is 0.5255; the maximum value is 7.7059, if the first quartile is

2.6493 and the mean is 4.0413.

“GDP.NEPAL” minimum value 2.376, the maximum value is 8.153, so the first quartile 4.726

and the mean 5.568.

You might also like