Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
ConsumerPriceIndicesECB.csv | 2016-01-11 | 29.1 kB | |
ConsumerPriceIndicesECBprepared.csv | 2016-01-11 | 24.3 kB | |
DataStreamUpdate.csv | 2016-01-11 | 18.4 kB | |
DataStreamUpdate.txt | 2016-01-11 | 18.4 kB | |
fredgraph.csv | 2016-01-11 | 7.6 kB | |
irt_lt_mcby_m_1_Data.csv | 2016-01-11 | 101.6 kB | |
irt_lt_mcby_m_Label.csv | 2016-01-11 | 1.2 kB | |
Totals: 7 Items | 200.5 kB | 0 |
=== DESCRIPTION === This is a programm for R-3.2.2. It completes my Master Thesis entitled "A Sparse and Bayesian approach for estimation and forecasting in cointegrated VAR models" and was written in Fall 2015. The Thesis is available at the same place as this README under "MasterThesis.pdf". === CREDITS ==== The main author of the Code is Daniel Gerber (daniel.gerber@epfl.ch), master student at EPFL, Switzerland. Some functions (contained in "SparseCointegration.R", "SimulationHD.R" and "SimulationLD.R") were written by Ines Wilms (ines.wilms@kuleuven.be), PhD student at KULeuven, Belgium. === WORKING EXAMPLES === Here some examples are given on how this code can be used. It is mainly directed to follow and understand the results presented in the thesis. All files presented here are in the folder "UsedPaper". --- BAYESIAN RANK ESTIMATION ---------------------------------------------------------------------------------------------------------------------------------------------------------- The Bayesian rank estimation can be found in "Posterior_r_computed.R" --- ESTIMATION COMPARISON ------------------------------------------------------------------------------------------------------------------------------------------------------------- To compare the sparse with the Bayesian method, the script "EstimationComparison.R" can be used. The initial conditions for methods are set before the for loop begins in line 27. It is also here that the plot for the US swap rates, as well as the MLE and sparse estimation of the cointegration vector are made. The code after line 83 serves mainly to write the results down. --- FORECASTING ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- To compare forecast performances of sparse and Bayesian method for the US swap rates for example, the script "InterestRatesFRED.R" is used. In the first part up to line 80, the data is checked on various aspects to fit the context, e.g. cointegration rank, integrated of order one, etc. In the second part up to line 178, the forecasts are made and their accuracy measured. The remainder of the scripts helps to present the results for reading. --- BAYESIAN ESTIMATION --------------------------------------------------------------------------------------------------------------------------------------------------------------- The script which calculates the posterior distribution for the parameters and approxmates the posterior mean with the Bayesian method is "Estimate_Posterior_Mean_beta.R". --- CORRECTED GIBBS SAMPLER ----------------------------------------------------------------------------------------------------------------------------------------------------------- The script which shows the difference between a converging normal Gibbs sampler and its corrected version is "Plot_Corrected_Gibbs_Sampler.R". === FOLDERS, FILES AND FUNCTIONS === The file STRUCTURE.txt gives information on which file contains which functions and mostly what they do. Most scripts containing functions as for example "FunctionExample.R" have a corresponding Master file "MasterFunctionExample.R". The latter can be used to test functionality of the contained functions. All files functions and packages can be loaded using "Libraries.R".