Skip to content

[Fwd: CAPM homework]

1 message · Brian G. Peterson

#
to the list


-------- Forwarded Message --------
From: Baranzan Alhamdu Vayin <BAVayin at uclan.ac.uk>
To: Brian G. Peterson <brian at braverock.com>
Subject: CAPM homework
Date: Thu, 9 Feb 2012 12:45:06 +0000

many thanks brian. so sorry for violating your procedure. it was not intentional.i am not aware. please pardon me. i just posted the complete question with my R.code (the code i wrote), before your response came. my company is Whitbread PLC. the ticker symbol is "WBT". 
A table detailing company data allocation for each student has been attached with this
assignment. All these companies are included in the FTSE100 index. Download daily data for
the last five years (subject to availability) for the particular stock, allocated to you. You need
to identify the particular ticker (symbol) for the company you are given. Pay particular
attention to the fact that some companies can be traded on different markets. You need the
British shares of any such companies. Up to 5 points can be rewarded if you explain why this
is the case in this assignment.
It is up to you how you download this data (but please note the source and mention it in your
assignment). Download data for the same period for FTSE all shares (^FTAS) as well as the
gilts index BG06.L. Using the last two as proxies for the overall market return and the riskfree
return, calculate the appropriate continuously compounded (logarithmic) returns.
1. Provide the appropriate time series regression tests for the CAPM.
2. Estimate the Single Index model for your stock and discuss the differences to the CAPM
estimates.
3. Provide a rolling analysis of the time series CAPM regression. Select appropriate window
and briefly justify your choice. Draw appropriate conclusions from your analysis
Presentation and marking guidelines:
This assignment involves four (1, 2, 3) practical tasks that carry equal weighting. For each of
the above you need to present a computer output demonstrating you have accomplished the
task. This should consist of both computer code and output from the execution of the code.
Please provide details and explanations for any relevant estimation procedures and fully
explain them. No marks will be rewarded if you provide correct results but fail to explain
them (since you may copy the answers from someone else without properly understanding it).
It should be clear to a third party reader, what you have done and more importantly why you
have done it. Aim to provide self-contained explanations that contain enough detail that
allows one to replicate your results (provided they use different estimation software).
Furthermore if they are calculation mistakes, it should be clear of whether you got the
principles right and simply obtained the wrong results because of typing errors, or did not
understood the task. If details are missing, or they are insufficient, the latter will be assumed
resulting in lower marks.
When explaining, refer to background theory, but do not replicate textbooks material. This
assignment is designed to test understanding (alongside practical skills) rather than ability to
rephrase teaching material.
below is my R.code. i do not really really understand the question, so not too sure of what i have done. i shall be most grateful, if you respond swiftly like you did. please, help me with a clearer explanation. many thanks for your quick response, vayin. i equally attached my R.code to this mail.
library("TSA")
library("tseries")
library("zoo")

AvivaDailyPrices = get.hist.quote(instrument="AV.L", start="2007-01-22",
                             end="2012-01-20", quote="AdjClose",
                             provider="yahoo", origin="1970-01-01",
                             compression="d", retclass="zoo")
class(AvivaDailyPrices)
colnames(AvivaDailyPrices)
start(AvivaDailyPrices)
end(AvivaDailyPrices)
nrow(AvivaDailyPrices)
colnames(AvivaDailyPrices) = "AVIVA"

FTSEDailyPrices = get.hist.quote(instrument="^ftas", start="2007-01-22",
                             end="2012-01-20", quote="AdjClose",
                             provider="yahoo", origin="1970-01-01",
                             compression="d", retclass="zoo")
colnames(FTSEDailyPrices) = "FTSE"

GiltDailyPrices = get.hist.quote(instrument="BG06.L", start="2007-01-22",
                             end="2012-01-20", quote="AdjClose",
                             provider="yahoo", origin="1970-01-01",
                             compression="d", retclass="zoo")
colnames(GiltDailyPrices) = "GILT"
# compute daily cc returns
#

AvivaDailyReturns = diff(log(AvivaDailyPrices))
Aviva.df = as.data.frame(coredata(AvivaDailyPrices))
FTSEDailyReturns = diff(log(FTSEDailyPrices))
FTSE.df = as.data.frame(coredata(AvivaDailyPrices))
GILTDailyReturns = diff(log(GiltDailyPrices))
GILT.df = as.data.frame(coredata(GILTDailyPrices))
DailyReturns = merge(AvivaDailyReturns, FTSEDailyReturns,GILTDailyReturns)
DailyReturns = merge(AvivaDailyReturns, FTSEDailyReturns,GILTDailyReturns, by=?date?, all=T)
# create matrix data 
AvivaDailyReturns.mat = coredata(AvivaDailyReturns)
FTSEDailyReturns.mat = coredata(FTSEDailyReturns)
GILTDailyReturns.mat = coredata(GILTDailyReturns)
DailyReturns.mat = coredata(DailyReturns)

# create excess returns by subtracting off risk free rate
# note: coredata() function extracts data from zoo object
DailyReturns.mat = as.matrix(coredata(DailyReturns))
excessReturns.mat = DailyReturns.mat - DailyReturns.mat[,"GILT"]
excessReturns.df = as.data.frame(excessReturns.mat)

# CAPM regression for Aviva (AVIVA) using 5 years of data
capm.fit = lm(AVIVA~FTSE,data=excessReturns.df)
capm.fit = lm(AVIVA~FTSE,data=excessReturns.df)
summary(capm.fit)

# plot data and regression line
plot(excessReturns.df$FTSE,excessReturns.df$AVIVA,
main="CAPM regression for AVIVA",
ylab="Excess returns on AVIVA",
xlab="Excess returns on FTSE")
abline(capm.fit)					# plot regression line
abline(h=0,v=0)					# plot horizontal and vertical lines at 0