################################### # Applied Financial Econometrics ################################### ################################### # Tutorial 3: ZOO and Roots ################################### #suggestion..check out the zoo-package (not essential for solution of Ass 3) install.packages("zoo") library("zoo") # import data and construct vector with adjusted price series BMW <- read.csv("BMWData.csv") #to check your data you can use e.g.: ?head ?str ?dimnames # a helpful function for reversing the order of elements in a vector : ?rev #to define a zoo object price<-zoo(,) #to determine the roots of the ar-process (more general of a polynomial) #get your polynomial on basis of estimated ar-coefficients; # create 'polynomial', i.e. vector of polynomial coefficients #->check Ass 2 and check how lag-polynomial in terms of AR-coefficients is defined; note "1" is part of the polynomial; are the coefficients of the polynomial defined positive or negative? polynomial <- c(,) #Hint: to call the estimated coefficients of ar.ols check out the value-section in the ar.ols documentation # use modelname$valuename to obtain specific results from estimation; #note the results are stored in a list; each listentry can be a specific R-Object as eg a vector, matrix, array.. #to find out as which R-Object a listentry is stored use class(listentry$valuename) #?class #also check out what type of R-object an array is and how specific elements of an array are called; ?array #to find roots of a polynomial use: roots <- polyroot() # to compute t-statstics get the asyptotic standard errors of the model use modelname$asy.se.coef # to forecast future values use the predict function or define the forecast-equation manually ?predict