<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">OJBM</journal-id><journal-title-group><journal-title>Open Journal of Business and Management</journal-title></journal-title-group><issn pub-type="epub">2329-3284</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/ojbm.2015.33032</article-id><article-id pub-id-type="publisher-id">OJBM-58336</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Business&amp;Economics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Analysing and Optimising Bank Real Estate Portfolio by Using Impulse Response Function, Mahalanobis Distance and Financial Turbulence
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>gnjen</surname><given-names>Vukovic</given-names></name><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><author-notes><corresp id="cor1">* E-mail:<email>ognjen.vukovic@uni.li, oggyvukovich@gmail.com</email>;<email>Department for Finance, University of Liechtenstein, Vaduz, Liechtenstein</email>;</corresp></author-notes><pub-date pub-type="epub"><day>05</day><month>06</month><year>2015</year></pub-date><volume>03</volume><issue>03</issue><fpage>326</fpage><lpage>344</lpage><history><date date-type="received"><day>21</day>	<month>June</month>	<year>2015</year></date><date date-type="rev-recd"><day>accepted</day>	<month>25</month>	<year>July</year>	</date><date date-type="accepted"><day>28</day>	<month>July</month>	<year>2015</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  This paper analyses one of the main factors that cause financial crisis and that are real estate portfolio management in banks. VAR and SVAR models were introduced and impulse response functions were obtained. The aforementioned function demonstrated how residential prices reacted to shock. Afterwards, financial turbulence index based on Mahalanobis distance and correlation between real estate prices in Austria, Germany and Switzerland was calculated and its relation to stock prices in EURO area. Financial turbulence demonstrated the lagging effect of financial crisis originating from USA. Data were taken from St. Louis FED database. Having calculated correlations, portfolio was created consisting of REITs, ETFs and stocks. It was optimised and efficient frontiers were found for different portfolio weightings. It was proved that the best way to optimise real estate portfolio was to invest in Swiss real estate as prices were growing and to hedge with Austrian real estate or some variations of ETFs.
 
