<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stephen J. Barr</title>
	<atom:link href="http://econsteve.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://econsteve.com</link>
	<description></description>
	<lastBuildDate>Mon, 21 May 2012 17:08:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Permanent and Transitory Shocks in Capital Structure</title>
		<link>http://econsteve.com/?p=91</link>
		<comments>http://econsteve.com/?p=91#comments</comments>
		<pubDate>Thu, 15 Mar 2012 07:28:00 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=91</guid>
		<description><![CDATA[NOTE: This page is intentionally heavily focused on the computational aspect of the problem. Quick Introduction One of my U of R projects has been research into dynamic capital structure, meaning how firms mix debt and equity. Firms make decisions about capital structure in the face of uncertainty. One of the sources of uncertainty they [...]]]></description>
			<content:encoded><![CDATA[<p> <i>NOTE: This page is intentionally heavily focused on the computational aspect of the problem.</i> </p>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1">Quick Introduction</h2>
<div class="outline-text-2" id="text-1">
<p>One of my U of R projects has been research into dynamic capital structure, meaning how firms mix debt and equity. Firms make decisions about capital structure in the face of uncertainty. One of the sources of uncertainty they face comes in the form of the return on their investment. Firms transform investment into profits through their use of capital (raw materials, machines, and so forth), and the rate at which investment turns into profitability is called the firm&#8217;s <i>productivity</i> of capital. </p>
<p> For various reasons, the same amount of productivity can produce different amounts of profit in different periods. This can be due to some multiplier to the productivity function, a  <i>productivity shock</i>, which can be either positive or negative, and examples exist for each (e.g. worker strikes, favorable weather, etc). The productivity shock process can be thought of as a process which evolves over time in a somewhat predictable manner.  </p>
<p> In the academic finance literature, the productivity shock process is almost always thought of as a mean reverting process. This means that the process has some fundamental level and although at any given time may differ from that level, the firm expects that the shock will fluctuate around a known mean. My line of research breaks this assumption, and thinks of the firm as receiving a combination of mean-reverting shocks and <i>permanent shocks</i>. The difference between a mean-reverting (also called transitory) shock and a permanent shock has to do with the firm&#8217;s expectation about the future values of the shock. In a permanent shock, there is no expectation of mean reversion.  </p>
<p> There are two main sections to this post. Section <i>A bit more theory and math, and even a model</i> contains a description of the model. Section <i>How to solve</i> talks about the solution and numerical methods used to find this example. Since this forum is not strictly academic, I am freely mixing methods, explanations, and code. I think that this may be useful, as often papers, even one that use complex solution methods, describe the entirety of these methods with a tiny appendix. By describing my solution methods in detail, it  </p>
<ul>
<li>Helps me clarify my understanding </li>
<li>Allows other people to find any errors in my logic or code </li>
<li>Helps others in their own work </li>
</ul></div>
</p></div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2">Some theory</h2>
<div class="outline-text-2" id="text-2">
<p> Capital structure refers to how firms utilize both debt and capital to fund investment. Firms work to maximize the sum of <i>present</i> and <i>expected future value</i> of equity value. They make investments, and can fund them by issuing corporate debt, or issuing equity. The decision to do this is complicated and is influenced by many factors including the current and expected future value of capital.  </p>
<p> Assume that your profit is given by equation <img src='http://s.wordpress.com/latex.php?latex=z%20%2A%20k%5E%5Ctheta&#038;bg=T&#038;fg=000000&#038;s=0' alt='z * k^\theta' title='z * k^\theta' class='latex' /> where <img src='http://s.wordpress.com/latex.php?latex=z&#038;bg=T&#038;fg=000000&#038;s=0' alt='z' title='z' class='latex' /> is productivity, <img src='http://s.wordpress.com/latex.php?latex=k&#038;bg=T&#038;fg=000000&#038;s=0' alt='k' title='k' class='latex' /> is capital stock, and <img src='http://s.wordpress.com/latex.php?latex=%5Ctheta&#038;bg=T&#038;fg=000000&#038;s=0' alt='\theta' title='\theta' class='latex' /> is the curvature of the production function. The general style of these productions are called <a href="http://en.wikipedia.org/wiki/Cobb%E2%80%93Douglas_production_function">Cobb-Douglas production functions</a>. I am interested in the dynamics of <img src='http://s.wordpress.com/latex.php?latex=z&#038;bg=T&#038;fg=000000&#038;s=0' alt='z' title='z' class='latex' />. <img src='http://s.wordpress.com/latex.php?latex=z&#038;bg=T&#038;fg=000000&#038;s=0' alt='z' title='z' class='latex' /> is a stochastic process where at each time <img src='http://s.wordpress.com/latex.php?latex=t&#038;bg=T&#038;fg=000000&#038;s=0' alt='t' title='t' class='latex' /> it takes a value <img src='http://s.wordpress.com/latex.php?latex=z_t&#038;bg=T&#038;fg=000000&#038;s=0' alt='z_t' title='z_t' class='latex' />. <img src='http://s.wordpress.com/latex.php?latex=z_t&#038;bg=T&#038;fg=000000&#038;s=0' alt='z_t' title='z_t' class='latex' /> is typically assumed to follow an autoregressive process of type AR(1). An equation for an AR(1) process <img src='http://s.wordpress.com/latex.php?latex=x_t&#038;bg=T&#038;fg=000000&#038;s=0' alt='x_t' title='x_t' class='latex' /> is: </p>
<p>   <img src='http://s.wordpress.com/latex.php?latex=%20z%5ET_t%20%3D%20%5Crho%20%2B%20z%5ET_%7Bt-1%7D%20%2B%20%5Cepsilon_t%20&#038;bg=T&#038;fg=000000&#038;s=0' alt=' z^T_t = \rho + z^T_{t-1} + \epsilon_t ' title=' z^T_t = \rho + z^T_{t-1} + \epsilon_t ' class='latex' />
<p> where the 1 refers to the 1-period lag on the right side of the equation. <img src='http://s.wordpress.com/latex.php?latex=%5Crho&#038;bg=T&#038;fg=000000&#038;s=0' alt='\rho' title='\rho' class='latex' /> is the autoregressive coefficient. AR(1) processes are by definition mean-reverting, meaning that over time, <img src='http://s.wordpress.com/latex.php?latex=z_t&#038;bg=T&#038;fg=000000&#038;s=0' alt='z_t' title='z_t' class='latex' /> will approach some mean value.  </p>
<p> Firms in reality receive shocks to their productivity from a variety of sources &#8211; changes in legislation, technology, relations with suppliers and labor, etc, and the nature of these shocks differ with regard to their expected permanence or transience. E.g., a new technology may be seen as a permanent shock while a supply chain concern or labor dispute may be more transient in nature. An AR(1) process is by definition transient when the autoregressive parameter is less than one, and thus using this process as part of a model of firm production assumes that all shocks are of the latter type. A permanent shock looks like: </p>
<img src='http://s.wordpress.com/latex.php?latex=%20z%5EP_t%20%3D%20z%5EP_%7Bt-1%7D%20%2B%20%5Cepsilon_t%20&#038;bg=T&#038;fg=000000&#038;s=0' alt=' z^P_t = z^P_{t-1} + \epsilon_t ' title=' z^P_t = z^P_{t-1} + \epsilon_t ' class='latex' /></div>
</p></div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3">How to solve</h2>
<div class="outline-text-2" id="text-3">
<p> After reading or skimming the above section, you may be thinking &#8220;that&#8217;s great. How do I solve it?&#8221;. That is the purpose of this section.  </p>
</p></div>
<div id="outline-container-3-1" class="outline-3">
<h3 id="sec-3-1">Grids</h3>
<div class="outline-text-3" id="text-3-1">
<p>The first step is to stop and think about what &#8220;solving the model&#8221; means in this context. From a perspective of a firm that wants to maximize its equity value, a solution to this model means that for any current state (<img src='http://s.wordpress.com/latex.php?latex=k%2Cp&#038;bg=T&#038;fg=000000&#038;s=0' alt='k,p' title='k,p' class='latex' />) of the firm and any combination of permanent and transitory shocks (<img src='http://s.wordpress.com/latex.php?latex=z_t%20%3D%20%5C%7Bz%5EP_t%2C%20z%5ET_t%5C%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='z_t = \{z^P_t, z^T_t\}' title='z_t = \{z^P_t, z^T_t\}' class='latex' />), the firm understands how to adjust its debt and capital levels such that the response maximizes their current plus expected future equity value. Said succinctly, for any state of the world, what is the value-maximizing choice?  </p>
<p> One way to go about solving these models is to make enumerate the states. Say for example, firm capital stock could take values 5,10, or 15. Lets refer to this as the K-grid (or <img src='http://s.wordpress.com/latex.php?latex=%5Cmathcal%7BK%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\mathcal{K}' title='\mathcal{K}' class='latex' /> in math notation). Similarly, let debt be 2 or 4, the P-grid. To get the possible states, we take the <a href="http://en.wikipedia.org/wiki/Cartesian_product">Cartesian product</a> of the grids. Let <img src='http://s.wordpress.com/latex.php?latex=s_i&#038;bg=T&#038;fg=000000&#038;s=0' alt='s_i' title='s_i' class='latex' /> refer to any element of set <img src='http://s.wordpress.com/latex.php?latex=S&#038;bg=T&#038;fg=000000&#038;s=0' alt='S' title='S' class='latex' />, the Cartesian product. </p>
<table  border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides" width="50">
<caption>Enumerated State Spaces</caption>
<colgroup>
<col class="right" />
<col class="right" />
<col class="right" /> </colgroup>
<thead>
<tr>
<th scope="col" class="right">s#</th>
<th scope="col" class="right">K</th>
<th scope="col" class="right">P</th>
</tr>
</thead>
<tbody>
<tr>
<td class="right">0</td>
<td class="right">5</td>
<td class="right">2</td>
</tr>
<tr>
<td class="right">1</td>
<td class="right">5</td>
<td class="right">4</td>
</tr>
<tr>
<td class="right">2</td>
<td class="right">10</td>
<td class="right">2</td>
</tr>
<tr>
<td class="right">3</td>
<td class="right">10</td>
<td class="right">4</td>
</tr>
<tr>
<td class="right">4</td>
<td class="right">15</td>
<td class="right">2</td>
</tr>
<tr>
<td class="right">5</td>
<td class="right">15</td>
<td class="right">4</td>
</tr>
</tbody>
</table>
<p> Thus, we have 6 states, labeled <img src='http://s.wordpress.com/latex.php?latex=s_0&#038;bg=T&#038;fg=000000&#038;s=0' alt='s_0' title='s_0' class='latex' /> to <img src='http://s.wordpress.com/latex.php?latex=s_5&#038;bg=T&#038;fg=000000&#038;s=0' alt='s_5' title='s_5' class='latex' />. Thinking back to the model, we have quantities suck as debt <img src='http://s.wordpress.com/latex.php?latex=%5Cequiv%20p%27%20-%20%281%2Br%281-%5Ctau_c%29%2Ap%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\equiv p&#039; - (1+r(1-\tau_c)*p)' title='\equiv p&#039; - (1+r(1-\tau_c)*p)' class='latex' /> that depend on both the current and 1-period future (alternatively, previous and current) choices of debt. To evaluate these and all of the other intertemporal equations, it quickly becomes clear that we need to evaluate these choices for every combination of <img src='http://s.wordpress.com/latex.php?latex=k%2Cp%2Ck%27%2Cp%27&#038;bg=T&#038;fg=000000&#038;s=0' alt='k,p,k&#039;,p&#039;' title='k,p,k&#039;,p&#039;' class='latex' />.  </p>
<p> We can do this with 4 different <img src='http://s.wordpress.com/latex.php?latex=6%20%5Ctimes%206&#038;bg=T&#038;fg=000000&#038;s=0' alt='6 \times 6' title='6 \times 6' class='latex' /> matrices. </p>
<p> <b>k</b> </p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup>
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" /> </colgroup>
<thead>
<tr>
<th scope="col" class="right"></th>
<th scope="col" class="right">0</th>
<th scope="col" class="right">1</th>
<th scope="col" class="right">2</th>
<th scope="col" class="right">3</th>
<th scope="col" class="right">4</th>
<th scope="col" class="right">5</th>
</tr>
</thead>
<tbody>
<tr>
<td class="right">0</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">5</td>
</tr>
<tr>
<td class="right">1</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">5</td>
</tr>
<tr>
<td class="right">2</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">10</td>
</tr>
<tr>
<td class="right">3</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">10</td>
</tr>
<tr>
<td class="right">4</td>
<td class="right">15</td>
<td class="right">15</td>
<td class="right">15</td>
<td class="right">15</td>
<td class="right">15</td>
<td class="right">15</td>
</tr>
<tr>
<td class="right">5</td>
<td class="right">15</td>
<td class="right">15</td>
<td class="right">15</td>
<td class="right">15</td>
<td class="right">15</td>
<td class="right">15</td>
</tr>
</tbody>
</table>
<p> <b>k prime</b> </p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup>
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" /> </colgroup>
<thead>
<tr>
<th scope="col" class="right"></th>
<th scope="col" class="right">0</th>
<th scope="col" class="right">1</th>
<th scope="col" class="right">2</th>
<th scope="col" class="right">3</th>
<th scope="col" class="right">4</th>
<th scope="col" class="right">5</th>
</tr>
</thead>
<tbody>
<tr>
<td class="right">0</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">15</td>
<td class="right">15</td>
</tr>
<tr>
<td class="right">1</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">15</td>
<td class="right">15</td>
</tr>
<tr>
<td class="right">2</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">15</td>
<td class="right">15</td>
</tr>
<tr>
<td class="right">3</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">15</td>
<td class="right">15</td>
</tr>
<tr>
<td class="right">4</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">15</td>
<td class="right">15</td>
</tr>
<tr>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">5</td>
<td class="right">10</td>
<td class="right">10</td>
<td class="right">15</td>
<td class="right">15</td>
</tr>
</tbody>
</table>
<p> <b>p</b> </p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup>
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" /> </colgroup>
<thead>
<tr>
<th scope="col" class="right"></th>
<th scope="col" class="right">0</th>
<th scope="col" class="right">1</th>
<th scope="col" class="right">2</th>
<th scope="col" class="right">3</th>
<th scope="col" class="right">4</th>
<th scope="col" class="right">5</th>
</tr>
</thead>
<tbody>
<tr>
<td class="right">0</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
</tr>
<tr>
<td class="right">1</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
</tr>
<tr>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
</tr>
<tr>
<td class="right">3</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
</tr>
<tr>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">2</td>
</tr>
<tr>
<td class="right">5</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
<td class="right">4</td>
</tr>
</tbody>
</table>
<p> <b>p prime</b> </p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup>
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" />
<col class="right" /> </colgroup>
<thead>
<tr>
<th scope="col" class="right"></th>
<th scope="col" class="right">0</th>
<th scope="col" class="right">1</th>
<th scope="col" class="right">2</th>
<th scope="col" class="right">3</th>
<th scope="col" class="right">4</th>
<th scope="col" class="right">5</th>
</tr>
</thead>
<tbody>
<tr>
<td class="right">0</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
</tr>
<tr>
<td class="right">1</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
</tr>
<tr>
<td class="right">2</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
</tr>
<tr>
<td class="right">3</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
</tr>
<tr>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
</tr>
<tr>
<td class="right">5</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
<td class="right">2</td>
<td class="right">4</td>
</tr>
</tbody>
</table>
<p> Let <img src='http://s.wordpress.com/latex.php?latex=i&#038;bg=T&#038;fg=000000&#038;s=0' alt='i' title='i' class='latex' /> index time the rows and <img src='http://s.wordpress.com/latex.php?latex=j&#038;bg=T&#038;fg=000000&#038;s=0' alt='j' title='j' class='latex' /> index the columns of these matrices. Then, each <img src='http://s.wordpress.com/latex.php?latex=%28i%2Cj%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='(i,j)' title='(i,j)' class='latex' /> combination refers to the idea of being in state <img src='http://s.wordpress.com/latex.php?latex=i&#038;bg=T&#038;fg=000000&#038;s=0' alt='i' title='i' class='latex' /> and choosing state <img src='http://s.wordpress.com/latex.php?latex=j&#038;bg=T&#038;fg=000000&#038;s=0' alt='j' title='j' class='latex' />. And, to get a function of these variables, we can do this in C++: </p>
<pre class="src src-c++"><span style="color: #b58900;">int</span> <span style="color: #268bd2;">Nstates</span> = 6;
<span style="color: #859900;">for</span>(<span style="color: #b58900;">int</span> <span style="color: #268bd2;">i</span> = 0; i &lt; Nstates; i++) {
  <span style="color: #859900;">for</span>(<span style="color: #b58900;">int</span> <span style="color: #268bd2;">j</span> = 0; j &lt; Nstates; j++) {
    value[i][j] = some_function(k[i][j], k_prime[i][j], p[i][j], p_prime[i][j]);
  }
}
</pre>
<p> My grid for <img src='http://s.wordpress.com/latex.php?latex=k&#038;bg=T&#038;fg=000000&#038;s=0' alt='k' title='k' class='latex' />, denoted <img src='http://s.wordpress.com/latex.php?latex=%5Cmathcal%7BK%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\mathcal{K}' title='\mathcal{K}' class='latex' />, has 71 points, whereas my grid for <img src='http://s.wordpress.com/latex.php?latex=p&#038;bg=T&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' /> has 29 points. Thus, there are 71*29 = 2059 combinations of current <img src='http://s.wordpress.com/latex.php?latex=k&#038;bg=T&#038;fg=000000&#038;s=0' alt='k' title='k' class='latex' /> and current <img src='http://s.wordpress.com/latex.php?latex=p&#038;bg=T&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' />, and an equal amount of future <img src='http://s.wordpress.com/latex.php?latex=k&#038;bg=T&#038;fg=000000&#038;s=0' alt='k' title='k' class='latex' /> and future <img src='http://s.wordpress.com/latex.php?latex=p&#038;bg=T&#038;fg=000000&#038;s=0' alt='p' title='p' class='latex' />. Thus, a <img src='http://s.wordpress.com/latex.php?latex=2059%20%5Ctimes%202059&#038;bg=T&#038;fg=000000&#038;s=0' alt='2059 \times 2059' title='2059 \times 2059' class='latex' /> matrix can describe the combinations of current and futures states. However, a firm must also consider the shock. I am using a grid of <img src='http://s.wordpress.com/latex.php?latex=19&#038;bg=T&#038;fg=000000&#038;s=0' alt='19' title='19' class='latex' /> points for my transient shock and <img src='http://s.wordpress.com/latex.php?latex=17&#038;bg=T&#038;fg=000000&#038;s=0' alt='17' title='17' class='latex' /> points for permanent shock. For each <img src='http://s.wordpress.com/latex.php?latex=2059%20%5Ctimes%202059&#038;bg=T&#038;fg=000000&#038;s=0' alt='2059 \times 2059' title='2059 \times 2059' class='latex' /> matrix, I need to evaluate the Bellman equation for <img src='http://s.wordpress.com/latex.php?latex=19%20%5Ctimes%2017%20%3D%20323&#038;bg=T&#038;fg=000000&#038;s=0' alt='19 \times 17 = 323' title='19 \times 17 = 323' class='latex' /> shocks. This leads to a <img src='http://s.wordpress.com/latex.php?latex=665057%20%5Ctimes%202059&#038;bg=T&#038;fg=000000&#038;s=0' alt='665057 \times 2059' title='665057 \times 2059' class='latex' /> over which I must iterate to get the solution to my model. </p>
</p></div>
</p></div>
<div id="outline-container-3-2" class="outline-3">
<h3 id="sec-3-2">Solving the Model</h3>
<div class="outline-text-3" id="text-3-2">
<p>Before getting into the mechanics of solving the model, it is important to clarify what the solution looks like. The question I am trying to answer is <i>How will the firm adjust its debt and capital levels in the face of uncertainty in the productivity shock?</i> The answer to this question is a <b>policy function</b> which, for any combination of the state of the firm and possible shock gives the optimal response. </p>
<p> Lets define some terminology.  </p>
<ul>
<li>control variables / control states: variables that firm can control, in this case debt and capital. Call this state <img src='http://s.wordpress.com/latex.php?latex=%20%5Cmathcal%7BS%7D%20%3D%20%5Cmathcal%7BP%7D%20%5Ctimes%20%5Cmathcal%7BK%7D%20%20&#038;bg=T&#038;fg=000000&#038;s=0' alt=' \mathcal{S} = \mathcal{P} \times \mathcal{K}  ' title=' \mathcal{S} = \mathcal{P} \times \mathcal{K}  ' class='latex' /> where <img src='http://s.wordpress.com/latex.php?latex=%5Cmathcal%7BP%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\mathcal{P}' title='\mathcal{P}' class='latex' /> has <img src='http://s.wordpress.com/latex.php?latex=M&#038;bg=T&#038;fg=000000&#038;s=0' alt='M' title='M' class='latex' /> elements and <img src='http://s.wordpress.com/latex.php?latex=%5Cmathcal%7BK%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\mathcal{K}' title='\mathcal{K}' class='latex' /> has <img src='http://s.wordpress.com/latex.php?latex=N&#038;bg=T&#038;fg=000000&#038;s=0' alt='N' title='N' class='latex' /> elements, and <img src='http://s.wordpress.com/latex.php?latex=%5Ctimes&#038;bg=T&#038;fg=000000&#038;s=0' alt='\times' title='\times' class='latex' /> is the Cartesian product operator, yielding every possible combination of the set elements.. </li>
<li>shock states: exogenous shocks to the system. In this case the permanent and transitory shocks. Let <img src='http://s.wordpress.com/latex.php?latex=%20z%5ET%20%5Cin%20%5Cmathcal%7BZ%7D%5ET&#038;bg=T&#038;fg=000000&#038;s=0' alt=' z^T \in \mathcal{Z}^T' title=' z^T \in \mathcal{Z}^T' class='latex' /> denote a transitory shock and <img src='http://s.wordpress.com/latex.php?latex=%20z%5EP%20%5Cin%20%5Cmathcal%7BZ%7D%5EP&#038;bg=T&#038;fg=000000&#038;s=0' alt=' z^P \in \mathcal{Z}^P' title=' z^P \in \mathcal{Z}^P' class='latex' /> denote a permanent shock. The entire state space is then <img src='http://s.wordpress.com/latex.php?latex=%5Cmathcal%7BZ%7D%20%5Cequiv%20%5Cmathcal%7BZ%7D%5ET%20%5Ctimes%20%5Cmathcal%7BZ%7D%5EP&#038;bg=T&#038;fg=000000&#038;s=0' alt='\mathcal{Z} \equiv \mathcal{Z}^T \times \mathcal{Z}^P' title='\mathcal{Z} \equiv \mathcal{Z}^T \times \mathcal{Z}^P' class='latex' /> </li>
<li>policy function: a mapping between all control states, shock states, and decisions the firm can make. In math notation, <img src='http://s.wordpress.com/latex.php?latex=%20F%3A%20%5C%7B%20%5Cmathcal%7BS%7D%20%5Ctimes%20%5Cmathcal%7BZ%7D%20%5C%7D%20%5Crightarrow%20%5Cmathcal%7BS%7D%20&#038;bg=T&#038;fg=000000&#038;s=0' alt=' F: \{ \mathcal{S} \times \mathcal{Z} \} \rightarrow \mathcal{S} ' title=' F: \{ \mathcal{S} \times \mathcal{Z} \} \rightarrow \mathcal{S} ' class='latex' /> </li>
<li>value function: a mapping similar to the policy function, but rather than saying the optimal choice of <img src='http://s.wordpress.com/latex.php?latex=k%27%2C%20p%27&#038;bg=T&#038;fg=000000&#038;s=0' alt='k&#039;, p&#039;' title='k&#039;, p&#039;' class='latex' />, it says the expected value of making that optimal choice </li>
</ul>
<p> Value function iteration uses the <a href="http://en.wikipedia.org/wiki/Banach_fixed_point_theorem">contraction mapping theorem</a> to find the value function. The algorithm works by starting with an initial guess (which can be simply random), iteratively improving the guess to find a <a href="http://en.wikipedia.org/wiki/Fixed_point_%28mathematics%29">fixed point</a>, which under certain conditions is guaranteed to exist. The &#8220;contraction&#8221; part of contraction mapping means that every iteration leads closer to the fixed point. See <a href="http://johnstachurski.net/lectures/finite_growth.html">HERE</a> for a quick explanation, or <a href="http://www.amazon.com/Dynamic-Programming-Optimal-Control-Vol/dp/1886529086/ref=sr_1_1?ie=UTF8&amp;qid=1332225419&amp;sr=8-1">these books</a> for a long one. </p>
</p></div>
</p></div>
<div id="outline-container-3-3" class="outline-3">
<h3 id="sec-3-3">Estimating the Model</h3>
<div class="outline-text-3" id="text-3-3">
<p>After being able to solve the model for one set of parameters, an interesting question could be &#8220;What is the set of parameters that leads to simulated firms which behave closest to the actual firms?&#8221;. This general way of thinking is called &#8220;indirect inference&#8221; because the parameters are inferred indirectly through simulations based on a certain parameterization of the model. One particular technique for doing this is called simulated method of moments (SMM). The details of this are the subject of a future blog post. </p>
</p></div>
</p></div>
</p></div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4">Appendix: Software and Hardware</h2>
<div class="outline-text-2" id="text-4">   </div>
<div id="outline-container-4-1" class="outline-3">
<h3 id="sec-4-1">My software and hardware environment:</h3>
<div class="outline-text-3" id="text-4-1">
<ul>
<li>My solver is written in highly optimized C++ code. </li>
<li>Intel&#8217;s Math Kernel Library, which is optimized for Intel CPUs. </li>
<li>Compiler: Intel icpc version 12.1.3 20120212 </li>
<li>Amazon&#8217;s cc2.8xlarge instance types. These feature the new Intel Sandy Bridge-EP Xeon processors with the Intel Advanced Vector Extensions, which allow computations on 256-bit wide registers (meaning matrix math SCREAMS on these boxes) </li>
<li>For manipulating matrices, I use <a href="http://eigen.tuxfamily.org/dox-devel/index.html">Eigen</a>, a C++ templating library for matrix multiplication. I am using a <a href="http://eigen.tuxfamily.org/dox-devel/TopicUsingIntelMKL.html">new version of Eigen which links against MKL</a> </li>
</ul></div>
</p></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=91</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>csvfix is cool</title>
		<link>http://econsteve.com/?p=76</link>
		<comments>http://econsteve.com/?p=76#comments</comments>
		<pubDate>Thu, 05 Jan 2012 05:00:00 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=76</guid>
		<description><![CDATA[I have been manipulating some data files in comma separated value format. I have been finding the tool, csvfix to be extremely cool. For example, I have recently been working with some COMPUSTAT data. The data files are a few hundred megabytes and have several hundred columns, and hundreds of thousands of rows. I wanted [...]]]></description>
			<content:encoded><![CDATA[<p>I have been manipulating some data files in comma separated value format. I have been finding the tool, <code>csvfix</code> to be extremely cool.  </p>
<p> For example, I have recently been working with some <a href="http://www.compustat.com/compustat_data/">COMPUSTAT</a> data. The data files are a few hundred megabytes and have several hundred columns, and hundreds of thousands of rows. I wanted all the rows, but only 30 or 40 of the columns, so I had subsetted the large files into much smaller ones. However, I forgot to get the <a href="http://www.census.gov/epcd/www/sic.html">SIC codes</a>. So, rather than open all the files again, I used <a href="http://code.google.com/p/csvfix/downloads/list">csvfix</a>. </p>
<pre class="src src-sh">csvfix order -fn cusip,SIC *.csv | csvfix unique -o quarterly_cusip_SIC.csv
</pre>
<p>  The first command grabbed the <code>cusip</code> and <code>SIC</code> columns from all the <code>.csv</code> files in the current directory. The output of this is <a href="http://en.wikipedia.org/wiki/Pipeline_%28Unix%29">redirected</a> to the second command which takes the incoming csv data, separates out just the unique rows, then outputs them to the file <code>quarterly_cusip_SIC.csv</code>.  </p>
<p> <code>csvfix</code> seems to be able to do much more than this. The <a href="http://csvfix.byethost5.com/csvfix12/csvfix.html">manual</a> looks pretty good &#8211; <a href="http://en.wikipedia.org/wiki/RTFM">RTFM</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=76</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leverage Ratio&#8217;s, Part 1</title>
		<link>http://econsteve.com/?p=61</link>
		<comments>http://econsteve.com/?p=61#comments</comments>
		<pubDate>Thu, 15 Dec 2011 08:00:00 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=61</guid>
		<description><![CDATA[Using R, it is really easy to make a nice plot of leverage ratios. Using a `data.table` with Compustat annual fundamentals data, you can do the following calculation: btdt &#60;- transform(btdt, debt = DLTT + DLC) btdt &#60;- transform(btdt, book_assets = AT) btdt &#60;- addVars(btdt, isAnnual = TRUE) btdt &#60;- transform(btdt, bl2 = debt/book_assets) Then, [...]]]></description>
			<content:encoded><![CDATA[<p>Using R, it is really easy to make a nice plot of leverage ratios. Using a `data.table` with Compustat annual fundamentals data, you can do the following calculation: </p>
<pre class="src src-R">btdt <span style="color: #A6E22A;">&lt;-</span> transform(btdt, debt =  DLTT + DLC)
btdt <span style="color: #A6E22A;">&lt;-</span> transform(btdt, book_assets = AT)
btdt <span style="color: #A6E22A;">&lt;-</span> addVars(btdt, isAnnual = <span style="color: #89BDFF; text-decoration: underline;">TRUE</span>)
btdt <span style="color: #A6E22A;">&lt;-</span> transform(btdt, bl2 = debt/book_assets)
</pre>
<p> Then, you can plot it with `ggplot2`, like this: </p>
<pre class="src src-R">x <span style="color: #A6E22A;">&lt;-</span> ggplot(data=firm.dt, aes(x=date, y=bl2)) + geom_line() + theme_bw()
x <span style="color: #A6E22A;">&lt;-</span> x + opts(title =  paste(firmname, <span style="color: #DFD874;">"Leverage"</span>))
x <span style="color: #A6E22A;">&lt;-</span> x + ylab(<span style="color: #DFD874;">"Debt / Total Assets"</span>)
print(x)
fname <span style="color: #A6E22A;">&lt;-</span> paste(<span style="color: #DFD874;">"plots/"</span>, firm, <span style="color: #DFD874;">"_bookleverage.png"</span>, sep=<span style="color: #DFD874;">""</span>)
ggsave(filename=fname, plot = x, dpi=600)
</pre>
<p> This is the result: </p>
<p> <img src="http://econsteve.com/wp-content/uploads/2011/12/wpid-CVX_bookleverage.png"  alt="http://econsteve.com/wp-content/uploads/2011/12/wpid-CVX_bookleverage.png" width=600/> </p>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=61</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leverage Ratio&#8217;s, Part 2</title>
		<link>http://econsteve.com/?p=81</link>
		<comments>http://econsteve.com/?p=81#comments</comments>
		<pubDate>Thu, 15 Dec 2011 05:00:00 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[corporate finance]]></category>
		<category><![CDATA[data.tables]]></category>
		<category><![CDATA[ggplot2]]></category>
		<category><![CDATA[leverage]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=81</guid>
		<description><![CDATA[I have been doing quite a bit of research into firm leverage ratios. Therefore, I spent the last few days looking at corporate leverage among a variety of dimensions. The data is entirely from the Compustat database. Along what dimension? A very simple first question to ask is, along what dimension am I looking at [...]]]></description>
			<content:encoded><![CDATA[<p>I have been doing quite a bit of research into firm leverage ratios. Therefore, I spent the last few days looking at corporate leverage among a variety of dimensions. The data is entirely from the Compustat database.</p>
<div id="outline-container-1" class="outline-3">
<h3 id="sec-1">Along what dimension?</h3>
<div id="text-1" class="outline-text-3">
<p>A very simple first question to ask is, <em>along what dimension am I looking at leverage</em>?</p>
<p>There are actually quite a few possibilities:</p>
<ol>
<li><strong>Take the average, pooled over all firms and time periods.</strong> However, it seems that there is more to say about the entire data set of corporate leverage ratios than can be expressed by one number.</li>
<li><strong>At every distinct point in time, pool all firms.</strong> This would create a 1-dimensional time series. This is doing a little better.</li>
<li><strong>For every period, compute means by industry</strong>. This creates a panel. However, doing this naievely creates a few problems (see the next section for help). At any given time, some firms enter the sample and some firms are leaving the sample. One way to mitigate this is take a slice of the data set known as a <em>balanced panel</em>, where the firms are chosen such that they exist for the entire window of time of interest. <strong>But</strong>, this introduces <em>survivorship bias</em>, because the sample is biased towards firms which endure all the economic woes of throughout the timeframe and do not leave the sample.</li>
<li><strong>Look at leverage by leverage decile, year by year</strong>. This is an interesting way to see what the bottom, top, and middle leverage levels are doing. It is important to realize that this does not necessarily capture what the firms at each level are doing. This is because firms are free to change their leverage and thus their relative usage of leverage may change over time.</li>
<li>As a response to #4, <strong>At time period 1, sort leverage by decile and see which firms are in each decile. Then track these firms over time.</strong> This can be very interesting, taking caution that picking different starting time periods will most definitely change the groupings of firms.</li>
</ol>
<p>There are plenty more.</p>
</div>
</div>
<div id="outline-container-2" class="outline-3">
<h3 id="sec-2">Show me some results</h3>
<div id="text-2" class="outline-text-3"></div>
<div id="outline-container-2-1" class="outline-4">
<h4 id="sec-2-1">A plot showing the subsetting as described in #5</h4>
<div id="text-2-1" class="outline-text-4">
<p><img src="http://econsteve.com/wp-content/uploads/2012/01/wpid-firm_booklev_decile_initial_sort.png" alt="http://econsteve.com/wp-content/uploads/2012/01/wpid-firm_booklev_decile_initial_sort.png" width="500" /></p>
<p>Looking at this plot, we see some interesting behaviour. The firms that were at an extremely high leverage ratio (book leverage &gt; 0.6) they tended to delever to some extent, but still settled at a relatively high average when viewed as a group, where it seems like it took about 8 years to stabilize. Firms with relatively low leverage ratios seemed to, as a group, have very stable leverage ratios.</p>
</div>
</div>
<div id="outline-container-2-2" class="outline-4">
<h4 id="sec-2-2">A plot showing the subsetting over time by industry</h4>
<div id="text-2-2" class="outline-text-4">
<p><img src="http://econsteve.com/wp-content/uploads/2012/01/wpid-leverage_time_series_by_industry.png" alt="http://econsteve.com/wp-content/uploads/2012/01/wpid-leverage_time_series_by_industry.png" width="500" /></p>
<p>This plot is a bit harder to read. Construction and retail seem to have delevered, where mining seems to have increased in leverage. Definitely more investigation is needed.</p>
</div>
</div>
</div>
<div id="outline-container-3" class="outline-3">
<h3 id="sec-3">Code</h3>
<div id="text-3" class="outline-text-3">
<p>I wrote some code to detect the largest balanced panels in the Compustat database. That code is coming tomorrow. I picked a balanced panel that started in the mid 1980&#8242;s for this analysis. I used the <a href="https://r-forge.r-project.org/projects/datatable/"><code>data.table</code></a> package to hold the data, as it allows for keyed data tables that allow extremely fast, in-place subsetting.</p>
<p>For the first plot, the code was as follows.</p>
<p>Subset the data to get just the first time period. Using <code>cut2</code> from <code>Hmisc</code> library, divide into deciles and label them A..J.</p>
<pre class="src src-R">min.date = min(dt.t$date);
dt.tmin = subset(dt.t, date == min.date);
dt.tmin$initialDEC = with(dt.tmin, cut2(book_lev, g=10), labels=1:10);
dt.tmin$initialDEC = factor(dt.tmin$initialDEC, labels = LETTERS[1:10]);</pre>
<p><code>initialDEC</code> is a factor representing the initial decile. The merge does exactly what you think it should, meaning add a column called <code>initialDEC</code> to the the original data set, <code>dt.t</code>, merging on the column <code>cusip</code>.</p>
<pre class="src src-R"><span style="color: #ffb300; font-style: italic;">## </span><span style="color: #ffb300; font-style: italic;">prepare to merge</span>
setkey(dt.tmin, cusip);
setkey(dt.t, cusip);

<span style="color: #ffb300; font-style: italic;">## </span><span style="color: #ffb300; font-style: italic;">do the merge</span>
dt.t = dt.t[dt.tmin]</pre>
<p>Create a factor called <code>timedec</code>, which is the interaction of the initial decile (<code>initialDEC</code>) and each time period. There should be <code>10 * (max(dt.t$year) - min(dt.t$year) + 1)</code> distinct values of this factor. Then, set this as they key, and take the means according to this group.</p>
<pre class="src src-R">dt.t$timedec = paste(dt.t$date, <span style="color: #dfd874;">"--"</span>, dt.t$initialDEC, sep=<span style="color: #dfd874;">""</span>)
setkey(dt.t, timedec)
td.means = dt.t[,list(tdmean=mean(book_lev)), by=timedec]</pre>
<p>This unwraps the data. <code>td.means</code> becomes a nice little <code>data.table</code> with <code>10 * (max(dt.t$year) - min(dt.t$year) + 1)</code> rows.</p>
<pre class="src src-R">timedate =  strsplit(as.vector(td.means$timedec), <span style="color: #dfd874;">"--"</span>)
tddf = as.data.frame(matrix(unlist(timedate), ncol=2, byrow=<span style="color: #89bdff; text-decoration: underline;">TRUE</span>))
colnames(tddf) = c(<span style="color: #dfd874;">"DATE"</span>, <span style="color: #dfd874;">"iDEC"</span>);
td.means$date = tddf$DATE;
td.means$iDEC = tddf$iDEC;
td.means$year = extractyear(td.means$date)</pre>
<p>Then, use <code>ggplot2</code> to do the plotting:</p>
<pre class="src src-R">p = ggplot(td.means, aes(x=year, y=tdmean, group=iDEC))
p = p + geom_line(aes(colour=iDEC))
p = p + opts(title = expression(<span style="color: #dfd874;">"Firm leverage at t=0 decile sort"</span>))
p = p + scale_y_continuous(<span style="color: #dfd874;">'Book leverage'</span>)
print(p)</pre>
</div>
</div>
<div id="outline-container-4" class="outline-3">
<h3 id="sec-4">Coming next</h3>
<div id="text-4" class="outline-text-3">
<p>How to use R (and lots of cores) to find all possible balanced panels in a ragged data set.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=81</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ess-remote, so useful!</title>
		<link>http://econsteve.com/?p=54</link>
		<comments>http://econsteve.com/?p=54#comments</comments>
		<pubDate>Thu, 08 Dec 2011 23:56:41 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ec2 emacs ess R]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=54</guid>
		<description><![CDATA[An extremely useful command Emacs command for ESS (Emacs Speaks Statistics) is ess-remote. Quoting the documentation: Execute this command from within a buffer running a process. It runs `ess-add-ess-process&#8217; to add the process to `ess-process-name-alist&#8217; and to make it the `ess-current-process-name&#8217;. It then prompts the user for an ESS language and sets the editing characteristics [...]]]></description>
			<content:encoded><![CDATA[<p>An extremely useful command Emacs command for ESS (Emacs Speaks Statistics) is ess-remote.</p>
<p>Quoting the documentation:</p>
<p>Execute this command from within a buffer running a process.  It runs `ess-add-ess-process&#8217; to add the process to `ess-process-name-alist&#8217; and to make it the `ess-current-process-name&#8217;.  It then prompts the user for an ESS language and sets the editing characteristics appropriately.</p>
<p>Today I am loading some data files that are too large for my laptop to handle. So,<br />
* I instantiated a large instance on EC2<br />
* Started a shell within emacs using `M-x shell`<br />
* Used ssh to connect to my EC2 instance<br />
* In Emacs, split the screen so one half is looking at my .R file and the other is looking at ssh session<br />
* On the ssh session, start R<br />
* THEN, run ess-remote with `M-x ess-remote`. </p>
<p>Once you have done this, you can evaluate lines or regions of text from your local .R script, but have the execution all take place on the EC2 machine.</p>
<p><a href="http://econsteve.com/wp-content/uploads/2011/12/ess_simple.png"><img src="http://econsteve.com/wp-content/uploads/2011/12/ess_simple-300x292.png" alt="" title="ess_simple" width="300" height="292" class="alignnone size-medium wp-image-59" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=54</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eurozone Crisis Links</title>
		<link>http://econsteve.com/?p=49</link>
		<comments>http://econsteve.com/?p=49#comments</comments>
		<pubDate>Fri, 02 Dec 2011 07:56:15 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eurozone debtcrisis]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=49</guid>
		<description><![CDATA[This article: * http://www.marketwatch.com/story/imf-rescue-of-italy-will-spark-global-uprising-2011-11-30?Link=obinsite &#8220;But whatever it is called, it is not going to work. Why not? Because it puts too much financial strain on the rest of the world. Indeed, if the IMF goes ahead with the plan, it might well finish itself off as a serious custodian of the world’s financial stability.&#8221; * [...]]]></description>
			<content:encoded><![CDATA[<p>This article:</p>
<p>* <a href="http://www.marketwatch.com/story/imf-rescue-of-italy-will-spark-global-uprising-2011-11-30?Link=obinsite">http://www.marketwatch.com/story/imf-rescue-of-italy-will-spark-global-uprising-2011-11-30?Link=obinsite</a> &#8220;But whatever it is called, it is not going to work. Why not? Because it puts too much financial strain on the rest of the world. Indeed, if the IMF goes ahead with the plan, it might well finish itself off as a serious custodian of the world’s financial stability.&#8221;<br />
* <a href="http://www.npr.org/templates/story/story.php?storyId=143015809">http://www.npr.org/templates/story/story.php?storyId=143015809</a></p>
<p>Both are good articles. I believe I heard the NPR one while running an errand this evening. </p>
<p>My personal opinion: I am glad that Angela Merkel is not backing the idea of a Eurobond. It seems clear that that scenario would eventually degernate into a borrowing contest. This would be much the same situation as a group of people agreeing beforehand to evenly split a restaurant bill before everyone orders their dinner. In both cases, social pressures aside, it is to the advantage of each party to rack up an above average bill. And, everyone can&#8217;t be above average at the same time.</p>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=49</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Dynamic Program Solver</title>
		<link>http://econsteve.com/?p=50</link>
		<comments>http://econsteve.com/?p=50#comments</comments>
		<pubDate>Sat, 24 Sep 2011 23:23:07 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=50</guid>
		<description><![CDATA[My dynamic program solver is available on my bitbucket repository here. The code should self-documented. More official documentation coming soon.]]></description>
			<content:encoded><![CDATA[<p>My dynamic program solver is available on my bitbucket repository <a href="https://bitbucket.org/stevejb/dpsolve/src">here</a>. The code should self-documented. More official documentation coming soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=50</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing your bibtex</title>
		<link>http://econsteve.com/?p=44</link>
		<comments>http://econsteve.com/?p=44#comments</comments>
		<pubDate>Mon, 25 Apr 2011 04:42:47 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=44</guid>
		<description><![CDATA[I am working on reviewing a somewhat large body of literature in preparation for a big paper. And, in the process, I decided to make sure to more properly manage my bibtex database. If you are working in LaTeX and don&#8217;t know what bibtex is, google and find out. It is the way to manage [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on reviewing a somewhat large body of literature in preparation for a big paper. And, in the process, I decided to make sure to more properly manage my bibtex database. If you are working in LaTeX and don&#8217;t know what bibtex is, google and find out. It is the way to manage references for LaTeX papers.</p>
<p>The tool I am currently using for this is <a href="http://jabref.sourceforge.net/">http://jabref.sourceforge.net/</a>. It seems to be doing what I want it to do.</p>
<p>Important shortcut keys</p>
<ul>
<li>C-n new entry</li>
<li>C-g clean up pasted in bibtex</li>
</ul>
<p>My workflow then is typically, find paper. Most cites that host papers export BibTex. Get that. C-[TAB] to JabRef, and paste in the BibTex. Then C-g to clean up and automatically set the key name.</p>
<p>Also, if you download a PDF paper, you can drag it into JabRef and it makes the creation of an entry fairly easy. There is plenty more that JabRef does, but so far I have found it useful</p>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=44</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rich States, Poor States</title>
		<link>http://econsteve.com/?p=42</link>
		<comments>http://econsteve.com/?p=42#comments</comments>
		<pubDate>Sat, 23 Apr 2011 20:20:41 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=42</guid>
		<description><![CDATA[http://www.alec.org/am/pdf/tax/09RSPS/26969_REPORT_full.pdf Mentioned in this article: http://online.wsj.com/article/SB10001424052748704570704576275051374356340.html?mod=googlenews_wsj about why CA is losing businesses. The WSJ article was interesting.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.alec.org/am/pdf/tax/09RSPS/26969_REPORT_full.pdf">http://www.alec.org/am/pdf/tax/09RSPS/26969_REPORT_full.pdf</a></p>
<p>Mentioned in this article:</p>
<p><a href="http://online.wsj.com/article/SB10001424052748704570704576275051374356340.html?mod=googlenews_wsj">http://online.wsj.com/article/SB10001424052748704570704576275051374356340.html?mod=googlenews_wsj</a></p>
<p>about why CA is losing businesses. The WSJ article was interesting.</p>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=42</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallel Computing for Econometricians with Amazon Web Services</title>
		<link>http://econsteve.com/?p=34</link>
		<comments>http://econsteve.com/?p=34#comments</comments>
		<pubDate>Thu, 31 Mar 2011 04:26:24 +0000</pubDate>
		<dc:creator>stevejb</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://econsteve.com/?p=34</guid>
		<description><![CDATA[This past quarter, I had two fantastic class. One was corporate finance with Toni Whited. The other was advanced econometrics with Sanjog Misra. In both classes, I heavily used EC2. The first one I would like to document is a presentation I made for Sanjog&#8217;s class. The title of the presentation was &#8220;Parallel Computing for [...]]]></description>
			<content:encoded><![CDATA[<p>This past quarter, I had two fantastic class. One was corporate finance with Toni Whited. The other was advanced econometrics with Sanjog Misra. In both classes, I heavily used EC2. The first one I would like to document is a presentation I made for Sanjog&#8217;s class. The title of the presentation was <a title="my preso" href="http://econsteve.com/r/barr-parallelPresoFeb2011.pdf" target="_blank">&#8220;Parallel Computing for Econometricians with Amazon Web Services&#8221;, available in PDF</a>.</p>
<p>I really enjoyed the opening:</p>
<p><a href="http://econsteve.com/wp-content/uploads/2011/03/s1.png"><img class="alignnone size-full wp-image-37" title="s1" src="http://econsteve.com/wp-content/uploads/2011/03/s1.png" alt="" width="484" height="700" /></a></p>
<p><a href="http://econsteve.com/wp-content/uploads/2011/03/s2.png"><img class="alignnone size-full wp-image-38" title="s2" src="http://econsteve.com/wp-content/uploads/2011/03/s2.png" alt="" width="480" height="703" /></a></p>
<p>The presentation documents using EC2 with either <a title="segue" href="http://code.google.com/p/segue/" target="_blank">Segue</a> or <a title="EMR" href="http://aws.amazon.com/elasticmapreduce/" target="_blank">Elastic Map Reduce</a> to demonstrate Monte Carlo simulations and evaluating large likelihood functions using EC2 and R. I have some sample code up <a title="sample code" href="http://econsteve.com/r/emr.SimpleExample.zip" target="_blank">here</a>. Usage is described in the presentation. The technique is simulated maximum likelihood.</p>
<p>In the near future, I plan to more neatly package this demonstration and perhaps add a screencast. But, this should get you started.</p>
]]></content:encoded>
			<wfw:commentRss>http://econsteve.com/?feed=rss2&#038;p=34</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
