Financial Econometrics FIN 36181: Examination on Time Series Analysis

Verified

Added on  2023/06/03

|8
|1991
|66
Project
AI Summary
This assignment is a financial econometrics project analyzing the US stock market, treasury bonds, and treasury bills using MATLAB. The project involves importing and analyzing time series data from 1926 to 2017, calculating returns, and assessing stationarity and autocorrelation. The solution covers data retrieval, visualization of nominal returns, determination of real log returns, and analysis of normal distribution. The project also includes determining absolute and squared log returns, as well as identifying NBER recessions and time series momentum. The MATLAB code is provided in the appendix, detailing the steps involved in data processing, calculations, and generating plots. The project aims to provide a comprehensive understanding of financial time series analysis and asset valuation within the context of the US stock market.
Document Page
FIN 36181
FINANCIAL ECONOMETRICS
DEPARTMENT OF FINANCE
EXAMINATION QUESTION PAPER- Course Paper
COMPONENT OF CONTINUOUS ASSESSMENT
STUDENT NAME
STUDENT ID NUMBER
PROFESSOR (INSTRUCTOR)
DATE OF SUBMISSION
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
INTRODUCTION
The assessment uses the monthly time series for the US stock market index, treasury
bonds maturing in ten years, and the treasury bills maturing in three months. The data is assessed
using the financial toolbox in MATLAV r2018b. The three assets are imported to the software
for further analysis. The financial time series focus on the theory and practice of asset valuation
over a given period of time. This paper analyses data obtained for the three assets in the period of
1926 to 2017. The financial time series contain the element of uncertainty which is brought about
by the stock trends and economic trends in the operating region. For instance, cases of recess,
inflation and deflation affect the stock market alongside the other assets. The linear time series
models are implemented to assess the stationarity and the autocorrelation of the systems. The
return on assets is computed as either a one-period simple return or as a multi-period simple
return. For the simple net return for one period,
1+ Rt = Pt
Pt1 Pt =Pt 1 ( 1+ Rt )
Rt = Pt
Pt1
1= PtPt1
Pt1
For the multi-period simple return, where k represents the different periods,
1+ Rt [ k ] = Pt
Pt k = Pt
Pt 1 x Pt 1
Pt 2
x x Ptk +1
Pt k
¿ ( 1+Rt ) ( 1+Rt1 ) ( 1+ Rt k+1 )
¿
i=0
k1
(1+Rt i)
Document Page
The downloaded annualized simple returns on treasury bills are used on the risk-free rate. The
data is transformed into monthly simple returns using the formula,
1+ Rf ,t
annualized= ( 1+ Rf , t
monthly )12
The equation is solved to obtain the monthly data as,
Rf ,t
monthly = (1+Rf , t
annualized ) 1
121
RESULTS AND ANALYSIS
(i) Retrieving the data from the homepage of the Board of Governors of the Federal
‘reserve system’ on the Build package.
(ii) The selected ‘interests rates’ and ‘continue’ options were chosen to determine the
instrument to download.
(iii) The TB: US government securities/ treasury bills for the secondary market were
selected and the M3: 3 month data was downloaded.
(iv) The monthly frequencies were added to the package for the dates “Jan 1934” to “Aug
2018”.
Step I: Importing the downloaded monthly time series for the US stock market index, treasury
bonds maturing in ten years and treasury bills maturing in three months to MATLAB software
for data analysis.
Document Page
Step II: visualizing the differences between the nominal returns on the three assets at the annual
basis when an investment of $1 is made at the beginning of 1954 to the end of 2017.
Step III: determining the real log returns for the consumer price index at monthly frequency for
each of the three assets at the annual frequency. To determine the arithmetic mean and the
standard deviation for the log inflation rate and for each of the other three real time series on an
annual basis.
Step IV: determining the normal distribution of data on the monthly and annual time series for
the return on the US stock market index for the year 1926 to 2017.
Step V: To determine the absolute log returns and the squared log returns for the daily time
series for the US stock market index data from 1926 to 2017.
Step IV: The NBER recessions are the shaded areas which are defined by the National Bureau of
Economic Research (NBER). It determines the arithmetic mean and the standard deviation for
the non-recession months.
Step V: The time series momentum is obtained based on the return on the US Stock market index
determined in the earlier sections.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
APPENDIX
%% Preliminary Part
clear all
close all
clc
format short
%% importing the data to matlab for analysis
% The data in the monthly record
CRSPindexmonthlyd1=xlsread('CRSPindexmonthly.xlsx','B339:B1106');
RFRmonthlyd1=xlsread('RFRmonthly.xlsx','B248:B1011');
Tbillmonthlyd1=xlsread('Tbillmonthly.xlsx','B248:B1015');
Tbondmonthlyd1=xlsread('Tbondmonthly.xlsx','B17:B784');
%the date values.
CRSPIMdate=xlsread('CRSPindexmonthly.xlsx','A339:A1106');
RFRmdate=xlsread('RFRmonthly.xlsx','A248:A1011');
Tbillmdate=xlsread('Tbillmonthly.xlsx','A248:A1015');
Tbondmdate=xlsread('Tbondmonthly.xlsx','A17:A784');
%converting the date to string
frt=datenum(num2str(CRSPIMdate),'yyyymmdd');
fdate=datestr(frt);
figure(1)
plot(frt,CRSPindexmonthlyd1,'b','Linewidth',1.5);
datetick('x','keepticks','keeplimits');
grid on;
title('US Stock Market Index(1954-2017)');
xlabel('Annual Log:Year 1954-2017');
ylabel('CRSP Index');
%% determining the annual time log series for the RFR
frt2=datenum(num2str(RFRmdate),'yyyymm');
figure(2)
plot(frt2,RFRmonthlyd1,'b','Linewidth',1.5);
datetick('x','keepticks','keeplimits');
grid on;
title('US RFR (1954-2017)');
xlabel('Annual Log:Year 1954-2017');
ylabel('RFR');
%% Determine the annual time log series for the Treasury bills
frt3=datenum(num2str(Tbillmdate),'yyyymm');
figure(3)
plot(frt3,Tbillmonthlyd1,'b','Linewidth',1.5);
datetick('x','keepticks','keeplimits');
grid on;
title('US Treasury bills maturing in three months');
xlabel('Annual Log:Year 1954-2017');
ylabel('Treasury Bills');
Document Page
%% Determine the annual time log series for the Treasury bonds
frt4=datenum(num2str(Tbondmdate),'yyyymm');
figure(4)
plot(frt4,Tbondmonthlyd1,'b','Linewidth',1.5);
datetick('x','keepticks','keeplimits');
grid on;
title('US Treasury Bonds maturing in ten years');
xlabel('Annual Log:Year 1954-2017');
ylabel('Treasury Bonds');
%Calculating the annual arithmetic mean and standard deviation
CRSPmean=mean(CRSPindexmonthlyd1);
CRSPstd=std(CRSPindexmonthlyd1);
RFRmean=mean(RFRmonthlyd1);
RFRstd=std(RFRmonthlyd1);
Tbillmean=mean(Tbillmonthlyd1);
Tbillstd=std(Tbillmonthlyd1);
Tbondmean=mean(Tbondmonthlyd1);
Tbondstd=std(Tbondmonthlyd1);
CRSPindexmonthlyd2=xlsread('CRSPindexmonthly.xlsx','B5:B335');
RFRmonthlyd2=xlsread('RFRmonthly.xlsx','B5:B247');
Tbillmonthlyd2=xlsread('Tbillmonthly.xlsx','B5:B247');
Tbondmonthlyd2=xlsread('Tbondmonthly.xlsx','B5:B16');
CRSPIMda=xlsread('CRSPindexmonthly.xlsx','A5:A335');
RFRmda=xlsread('RFRmonthly.xlsx','A5:A247');
Tbillmda=xlsread('Tbillmonthly.xlsx','A5:A247');
Tbondmda=xlsread('Tbondmonthly.xlsx','A5:A16');
%converting the date to string
frta1=datenum(num2str(CRSPIMda),'yyyymmdd');
frta2=datenum(num2str(RFRmda),'yyyymm');
frta3=datenum(num2str(Tbillmda),'yyyymm');
frta4=datenum(num2str(Tbondmda),'yyyymm');
figure(5)
plot(frta1,CRSPindexmonthlyd2,'b','Linewidth',1.5);
datetick('x','keepticks','keeplimits');
grid on;
title('US Stock Market Index(1954-2017)');
xlabel('Annual Log:Year 1954-2017');
ylabel('CRSP Index');
%% determining the annual time log series for the RFR
figure(6)
plot(frta2,RFRmonthlyd2,'b','Linewidth',1.5);
datetick('x','keepticks','keeplimits');
Document Page
grid on;
title('US RFR ');
xlabel('Annual Log');
ylabel('RFR');
%% Determine the annual time log series for the Treasury bills
figure(7)
plot(frta3,Tbillmonthlyd2,'b','Linewidth',1.5);
datetick('x','keepticks','keeplimits');
grid on;
title('US Treasury bills ');
xlabel('Annual Log');
ylabel('Treasury Bills');
%% Determine the annual time log series for the Treasury bonds
figure(8)
plot(frta4,Tbondmonthlyd2,'b','Linewidth',1.5);
datetick('x','keepticks','keeplimits');
grid on;
title('US Treasury Bonds maturing in ten years');
xlabel('Annual Log');
ylabel('Treasury Bonds');
% return volatility is constant
% Daily time series
CRSPlog=diff(log(CRSPindexmonthlyd1));
%% Daily time series to determine the absolute and squared log returns
figure(9)
log_rtns_absolute=log(Tbondmonthlyd2);
log_rtns_squared=(log_rtns_absolute).^2;
semilogx(log_rtns_absolute);
grid on;
hold on;
semilogx(log_rtns_squared);
title('Return volatility of US Stock Market Index');
legend('Absolute log returns','squared log returns');
%% Part B
...Discussion comparing the results with other solutions
%% NBER Recessions
CRSPindexmonthlyd4=xlsread('CRSPindexmonthly.xlsx','B3:B1106');
CRSPIMdateB=xlsread('CRSPindexmonthly.xlsx','A339:A1106');
frtB=datenum(num2str(CRSPIMdateB),'yyyymmdd');
figure(10)
semilogx(CRSPindexmonthlyd4);
grid on;
% Recession plots
recessionplot;
%Generating a linear model for the US Stock Market Index
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
... It generates the linear regression
%% Setup the Import Options
opts = spreadsheetImportOptions("NumVariables", 2);
% Specify sheet and range
opts.Sheet = "WRDS";
opts.DataRange = "A2:B1106";
% Specify column names and types
opts.VariableNames = ["DateofObservation",
"ValueWeightedReturnincldividends"];
opts.VariableTypes = ["double", "double"];
% Import the data
CRSPindexmonthly = readtable("C:\Users\AGRIPPINA\Documents\MATLAB\october\
fin384\CRSPindexmonthly.xlsx", opts, "UseExcel", false);
M0=fitlm(CRSPindexmonthly); % generates the linear regression model
% to determine the estimates
AnovaCRSP=anova(M0);
%% Time series momentum
...The time series data is risk-free rate (No NaN)
% Data obtained from January 1934 to December 2017
figure(11)
CRSP01341712=xlsread('CRSPindexmonthly.xlsx','B99:B1106');
momentum=tsmom(CRSP01341712);
plot(momentum,'r*');
legend('OPEN');
title('Time series momentum for The US Stock Market Index');
grid on;
recessionplot;
chevron_up_icon
1 out of 8
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]