</p></abstract><kwd-group><kwd>Mahalanobis Distance</kwd><kwd> Real Estate</kwd><kwd> Portfolio Management</kwd><kwd> Financial Turbulence</kwd><kwd> Impulse  Response Function</kwd><kwd> Germany</kwd><kwd> Switzerland</kwd><kwd> Austria</kwd><kwd> Portfolio Optimisation</kwd><kwd> Efficient Frontier</kwd><kwd>  Correlation</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Financial bubbles are a real threat to the system. The arousal of financial bubbles must be closely monitored as there is a possibility to cause havoc in financial systems. In order to analyse the financial bubbles, nonlinearities and illogical movement of correlated time series must be observed. One of the newly introduced tools in the aforementioned time series analysis is impulse response functions.</p><p>Impulse response function demonstrates how the endogenous variables react to shock through time. Although impulse response functions are related to SVAR and VAR models, their observation independently can be very useful as they serve as a perfect tool to observe illogical movement between time series. By observing impulse response functions, it could come to a conclusion that illogical movement could act as a predictor of real estate bubbles. If the link between real estate movement and other macroeconomic variables is broken, it could be said that variables start to follow random walk which is characteristic in the financial theory. At the same time, if variables are correlated in the way that economic and financial theory cannot explain, then the threat of the financial contagion and financial crisis is high. Impulse response functions are based on SVAR models. The basic idea behind impulse response functions is the following: As SVAR model represents an econometric model, it describes the evolution of a set of <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x5.png" xlink:type="simple"/></inline-formula> variables over the same sample period. At the same it has the error term that is represented like<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x6.png" xlink:type="simple"/></inline-formula>. Impulse response function tries the following. It “shocks” the error term or in the other words, it refers to the reaction of any dynamic system in response to some external change. It is used to show how the financial systems or the variables that are observed react to exogenous impulses, which usually are called by economists as a “shock”.</p><p>After having introduced VAR and SVAR models, impulse response function will be introduced. The results of impulse response function for Austria, Germany and Switzerland will be presented. The results will be analysed and will be tried to be applied to real estate portfolio management by analysing correlation between stock prices and real estate price movement in the aforementioned countries. After careful analysis, the portfolio consisting of REITS and leading stock indices, EFTs, will be tried to be optimised and efficient frontier will be found. Concerning the aforementioned analysis, sensitivity analysis will be conducted and different points of efficient frontier will be obtained.</p></sec><sec id="s2"><title>2. Background and Theory</title><sec id="s2_1"><title>2.1. VAR Model, Lyapunov Exponent and Martingale</title><p>Firstly VAR [<xref ref-type="bibr" rid="scirp.58336-ref1">1</xref>] models will be introduced.</p><p>VAR model is used to detect interdependencies in the linear interdependent model. It has the following formation:</p><disp-formula id="scirp.58336-formula123"><label>(1)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/10-1530193x7.png"  xlink:type="simple"/></disp-formula><p>where the l-periods back observation y<sub>t</sub><sub>−l</sub> is called the l-th lag of y, c is a k &#215; 1 vector of constants (intercepts), A<sub>i</sub> is a time-invariant k &#215; k matrix and e<sub>t</sub> is a k &#215; 1 vector of error terms. The thing that must be noted is that all variables must be of the same order of integration. The order of integration denoted <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x8.png" xlink:type="simple"/></inline-formula> is the number of differences required to obtain a covariance stationary series. In statistics, a stationary process is defined as a stochastic process whose joint probability distribution does not change when shifted in time. Consequently, parameters do not change over time and do not follow any trends.</p><p>The stationary process [<xref ref-type="bibr" rid="scirp.58336-ref2">2</xref>] is defined in the following way:</p><p>Formally, let <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x9.png" xlink:type="simple"/></inline-formula> be a stochastic process and let <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x10.png" xlink:type="simple"/></inline-formula> represent the cumulative distribution of the joint distribution function of <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x11.png" xlink:type="simple"/></inline-formula> at times<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x12.png" xlink:type="simple"/></inline-formula>. Then <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x13.png" xlink:type="simple"/></inline-formula> is said to be strictly (or strongly) stationary if, for all<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x14.png" xlink:type="simple"/></inline-formula>, for all <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x15.png" xlink:type="simple"/></inline-formula> and for all<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x16.png" xlink:type="simple"/></inline-formula>, the following equation is valid:</p><disp-formula id="scirp.58336-formula124"><label>(2)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/10-1530193x17.png"  xlink:type="simple"/></disp-formula><p>Since <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x18.png" xlink:type="simple"/></inline-formula> doesn’t affect <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x19.png" xlink:type="simple"/></inline-formula> is not function of time.</p><p>Covariance stationary series means that covariance is stable or in the other words not changing over time. However series that we are observing are martingale series, which means that they do not exhibit covariance dependency. Martingale is defined in the following way:</p><p>In the probability theory, a martingale [<xref ref-type="bibr" rid="scirp.58336-ref3">3</xref>] is a model of a fair game where knowledge of past events never helps predict the mean of future winings. In particular, a martingale is a sequence of random variables (stochastic process) for which, at a particular time in the realized sequence, the expectation of the next value in the sequence is equal to the present observed value even given knowledge of all prior observed values. An unbiased random walk (in any number of dimensions) is an example of a martingale.</p><p>It is defined in the following way:</p><p>A basic definition of a discrete-time martingale [<xref ref-type="bibr" rid="scirp.58336-ref4">4</xref>] as a discrete-time stochastic process for a sequence of random variables <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x20.png" xlink:type="simple"/></inline-formula> that satisfies for any time n,</p><disp-formula id="scirp.58336-formula125"><label>(3)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/10-1530193x21.png"  xlink:type="simple"/></disp-formula><p>The conditional expected value of the next observation, given all the past observations, is equal to the last observations. Due to the linearity of expectation, this second requirement is equivalent to:</p><disp-formula id="scirp.58336-formula126"><label>(4)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/10-1530193x22.png"  xlink:type="simple"/></disp-formula><p>or</p><disp-formula id="scirp.58336-formula127"><label>(5)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/10-1530193x23.png"  xlink:type="simple"/></disp-formula><p>For our analysis, the time series that we observe are Markovian time series and martingale processes that follow Brownian motion. <xref ref-type="fig" rid="fig1">Figure 1</xref> shows and demonstrates graphically stopped Brownian motion as an example of martingale because those are the time series we will observe.</p><p>One of the theorems will be used. The theorem states that:</p><p>T.1. One of the continuous martingale process with stationary increments is Brownian motion. (Hamilton et al. 1994) [<xref ref-type="bibr" rid="scirp.58336-ref3">3</xref>] .</p><p>At the same time there exist other martingale processes [<xref ref-type="bibr" rid="scirp.58336-ref5">5</xref>] but it is assumed that those processes are not observed. In this way, VAR model functions really well and impulse response function can be observed.</p><p>The variables that we are observing are the following:</p><p>1) Inflation;</p><p>2) Commercial and construction estate prices;</p><p>3) GDP;</p><p>4) Real estate prices.</p><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> Stopped Brownian motion as an example of martingale. Author own calculation</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x24.png"/></fig><p>Howitt and Clower demonstrate that economic systems emerge spontaneously on their own from a decentralized state [<xref ref-type="bibr" rid="scirp.58336-ref6">6</xref>] . As the whole economics generally comes in cycles, it is necessary to see whether or not randomness contributes to increasing or decreasing oscillations. Not all randomness is regular Brownian motion (RBM). Most is not regular Brownian motion, but is the special type of fractal Brownian motion (FBM) where the fractal dimension is 0.5 (Sanderson, 2009). In order to analyse the data, the Sanderson plot [<xref ref-type="bibr" rid="scirp.58336-ref7">7</xref>] will be taken. <xref ref-type="fig" rid="fig2">Figure 2</xref> demonstrates the prepolicy attractor before European Central Bank implemented crisis measures.</p><p>This prepolicy attractor, shown in <xref ref-type="fig" rid="fig2">Figure 2</xref>, demonstrates that there is no steady random state for any observed variable as we see that attractors are wide spread and they don’t demonstrate any fixed point. After implementing the stage three of ECB policy, the situation is still chaotic. The attractor shows that the <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x25.png" xlink:type="simple"/></inline-formula> state compared to the <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x25.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x26.png" xlink:type="simple"/></inline-formula> has no defined movement.</p><p>The following post-policy attractor [<xref ref-type="bibr" rid="scirp.58336-ref7">7</xref>] shown in <xref ref-type="fig" rid="fig3">Figure 3</xref> demonstrates the situation after crisis measures.</p><p>After implementig the policy, the situation is still chaotic as however there is more regularity, but not even that much to be a deterministic process.</p><p>In order to explain the behavior of the system, Lyapunov exponent [<xref ref-type="bibr" rid="scirp.58336-ref8">8</xref>] will be used as it can describe the randomness of the system.</p><p>Lyapunov exponent is defined in the following way:</p><disp-formula id="scirp.58336-formula128"><label>(6)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/10-1530193x27.png"  xlink:type="simple"/></disp-formula><p>where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x28.png" xlink:type="simple"/></inline-formula> is the Lyapunov exponent.</p><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> Prepolicy attractor (before ECB implemented crisis measures) [<xref ref-type="bibr" rid="scirp.58336-ref7">7</xref>] </title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x29.png"/></fig><fig id="fig3"  position="float"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> Postpolicy attractor [<xref ref-type="bibr" rid="scirp.58336-ref7">7</xref>] </title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x30.png"/></fig><p>In mathematics, the Lyapunov exponent is a quantity that characterizes the rate of separation of infintensimally close trajectories. MLE is a maximum Lyapunov exponent which determines the notion of predictability for a dynamical system. A positive MLE says that the system is chaotic. On the other side, the system demonstrates that it is dissipative if MLE is negative. Dissipative means that system is operating far from equilibrium and that time series in that case cannot be predicted. Although the policy has caused the system to start orbiting around the point, but is doing so in a random FBM manner.</p><p>According to [<xref ref-type="bibr" rid="scirp.58336-ref7">7</xref>] , MLE is before policy −0.0234 and after the policy, it is −0.0985. It means that the aforementioned systems are exhibiting randomness and this supports martingale hypothesis.</p><p>Therefore we are talking about local martingale that is a subclass of martingale.</p><p>It can be shown that attractor policy of ECB is given in the graph below that is shown in <xref ref-type="fig" rid="fig4">Figure 4</xref>.</p><p><xref ref-type="fig" rid="fig4">Figure 4</xref> demonstrates attractor point for European Central Bank policy.</p><p>It is shown that equilibrium point can be achieved, but oscillation around the equilibrium point is not predictible. This supports our hypothesis of local martingale and covariance stationarity, therefore VAR and SVAR model can be introduced.</p></sec><sec id="s2_2"><title>2.2. SVAR Model</title><p>Now the SVAR models will be introduced. From an economic point of view, if the joint dynamics of a set of variables can be represented by a VAR model, then the structural form is a depiction of the underlying, “structural”, economic relationships [<xref ref-type="bibr" rid="scirp.58336-ref1">1</xref>] . Two features of the structural form make it the preferred candidate to represent the underlying relations:</p><p>・ Error terms are not correlated.</p><p>・ Variables can have a contemporaneous impact on other variables.</p><p>Structural VAR model is defined with the following equation:</p><disp-formula id="scirp.58336-formula129"><label>(7)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/10-1530193x31.png"  xlink:type="simple"/></disp-formula><p>Because of the parameter identification problems, SVAR models cannot be estimated by using ordinary least squares method, but they can be solved by using reduced VAR models. Cholesky decomposition takes one of the leading factors in reducing VAR models using lower- or upper-triangular matrix. Cholesky is a matrix decomposition that ensures that your residual covariance matrix could be transformed into a diagonal matrix. The purpose of this Cholesky decomposition is that the impulse to one variable (or their innovations) must be unrelated to the impulse in another variable, otherwise, it is unrealistic to assume that one variable would remain static (no impulse) while the other moves (impulse).</p></sec><sec id="s2_3"><title>2.3. Impulse Response Function</title><p>Impulse response function [<xref ref-type="bibr" rid="scirp.58336-ref9">9</xref>] is widely used in signal processing. It demonstrates the response of the dynamical</p><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> Attractor point for ECB policy, no stable state, oscillation around point [<xref ref-type="bibr" rid="scirp.58336-ref7">7</xref>] </title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x32.png"/></fig><p>function to the external signal. In economics impulse response functions are used in order to analyse how the function reacts to exogenous shocks. IRF are used to track the response of a system’s variables to impulses of the system’s shocks. Orthogonalising the VAR’s shocks is required so that the shocks tracked by IRFs are uncorrelated. Combining the needs of identification and non-arbitrary orthogonalisation has since become the focus of structural VAR (SVAR) analysis. We use the short-run SVAR model with two lags per variable.</p><p>However IRF are not perfect. They typically suffer from large small-sample biases stemming from bias in the estimated autoregressive coefficients. On the other side, they give a good demonstration how the system that is covariance stationary, in the other words system whose covariance matrix is not changing, reacts to shocks.</p></sec><sec id="s2_4"><title>2.4. Mahalanobis Distance and Financial Turbulence</title><p>After having introduced the external aspect of the analysis, the Mahalanobis distance [<xref ref-type="bibr" rid="scirp.58336-ref10">10</xref>] will be analysed and its relation to financial turbulence.</p><p>Mahalanobis distance is introduced as</p><disp-formula id="scirp.58336-formula130"><label>(8)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/10-1530193x33.png"  xlink:type="simple"/></disp-formula><p>The Mahalanobis distance is the distance of an observation <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x34.png" xlink:type="simple"/></inline-formula> from a group of observations with mean <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x34.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x35.png" xlink:type="simple"/></inline-formula> and covariance matrix S. Mahalanobis distance is ideal for the portfolio management as it is multivariate, unitless and scale-invariant and it takes into consideration the correlations between the variables. The aforementioned distance will be used in analysis of the financial turbulence index. It represents a multivariate measure of dispersion. It can be shown in the diagram below:</p><p><xref ref-type="fig" rid="fig5">Figure 5</xref> which is shown above demonstrates graphically the derivation of Mahalanobis distance. Firstly multivariate data is given, secondly coordinate system pertaining to the data is constructed and according to Chebyshev</p><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> Construction of Mahalanobis distance. Source: Author’s own graph</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x36.png"/></fig><p>inequality, ellipse is obtained. Next the data is transformed to Descartes system and dispersion is measured according to Mahalanobis distance formula. Mahalanobis distance demonstrates the distance of every data point from the center of ellipse. It is a multi-dimensional generalization of the idea of measuring how many standard deviations is the point away from the mean of distribution.</p></sec><sec id="s2_5"><title>2.5. Financial Turbulence</title><p>Financial turbulence describes the volatility of the model as well as its complexity [<xref ref-type="bibr" rid="scirp.58336-ref11">11</xref>] . It will be graphically presented and analysed. The analysis is conducted in the R environment by using ROC curves and Mahalanobis distance. ROC curve is a receiver operating characteristic curve. It helps measure the performance of different models through a visual chart that makes the analysis very statistical friendly. Besides the graph, the accuracy of the model can be assessed measuring the area under the ROC curve. An area of 1 represents a perfect test, an area of 0.5 represents a worthless test, the random guessing procedure. So the closer to the 1 AUC, the better model. This measure is close to Gini coefficient.</p><p>After having introduced the impulse response function and financial turbulence index, the correlation between Germany, Austrian and Swiss real estate prices will be compared. Correlation will be calculated as well as the correlation between stock prices in Europe, USA and real estate prices in the European area. Afterwards, the following correlations will be tried to be connected to impulse response functions. In order to analyse portfolio, code in R was written where the combination of real estate investment trusts in Germany, Switzerland and Austria are pooled with the leading stock indices in the aforementioned countries. The efficient frontier is obtained and the optimal point on the aforementioned frontier. Sensitivity analysis is conducted in order to obtain possible portfolio points and to find the best possible portfolio. Code will be given in the Appendix.</p></sec></sec><sec id="s3"><title>3. Methodology and Modeling</title><sec id="s3_1"><title>3.1. IRF Austria</title><p>The following impulse response function was applied to the following equations:</p><p>VAR Model―Substituted Coefficients:</p><p>===============================</p><p>CONSTRUCTION_AUSTRIA = - 0.25058940696*CONSTRUCTION_AUSTRIA(-1) - 0.459750115918*CONSTRUCTION_AUSTRIA(-2) - 0.114121589618*CONSUMER_AUSTRIA(-1) + 0.130215108021*CONSUMER_AUSTRIA(-2) + 0.00190293002625*RESIDENTIAL_AUSTRIA(-1) + 0.00240637865452*RESIDENTIAL_AUSTRIA(-2) + 0.185136772789</p><p>CONSUMER_AUSTRIA = - 0.637860667041*CONSTRUCTION_AUSTRIA(-1) + 1.16688027213*CONSTRUCTION_AUSTRIA(-2) + 1.0320494548*CONSUMER_AUSTRIA(-1) - 0.0389801786987*CONSUMER_AUSTRIA(-2) - 0.00141428580892*RESIDENTIAL_AUSTRIA(-1) + 0.024944905185*RESIDENTIAL_AUSTRIA(-2) + 0.576676354912</p><p>RESIDENTIAL_AUSTRIA = - 0.703620433172*CONSTRUCTION_AUSTRIA(-1) - 0.246400501023*CONSTRUCTION_AUSTRIA(-2) - 0.766625066844*CONSUMER_AUSTRIA(-1) + 0.900406609385*CONSUMER_AUSTRIA(-2) + 0.405273848586*RESIDENTIAL_AUSTRIA(-1) + 0.0786561614292*RESIDENTIAL_AUSTRIA(-2) - 10.5826435239</p><p><xref ref-type="fig" rid="fig6">Figure 6</xref> demonstrates Impulse response functions which are included in SVAR model for Austria real estate prices. Every variable is considered endogenous and two lags of the variables were taken according to Akaike Information Criterion [<xref ref-type="bibr" rid="scirp.58336-ref12">12</xref>] . It can be seen that the reaction of construction prices to residential prices is not strong, almost with no change at one s.d. Consumer prices are increasing with residential prices, while the cooling of the system can be seen for the shocks to the lags of residential prices in Austria to current residential prices, so there is no risk of financial crisis. At the same time, consumer Austria prices are stable. The system of Austria seems to be stable, the Lyapunov exponent is zero, it means that system is not changing, so there is no problematic issue.</p></sec><sec id="s3_2"><title>3.2. IRF Germany and Switzerland</title><p>Next country that will be considered is Germany.</p><fig id="fig6"  position="float"><label><xref ref-type="fig" rid="fig6">Figure 6</xref></label><caption><title> Impulse response function for Austria. Source: Own calculations</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x37.png"/></fig><p>The equations are given below:</p><p>VAR Model―Substituted Coefficients:</p><p>===============================</p><p>CONSTRUCTION_BIS = 1.04015622893*CONSTRUCTION_BIS(-1) - 0.010605943681*CONSTRUCTION_BIS(-2) - 0.113103992437*CONSTRUCTION_BIS(-3) + 0.0599629558709*CONSTRUCTION_BIS(-4) + 0.172399894059*INDUSTRIAL_BIS(-1) - 0.0629487441808*INDUSTRIAL_BIS(-2) - 0.0538620378999*INDUSTRIAL_BIS(-3) + 0.0768575005362*INDUSTRIAL_BIS(-4) - 0.121412907321*INFLATION_BIS(-1) - 0.183074076281*INFLATION_BIS(-2) + 0.217417409139*INFLATION_BIS(-3) - 0.037264304489*INFLATION_BIS(-4) + 0.0953327936089*RESIDENTIAL_BIS(-1) - 0.240315699426*RESIDENTIAL_BIS(-2) + 0.231742731516*RESIDENTIAL_BIS(-3) - 0.0791813608327*RESIDENTIAL_BIS(-4) + 1.15881032878</p><p>INDUSTRIAL_BIS = - 0.0565084568727*CONSTRUCTION_BIS(-1) - 0.0157230991653*CONSTRUCTION_BIS(-2) + 0.227748482533*CONSTRUCTION_BIS(-3) - 0.0756151355205*CONSTRUCTION_BIS(-4) + 1.68516154854*INDUSTRIAL_BIS(-1) - 1.10257422148*INDUSTRIAL_BIS(-2) + 0.365193713622*INDUSTRIAL_BIS(-3) - 0.0511688446375*INDUSTRIAL_BIS(-4) + 0.147883781154*INFLATION_BIS(-1) + 0.103473341741*INFLATION_BIS(-2) + 0.0625277406773*INFLATION_BIS(-3) - 0.31406140906*INFLATION_BIS(-4) - 0.0293426026949*RESIDENTIAL_BIS(-1) + 0.112594480255*RESIDENTIAL_BIS(-2) - 0.0956294175642*RESIDENTIAL_BIS(-3) + 0.0309590164752*RESIDENTIAL_BIS(-4) + 0.429794861285</p><p>INFLATION_BIS = - 0.0503339307518*CONSTRUCTION_BIS(-1) + 0.0780212358795*CONSTRUCTION_BIS(-2) + 0.172509321418*CONSTRUCTION_BIS(-3) - 0.18807452317*CONSTRUCTION_BIS(-4) + 0.195038273478*INDUSTRIAL_BIS(-1) - 0.359851587789*INDUSTRIAL_BIS(-2) + 0.335509872932*INDUSTRIAL_BIS(-3) - 0.132303998713*INDUSTRIAL_BIS(-4) + 0.740482791169*INFLATION_BIS(-1) + 0.198040117272*INFLATION_BIS(-2) - 0.245682150704*INFLATION_BIS(-3) + 0.242074891337*INFLATION_BIS(-4) - 0.0405214313903*RESIDENTIAL_BIS(-1) + 0.173648666406*RESIDENTIAL_BIS(-2) - 0.197100290085*RESIDENTIAL_BIS(-3) + 0.0670286912536*RESIDENTIAL_BIS(-4) + 1.5064426254</p><p>RESIDENTIAL_BIS = - 0.313697913637*CONSTRUCTION_BIS(-1) + 0.273689944471*CONSTRUCTION_BIS(-2) + 0.0422829641854*CONSTRUCTION_BIS(-3) - 0.219963030411*CONSTRUCTION_BIS(-4) - 0.324385842268*INDUSTRIAL_BIS(-1) + 0.302938398084*INDUSTRIAL_BIS(-2) + 0.284481595201*INDUSTRIAL_BIS(-3) - 0.194853688117*INDUSTRIAL_BIS(-4) + 0.402197862793*INFLATION_BIS(-1) - 0.168427186612*INFLATION_BIS(-2) - 0.283674858661*INFLATION_BIS(-3) + 0.277947523561*INFLATION_BIS(-4) + 1.92903825032*RESIDENTIAL_BIS(-1) - 1.18149247039*RESIDENTIAL_BIS(-2) + 0.397777336912*RESIDENTIAL_BIS(-3) - 0.190296911198*RESIDENTIAL_BIS(-4) - 3.06061094373</p><p><xref ref-type="fig" rid="fig7">Figure 7</xref> demonstrates Impulse response functions which are included in SVAR model for German real estate prices. The four lags were used according to Akaike information criterion. It looks that shock to all the variables except real estate are increasing. The connection between variables are broken, which doesn’t represent a problem if we consider time series as local martingales. But if the time series are dependent, real estate prices can foreshadow the possible financial contagion and crisis.</p><p>The Switzerland exhibits increasing real estate prices. <xref ref-type="fig" rid="fig8">Figure 8</xref> demonstrates impulse response function for Swiss real estate market. At the same time, other variables are constant and they are moving without any connection. It is proved that correlation between variables is random or that there is according to Sanderson (2012) there is no correlation. This satisfies the system.</p></sec><sec id="s3_3"><title>3.3. Financial Turbulence</title><p>After having analysed one aspect of real estate, next analysis will follow financial turbulence [<xref ref-type="bibr" rid="scirp.58336-ref13">13</xref>] . By using Mahalanobis distance and ROC curve, financial turbulence is calculated. It is presented in the graph below.</p><p>Financial turbulence is demonstrated in <xref ref-type="fig" rid="fig9">Figure 9</xref>, which exposes volatility of portfolio of real estate prices, that the biggest shock of the crisis was felt in 2011 for the aforementioned countries, where the distance from the mean was around 40 standard deviations which is based on Mahalanobis distance .In the whole, it means that the crisis is lagging in the aforementioned countries and it is still present because the financial turbulence index has a value of 13,367 that is still high. In the next graph autocorrelation of financial turbulence will be given.</p><fig id="fig7"  position="float"><label><xref ref-type="fig" rid="fig7">Figure 7</xref></label><caption><title> Impulse response function for Germany residential. Source: Own calculation</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x38.png"/></fig><fig id="fig8"  position="float"><label><xref ref-type="fig" rid="fig8">Figure 8</xref></label><caption><title> Impulse response function of Swiss real estate market. Source: Own calculation</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x39.png"/></fig><fig id="fig9"  position="float"><label><xref ref-type="fig" rid="fig9">Figure 9</xref></label><caption><title> Financial turbulence (volatility and percentage change) of port- folio of real estate prices of Germany, Austria and Switzerland. Source: Own calculation</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x40.png"/></fig><p><xref ref-type="fig" rid="fig1">Figure 1</xref>0 demonstrates the autocorrelation of financial turbulence.</p><p>Autocorrelation exhibits non importance of lags therefore it confirms that the aforementioned series follows random walk and stationarity of series is confirmed. The autocorrelation is defined in the following way (Priestley M.B. et al. 1981):</p><disp-formula id="scirp.58336-formula131"><label>(9)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/10-1530193x41.png"  xlink:type="simple"/></disp-formula><p>where <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/10-1530193x42.png" xlink:type="simple"/></inline-formula> is the expected value operator. The autocorrelation must lie between 1 and −1. The biggest correlation is at 10<sup>th</sup> lag which means that process is lagging 2 - 3 years which explains financial turbulence.</p><p>After having analysed the impulse response function and financial turbulence, the correlation between real estate prices and stock prices will be given. The data is taken from St. Louis FED. The residence price as a time-series is given in the following graph, taking 1970 as the index year and concerning Austria, because of lack of data, the 2000 is taken as index year. The graph of residence price movement in Switzerland, Germany and Austria is given in <xref ref-type="fig" rid="fig1">Figure 1</xref>1. <xref ref-type="fig" rid="fig1">Figure 1</xref>1 at the same time demonstrates the comparison of residence prices in these three countries.</p><p>Correlation between German and Swiss prices is 0.98, so it means they are perfectly well correlated. Impulse response function demonstrates that Swiss real estate prices will continue to grow, but however German growth is slowing down, therefore the implication is the following:</p><p>Although the correlation between German and Austrian real estate prices will decrease, the correlation is still too high to make investment as a measure of diversification in the aforementioned real estate in Germany and Switzerland.</p><p>However the correlation between residence prices in Austria and Germany and Austria and Switzerland is around 0.4. Therefore there is still positive correlation, so investing in real estate portfolio in those countries and by examining impulse response functions, it can be seen that growth of German real estate prices are positively correlated with Austrian real estate prices which means that investing in German and Austrian real estate can be defined as that growth of real estate prices in Germany causes also growth in real estate Austrian prices. But if we analyse the real estate management, not from a correlational perspective, because Pearson correlation coefficient indicates the strength of linear relationship between two variables, but its value does not completely characterize their relationship. The graph shows that real estate prices in Austria are stable and will stay stable according to impulse response function, while the real estate prices in Germany are growing, therefore investment in those real portfolios is the following:</p><p>If you want to hedge, invest most of the real estate portfolio in Austrian real estate as it is stable and bet according to impulse response function that German real estate prices will continue to grow and then they will be characterised by a drop. That is the point when the bank or investor should sell the real estate portfolio in Germany.</p><fig id="fig10"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>0</label><caption><title> Autocorrelation of financial turbulence. Source: Own calculation</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x43.png"/></fig><fig id="fig11"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>1</label><caption><title> Residence price in Switzerland, Germany and Austria [<xref ref-type="bibr" rid="scirp.58336-ref14">14</xref>] </title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x44.png"/></fig><p>When it comes to real estate prices in Switzerland and Austria, the portfolio can be more diversified by investing in Austrian real estate and Swiss real estate. Swiss real estate demonstrates that the prices will continue to grow, therefore portfolio in banking can be more diversified and more money can be invested in Swiss real estate and less in Austrian, because Austrian real estate imply stability, but as it is certain that Swiss real estate market will continue to grow, investment in Swiss real estate will secure certain profit.</p><p>In order to proceed, the correlation between EURO area stock prices and real estate prices in Germany and Switzerland will be analysed. Firstly, the stock prices movement in EURO area will be presented in <xref ref-type="fig" rid="fig1">Figure 1</xref>2 which is shown below.</p><p>Correlation between EURO area stock prices and Germany real estate prices is −0.49 until 2000. Afterwards the aforementioned correlation reduced to −0.33. This implies the following:</p><p>In order to hedge the portfolio, the best option is to invest in German or Swiss real estate and part of the funds should be directed into European stock prices. In that way, the portfolio can be hedged.</p><p>The correlation between EURO area stock prices and Switzerland real estate prices is −0.04. Hedging possibilities are much lower here.</p><p>In order to conclude the aforementioned section, the movement of USA stock prices as well as comparison between real estate prices in Germany and USA will be given in <xref ref-type="fig" rid="fig1">Figure 1</xref>3 and is shown below.</p><p><xref ref-type="fig" rid="fig1">Figure 1</xref>4 demonstrates the comparison between movement of USA real estate prices and residence prices in Germany. It is followed that residence price in Germany are lagging behind the USA real estate prices. It should also be noted that financial contagion is the consequence of real estate price movement in USA and that the effect of movement of German real estate price is lagging.</p><p>The following issues will be observed in portfolio optimisation procedure in the following chapter.</p></sec></sec><sec id="s4"><title>4. Portfolio Optimisation</title><p>The portfolio that we made is composed of the following:</p><p>・ PSP Swiss Property AG is a Switzerland based real estate holding company. It is assumed that its stock price is the reflection of real estate prices in Switzerland.</p><fig id="fig12"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>2</label><caption><title> Stock prices EURO area [<xref ref-type="bibr" rid="scirp.58336-ref14">14</xref>] </title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x45.png"/></fig><fig id="fig13"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>3</label><caption><title> Real estate USA [<xref ref-type="bibr" rid="scirp.58336-ref14">14</xref>] </title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x46.png"/></fig><fig id="fig14"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>4</label><caption><title> Comparison between USA real estate prices and German residence price. Source: Author’s own calculation</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x47.png"/></fig><p>・ TAG Immobilien AG (TEG) is a real estate company based in Germany whoe activities include the acquisition, development as well as the management of residential real-estate. The company focus lies on the German real-estate market, especially on regions such as Hamburg, Berlin, Munich. TAG is a proprietor of approximately 75,000 residential units and realises appreciation potential within its portfolio through active asset management and strategic acquisition of attractive properties. TAG Immobilien stock price reflects the price movement of German real estate market.</p><p>・ Deutsche Wohnen AG, through its subsidiaries acquires, develops and manages residential properties in Germany. Its property portfolio comprises approximately 149,000 residential and commercial units.</p><p>・ As there are no REIT companies in Austria, they are traded on stock exchange, we will take the VOESTALPINE AV company which produces concrete and steel and that is related to housing industry. If more real estates are built, more will be invested and share price will grow. But if the price is stable, as it is in Austria, there will be no big need for additional real estate, so the stock price will be stable.</p><p>For stock, we will take ETF that invest in stocks.</p><p>Firstly, we will take iShares MSCI Germany ETF (EWG). It is a passive ETF that seeks to replicate MSCI Germany index. The index measures the performance of the German equity market.</p><p>The other ETF we will take is iShares MSCI Austria Capped ETF, named EWO. It seeks to track the investment results of a broad-based index composed of Austrian equities.</p><p>EWL is iShares MSCI Switzerland Capped ETF. It is a passive ETF that seeks to replicate MSCI Switzerland Index.</p><p>So the above mentioned assets are taken and inserted into the portfolio optimisation code as inputs.</p><p>At first try portfolio is equally distributed among all assets, only 10% is invested in Austrian VOESTALPINE AV company.</p><p>First case:</p><p>“PSPN” = 0.15, “TEG” = 0.15, “DWNI” = 0.15, “EWG” = 0.15, “EWO” = 0.15, “EWL” = 0.15, “VOE” = 0.10.</p><p><xref ref-type="fig" rid="fig1">Figure 1</xref>5 demonstrates the optimisation of portfolio for weights presented in Case 1.</p><p>Considering the portfolio constructed in this way, it is obvious we are not at the optimal point as risk is too high while return is too low. Now we can try the following combination of investing more in Swiss real estate, less in German and mild amount in Austrian.</p><p><xref ref-type="fig" rid="fig1">Figure 1</xref>6 demonstrates the optimisation of portfolio for weights in the second portfolio.</p><p>For the second portfolio, the situation is better. We already have put more weight in the Swiss real estate investment trusts because we are aware that prices will continue to grow and in order to hedge one part was invested in ETF in Austria. The graph above was obtained. It has higher Sharpe ratio and higher return. It must be noted that return is based on week basis.</p><fig id="fig15"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>5</label><caption><title> Efficient frontier and optimal portfolio for Case 1. Source: Author’s own calculation</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x48.png"/></fig><fig id="fig16"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>6</label><caption><title> Efficient frontier and optimal portfolio―Case 2</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x49.png"/></fig><fig id="fig17"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>7</label><caption><title> Investment in real estate portfolio completely in Swiss real estate</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/10-1530193x50.png"/></fig><p>If the biggest part is invested in Swiss real estate property, the following situation is obtained:</p><p><xref ref-type="fig" rid="fig1">Figure 1</xref>7 demonstrates the optimal portfolio if the investment is completely directed in Swiss real estate.</p><p>The Sharpe ratio is higher as well as return and risk. In order to optimise portfolio, the R code for portfolio optimisation will be given in the appendix, so that the reader of the paper can experiment with the aforementioned portfolio.</p></sec><sec id="s5"><title>5. Conclusions</title><p>After having introduced VAR and SVAR models and index of financial turbulence, the real estate market in Germany, Switzerland and Austria was analysed. By using impulse response function, the possible movement of real estate prices was presented in the aforementioned countries. In order to analyse the movement of real estate prices in connection to stock price movement, correlations have been calculated between real estate prices in Germany, Switzerland and Austria. At the same time, correlations between real estate prices and stock prices in aforementioned countries were calculated. In order to analyse portfolio decisions, possible investment strategies in different assets were proposed. In the end, portfolio optimisation was proposed. Pool of assets that was included comprised REITs and ETFs from Germany, Switzerland and Austria. At the end, R code was given so the reader could mimic the portfolio optimisation construction. The conclusion is that negative correlation between European area stocks and real estate prices in Germany, Switzerland and Austria represents a good hedging opportunity during the financial crisis. As Austria real estate prices are stable, it is possible to hedge by investing in Austrian real estate market and risking part of the portfolio by investing in Swiss real estate market. Possibilities are vast and depending from the risk aversion of the investor; it can be decided how the investment can be conducted.</p><p>The index of financial turbulence demonstrated that financial crisis of 2008 that originated in USA, had a lagging effect on Europe which proved that the banks didn’t learn the lessons from the crisis or the lessons were only partially learnt. New models were proposed that could help capture and predict the future financial crisis. Author of this paper sincerely hopes that proposed models will help banks to construct better models to capture the movement and better monitor the movement of real estate stock market.</p></sec><sec id="s6"><title>Acknowledgements</title><p>I would like to thank my family and colleagues for immense support while writing the paper.</p></sec><sec id="s7"><title>Cite this paper</title><p>OgnjenVukovic, (2015) Analysing and Optimising Bank Real Estate Portfolio by Using Impulse Response Function, Mahalanobis Distance and Financial Turbulence. Open Journal of Business and Management,03,326-344. doi: 10.4236/ojbm.2015.33032</p></sec><sec id="s8"><title>Appendix</title><p>(http://economistatlarge.com/portfolio-theory/r-optimized-portfolio)</p><p>R code for portfolio optimisation</p><p># Economist at Large</p><p># Modern Portfolio Theory</p><p># Use solve.QP to solve for efficient frontier</p><p># This file uses the solve.QP function in the quadprog package to solve for the</p><p># efficient frontier.</p><p># Since the efficient frontier is a parabolic function, we can find the solution</p><p># that minimizes portfolio variance and then vary the risk premium to find</p><p># points along the efficient frontier. Then simply find the portfolio with the</p><p># largest Sharpe ratio (expected return / sd) to identify the most</p><p># efficient portfolio</p><p>install.packages ('stockPortfolio')</p><p>install.packages('ggplot2')</p><p>install.packages('reshape2')</p><p>install.packages('quadprog')</p><p>library(stockPortfolio) # Base package for retrieving returns</p><p>library(ggplot2) # Used to graph efficient frontier</p><p>library(reshape2) # Used to melt the data</p><p>library(quadprog) #Needed for solve.QP</p><p># Create the portfolio using ETFs, incl. hypothetical non-efficient allocation</p><p>stocks &lt;- c(</p><p>&quot;PSPN&quot; = 1,</p><p>&quot;TEG&quot; = 0,</p><p>&quot;DWNI&quot; =0,</p><p>&quot;EWG&quot; = 0,</p><p>&quot;EWO&quot; = 0,</p><p>&quot;EWL&quot; = 0,</p><p>&quot;VOE&quot; =0</p><p>)</p><p># Retrieve returns, from earliest start date possible (where all stocks have</p><p>returns &lt;- getReturns(names(stocks[-1]), freq=&quot;week&quot;) #Currently, drop index</p><p>#### Efficient Frontier function ####</p><p>eff.frontier &lt;- function (returns, short=&quot;no&quot;, max.allocation=NULL,</p><p>risk.premium.up=.5, risk.increment=.005){</p><p># return argument should be a m x n matrix with one column per security</p><p># short argument is whether short-selling is allowed; default is no (short</p><p># selling prohibited)max.allocation is the maximum % allowed for any one</p><p># security (reduces concentration) risk.premium.up is the upper limit of the</p><p># risk premium modeled (see for loop below) and risk.increment is the</p><p># increment (by) value used in the for loop</p><p>covariance &lt;- cov(returns)</p><p>print(covariance)</p><p>n &lt;- ncol(covariance)</p><p># Create initial Amat and bvec assuming only equality constraint</p><p># (short-selling is allowed, no allocation constraints)</p><p>Amat &lt;- matrix (1, nrow=n)</p><p>bvec &lt;- 1</p><p>meq &lt;- 1</p><p># Then modify the Amat and bvec if short-selling is prohibited</p><p>if(short==&quot;no&quot;){</p><p>Amat &lt;- cbind(1, diag(n))</p><p>bvec &lt;- c(bvec, rep(0, n))</p><p>}</p><p># And modify Amat and bvec if a max allocation (concentration) is specified</p><p>if(!is.null(max.allocation)){</p><p>if(max.allocation &gt; 1 | max.allocation &lt;0){</p><p>stop(&quot;max.allocation must be greater than 0 and less than 1&quot;)</p><p>}</p><p>if(max.allocation * n &lt; 1){</p><p>stop(&quot;Need to set max.allocation higher; not enough assets to add to 1&quot;)</p><p>}</p><p>Amat &lt;- cbind(Amat, -diag(n))</p><p>bvec &lt;- c(bvec, rep(-max.allocation, n))</p><p>}</p><p># Calculate the number of loops</p><p>loops &lt;- risk.premium.up / risk.increment + 1</p><p>loop &lt;- 1</p><p># Initialize a matrix to contain allocation and statistics</p><p># This is not necessary, but speeds up processing and uses less memory</p><p>eff &lt;- matrix(nrow=loops, ncol=n+3)</p><p># Now I need to give the matrix column names</p><p>colnames(eff) &lt;- c(colnames(returns), &quot;Std.Dev&quot;, &quot;Exp.Return&quot;, &quot;sharpe&quot;)</p><p># Loop through the quadratic program solver</p><p>for (i in seq(from=0, to=risk.premium.up, by=risk.increment)){</p><p>dvec &lt;- colMeans(returns) * i # This moves the solution along the EF</p><p>sol &lt;- solve.QP(covariance, dvec=dvec, Amat=Amat, bvec=bvec, meq=meq)</p><p>eff[loop,&quot;Std.Dev&quot;] &lt;- sqrt(sum(sol$solution*colSums((covariance*sol$solution))))</p><p>eff[loop,&quot;Exp.Return&quot;] &lt;- as.numeric(sol$solution %*% colMeans(returns))</p><p>eff[loop,&quot;sharpe&quot;] &lt;- eff[loop,&quot;Exp.Return&quot;] / eff[loop,&quot;Std.Dev&quot;]</p><p>eff[loop,1:n] &lt;- sol$solution</p><p>loop &lt;- loop+1</p><p>}</p><p>return(as.data.frame(eff))</p><p>}</p><p># Run the eff.frontier function based on no short and 50% alloc. restrictions</p><p>eff &lt;- eff.frontier(returns=returns$R, short=&quot;no&quot;, max.allocation=1,</p><p>risk.premium.up=1, risk.increment=.001)</p><p># Find the optimal portfolio</p><p>eff.optimal.point &lt;- eff[eff$sharpe==max(eff$sharpe),]</p><p># graph efficient frontier</p><p># Start with color scheme</p><p>ealred &lt;- &quot;#7D110C&quot;</p><p>ealtan &lt;- &quot;#CDC4B6&quot;</p><p>eallighttan &lt;- &quot;#F7F6F0&quot;</p><p>ealdark &lt;- &quot;#423C30&quot;</p><p>ggplot(eff, aes(x=Std.Dev, y=Exp.Return)) + geom_point(alpha=.1, color=ealdark) +</p><p>geom_point(data=eff.optimal.point, aes(x=Std.Dev, y=Exp.Return, label=sharpe),</p><p>color=ealred, size=5) +</p><p>annotate(geom=&quot;text&quot;, x=eff.optimal.point$Std.Dev,</p><p>y=eff.optimal.point$Exp.Return,</p><p>label=paste(&quot;Risk: &quot;,</p><p>round(eff.optimal.point$Std.Dev*100, digits=3),&quot;\nReturn: &quot;,</p><p>round(eff.optimal.point$Exp.Return*100, digits=4),&quot;%\nSharpe: &quot;,</p><p>round(eff.optimal.point$sharpe*100, digits=2), &quot;%&quot;, sep=&quot;&quot;),</p><p>hjust=0, vjust=1.2) +</p><p>ggtitle(&quot;Efficient Frontier\nand Optimal Portfolio&quot;) +</p><p>labs(x=&quot;Risk (standard deviation of portfolio)&quot;, y=&quot;Return&quot;) +</p><p>theme(panel.background=element_rect(fill=eallighttan),</p><p>text=element_text(color=ealdark),</p><p>plot.title=element_text(size=24, color=ealred))</p><p>ggsave(&quot;Efficient Frontier.png&quot;)</p></sec></body><back><ref-list><title>References</title><ref id="scirp.58336-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Pfaff, B. (2008) VAR, SVAR and SVEC Models: Implementation within R Package vars.</mixed-citation></ref><ref id="scirp.58336-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Hamilton, J.D. (1994) Time Series Analysis. Princeton University Press, Princeton, 293.</mixed-citation></ref><ref id="scirp.58336-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Hamilton, J.D. (1994) Difference Equations. Time Series Analysis. Princeton University Press, Princeton, 5.</mixed-citation></ref><ref id="scirp.58336-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Williams, D. (1991) Probability with Martingales. Cambridge University Press, Cambridge.&lt;br /&gt;  
http://dx.doi.org/10.1017/CBO9780511813658</mixed-citation></ref><ref id="scirp.58336-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Dung, N.T. and Thao, T.H. (2010) An Approximate Approach to Fractional Stochastic Integration and Its Application.</mixed-citation></ref><ref id="scirp.58336-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Howitt, P. and Clower, R. (2000) The Emergence of Economic Organization. Journal of Economic Behavior &amp; Organization, 41, 55-84. http://dx.doi.org/10.1016/S0167-2681(99)00087-6</mixed-citation></ref><ref id="scirp.58336-ref7"><label>7</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Sanderson</surname><given-names> R. </given-names></name>,<etal>et al</etal>. (<year>2013</year>)<article-title>Does Monetary Policy Cause Randomness or Chaos? A Case Study from the European Central Bank. A Case Study from the European Central Bank</article-title><source> Banks and Bank Systems</source><volume> 8</volume>,<fpage> 55</fpage>-<lpage>61</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.58336-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Priestley, M.B. (1981) Spectral Analysis and Time Series. Academic Press, Waltham.</mixed-citation></ref><ref id="scirp.58336-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Lütkepohl, H. (2008) Impulse Response Function. The New Palgrave Dictionary of Economics. 2nd Edition.  
http://dx.doi.org/10.1057/9780230226203.0767</mixed-citation></ref><ref id="scirp.58336-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">St&amp;ouml;ckl, S. and Hanke, M. (2013) Financial Applications of the Mahalanobis Distance.</mixed-citation></ref><ref id="scirp.58336-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Gonalves, C.P. (2012) Financial Turbulence, Business Cycles and Intrinsic Time in an Artificial Economy. Algorithmic Finance, 1, 141-156. http://dx.doi.org/10.2139/ssrn.2002698</mixed-citation></ref><ref id="scirp.58336-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Hacker, R.S. and Hatemi, J.A. (2008) Optimal Lag-Length Choice in Stable and Unstable VAR Models under Situations of Homoscedasticity and ARCH. Journal of Applied Statistics, 35, 601-615. &lt;br /&gt; 
http://dx.doi.org/10.1080/02664760801920473</mixed-citation></ref><ref id="scirp.58336-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Rebonato, R. (N.D.) Theory and Practice of Model Risk Management.</mixed-citation></ref><ref id="scirp.58336-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">St. Louis FED Website. https://www.stlouisfed.org</mixed-citation></ref></ref-list></back></article>