tag:blogger.com,1999:blog-33930337122269551052017-07-29T01:06:11.977-07:00Econ TrashTom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-3393033712226955105.post-7073447694543198272016-04-18T14:45:00.001-07:002017-07-24T15:06:05.206-07:00SIM10: circuit representation<script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script> <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>This post is another in a series I've done on the SIM model described by Godley and Lavoie (G&L) in Chapter 3 of their book <i>Monetary Economics</i> [<a href="http://dl4a.org/uploads/pdf/Monetary%2BEconomics%2B-%2BLavoie%2BGodley.pdf" target="_blank">pdf</a>]. I refer to G&L's original discrete time version of the model as $SIM_d$ and I introduce here a continuous time version of it that I refer to as $SIM_c$. $SIM_c$ is different from the continuous time versions I've discussed in my SIM8 and earlier posts (e.g. $SIM_m$), though it is related to the concepts I introduce in SIM9. The other main purpose of this post is to implement $SIM_c$ as an interactive circuit model so you can see it in action, and see how it relates to $SIM_d$.<br /><br />This post (like several other of my recent SIM posts) is related to a post by <a href="http://informationtransfereconomics.blogspot.com/2016/03/an-rlc-circuit-with-r-s-and-l-f.html" target="_blank">Jason Smith</a> on SFC models. I also credit <a href="http://mechanicalmoney.blogspot.com/" target="_blank">Roger Sparks</a> for stoking my interest in this circuit analogy and for providing feedback.<br /><br /><span style="color: #7f6000;">Update </span><span style="color: #7f6000;"><span style="color: #7f6000;">Start</span>: 2016.04.20 10:53 AM</span><br /><br /><span style="color: #7f6000;">I simplified the Y(t) charge (=voltage across 1-F capacitors) output by consolidating the Yodd(t) and Yeven(t) by adding another switch, and I stacked it on top of the y(t) current plot so you can more easily see the time relation between SIM outputs (peaks of Y(t) "saw-teeth") and the underlying continuous model here (which produces y(t)). I also added a way to easily adjust g(t) (the instantaneous government gross spending rate) once the the simulation starts (i.e. once you close the activation switch (top-center)): it still defaults to 20 dollars per unit time, but now you can adjust it while the simulation is running via the slider in the right side-bar labeled "Voltage" (under the other sliders such as "Current Speed" etc). Here's the new URL (in its "tinyurl" format -- the other is </span><span style="color: #7f6000;"><span class="_Tgc"><span class="texhtml">~</span></span>4241 characters long, and exceeds blogger's allowed comment size!):</span><br /><a href="https://tinyurl.com/yc86aun6"><b>https://tinyurl.com/yc86aun6</b></a> <span style="color: #7f6000;">(and the "preview" version:</span> <a href="http://preview.tinyurl.com/yc86aun6"><b>http://preview.tinyurl.com/yc86aun6</b></a><span style="color: #7f6000;">). Also, here a screen capture with annotations (figure 0: click to enlarge):</span><br /><div class="separator" style="clear: both; text-align: center;"></div><br /><div class="separator" style="clear: both; text-align: center;"></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://4.bp.blogspot.com/--UU3ESIBO9s/Vxm_yt-2w4I/AAAAAAAAA8Q/OAewR6eB0xgeKUBKMhHeztlxJA7i1A2JgCKgB/s1600/SIM_op_amp_inst_circ_w_ping_pong_integrators_v07_on_2_prds_annotaded_01.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="298" src="https://4.bp.blogspot.com/--UU3ESIBO9s/Vxm_yt-2w4I/AAAAAAAAA8Q/OAewR6eB0xgeKUBKMhHeztlxJA7i1A2JgCKgB/s640/SIM_op_amp_inst_circ_w_ping_pong_integrators_v07_on_2_prds_annotaded_01.png" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 0: Updated simulation screen capture with annotations (click to enlarge)</td></tr></tbody></table><br /><span style="color: #7f6000;"><span style="color: #7f6000;">Feel free to edit them however you like: you can't mess up the original (and if you want start over, just refresh your browser). If you want to store your creation, use the file menu. </span>See the extended table of Godley & Lavoie's (G&L) SIM results (with default parameters) near the bottom of this post, and compare with the peak values produced in the curve Y(t) (lower left scope, top (green) trace). The simulation value in white text in the upper right of each scope trace (scopes are along the bottom) records the value of the highest peak of that trace, so this value will persist until another larger peak is encountered, giving you time to pause the simulation (with the "Stopped" check box in the right side-bar) to do the comparison.</span><br /><br /><div class="separator" style="clear: both; text-align: center;"></div><span style="color: #7f6000;">Update End: </span><span style="color: #7f6000;"><span style="color: #7f6000;">2016.04.20 10:53 AM</span></span><b> </b><br /><br />This post discusses several electric circuit representations of SIM, <a href="http://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.001+0.9487735836358526+19+25+50%0Aa+832+160+800+160+0+500+-500+1000000%0Ar+784+96+848+96+0+5.98608546406%0Aw+784+160+784+128+0%0Aw+848+128+848+144+0%0Ar+848+144+896+144+0+1.49652132346%0Ag+848+176+848+192+0%0Aw+832+144+848+144+0%0Aw+832+176+848+176+0%0Aw+784+160+800+160+0%0Ac+848+128+784+128+2+1+5.158109520006618e-11%0Aw+784+128+784+96+0%0Aw+848+128+848+96+0%0Aw+720+480+720+464+0%0Aw+720+240+720+224+0%0AR+1056+144+1088+144+0+0+40+20+0+0+0.5%0Aw+656+240+672+240+0%0Aw+704+256+720+256+0%0Aw+704+224+720+224+0%0Ar+720+240+784+240+0+1.197217059%0Aw+720+208+720+224+0%0Aw+656+240+656+208+0%0Ar+656+208+720+208+0+1%0Aa+704+240+672+240+0+500+-500+1000000%0Aw+720+304+720+320+0%0Aw+608+240+656+240+0%0Aw+720+400+720+384+0%0Aw+784+320+784+240+0%0Aw+784+320+784+400+0%0Aw+784+400+784+480+0%0Aw+608+320+656+320+1%0Aa+704+320+672+320+0+500+-500+1000000%0Ar+656+288+720+288+0+1%0Aw+656+320+656+288+0%0Aw+720+288+720+304+0%0Ar+720+320+784+320+0+5.986085297%0Aw+704+304+720+304+0%0Aw+704+336+720+336+0%0Aw+656+320+672+320+0%0Aw+608+400+656+400+1%0Aa+704+400+672+400+0+500+-500+1000000%0Ar+656+368+720+368+0+1%0Aw+656+400+656+368+0%0Aw+720+368+720+384+0%0Ar+720+400+784+400+0+1.496521324%0Aw+704+384+720+384+0%0Aw+704+416+720+416+0%0Aw+656+400+672+400+0%0Aw+608+480+656+480+1%0Aa+704+480+672+480+0+500+-500+1000000%0Ar+656+448+720+448+0+1%0Aw+656+480+656+448+0%0Aw+720+448+720+464+0%0Ar+720+480+784+480+0+1.197217059%0Aw+704+464+720+464+0%0Aw+704+496+720+496+0%0Aw+656+480+672+480+0%0Aw+784+160+784+240+0%0Aw+880+208+768+208+0%0Aw+880+368+768+368+0%0Aw+880+448+768+448+0%0Aw+880+448+880+368+0%0Aw+2384+400+2352+400+0%0Ar+720+208+768+208+0+0.602802438%0Ar+720+288+768+288+0+3.014012191%0Ar+720+368+768+368+0+0.753503048%0Ar+720+-416+768+-416+0+1%0Ar+2400+512+2448+512+0+1%0Ar+720+448+768+448+0+1.517638818%0Aw+880+176+880+208+0%0Aw+880+288+880+368+0%0Ar+944+192+992+192+0+1%0Aw+928+224+944+224+0%0Aa+928+208+896+208+0+500+-500+1000000%0Ar+880+176+944+176+0+1%0Aw+944+192+944+176+0%0Aw+880+288+880+208+0%0Aw+928+192+944+192+0%0Aw+880+208+896+208+0%0Aw+992+144+896+144+2%0Ag+720+336+720+352+0%0Ag+720+416+720+432+0%0Ag+944+224+944+240+0%0Ag+720+496+720+512+0%0Ag+720+256+720+272+0%0Aw+880+288+768+288+0%0Ar+608+320+608+352+0+1%0Ar+608+400+608+432+0+1%0Ar+608+480+608+512+0+1%0Ar+608+256+608+288+0+1%0Ag+608+288+608+304+0%0Ag+608+352+608+368+0%0Ag+608+432+608+448+0%0Ag+608+512+608+528+0%0AO+784+160+736+160+1%0Aw+992+144+992+192+1%0Aa+368+192+336+192+0+500+-500+1000000%0Aw+368+176+384+176+0%0Ac+384+160+320+160+2+1+2.2007865899961173e-11%0Aw+384+176+384+160+0%0Aw+320+160+320+192+0%0Aw+336+192+320+192+0%0Aw+368+208+384+208+0%0Ag+384+208+384+224+0%0A159+384+128+320+128+0+1e-12+1000000000000%0Ar+384+176+432+176+0+1%0Aw+384+160+384+128+0%0Aw+320+160+320+128+0%0AR+416+112+416+80+1+2+0.5+1.5+1.5+3.141592653589793+0.5%0Aw+608+256+608+240+1%0Aw+576+240+432+240+0%0Aw+464+160+464+128+0%0Aw+528+160+528+128+0%0Ar+528+176+576+176+0+1%0A159+528+128+464+128+1+1e-11+1000000000000%0Ag+528+208+528+224+0%0Aw+512+208+528+208+0%0Aw+480+192+464+192+0%0Aw+464+160+464+192+0%0Aw+528+176+528+160+0%0Ac+528+160+464+160+2+1+6.297012356801378e-22%0Aw+512+176+528+176+0%0Aa+512+192+480+192+0+500+-500+1000000%0Aw+576+240+576+176+0%0Aw+608+240+576+240+0%0Aw+432+240+432+176+0%0Aw+416+112+496+112+0%0Aw+416+112+352+112+0%0A159+1056+144+1024+144+0+1e-11+1000000000000%0Aw+496+112+608+112+2%0Aw+704+80+704+64+0%0Aw+704+64+1040+64+0%0Aw+1040+64+1040+128+0%0Aw+1024+144+992+144+0%0A155+608+80+640+80+0+0%0AS+608+80+608+16+0+0+false+0%0AR+624+16+656+16+0+0+40+5+0+0+0.5%0Aw+592+16+560+16+0%0Ag+560+16+560+32+0%0Ao+94+64+0+33+0.0000762939453125+0.00009765625+0+-1%0Ao+9+64+0+34+0.0000762939453125+0.00009765625+1+-1%0Ao+88+64+0+33+0.0000762939453125+0.00009765625+2+-1%0Ao+85+64+0+33+0.0000762939453125+0.00009765625+3+-1%0Ao+86+64+0+33+0.0000762939453125+0.00009765625+4+-1%0Ao+87+64+0+33+0.0000762939453125+0.00009765625+5+-1%0Ao+97+64+0+34+0.0000762939453125+0.00009765625+6+-1%0Ao+119+64+0+34+0.0000762939453125+0.00009765625+7+-1%0A" target="_blank">especially this implementation using operational amplifiers (op amps)</a> which partially bridges the gap between the continuous time and discrete time models (with only a single "flow" variable ($Y$). <a href="http://monetaryreflections.blogspot.com/2016/01/sticky-prices-unexpected-inflation-and.html?showComment=1461094046672#c6560824550216807165" target="_blank">This comment</a> I left on Nick Edmond's blog is a pretty good summary. <br /><br />Money is modeled as coulombs with 1 coulomb = 1 dollar. Sample periods ($T_s$) are modeled as seconds. After clicking on the link, activate the circuit by clicking on the switch at the top, as shown in figure 1 (click on figure 1 to get a more detailed view). After the activation switch changes from ground to +5 volts, it may take it a short while before the next rising clock edge actually activates the circuit. This is done to synchronize the integration of $y(t)$ in with the ping pong integrators so that the outputs of these integrators match G&L's values of $Y$ in their table. Check the outputs ($Y_{odd}$ and $Y_{even}$) when they reach their peak at the end of each integration interval (in the lower right corner). I had to divide it into a pair of ping-poing integrators because a single integrator didn't discharge fast enough so as not to confuse the circuit simulator. In principal, this same technique could be applied to generate $T, Y_D, C$ and the input $G$ so that they all match G&L's table. $H$ will already match, since $H(t)$ is a stock, integrated from $t = -\infty$ rather than a sliding integral over just the last sample period.<br /><br />The instantaneous curves will all satisfy G&L's accounting identities over any sample period, not just at the sample times G&L have chosen in their example. You can think of this as the instantaneous values ($g(t), y(t), \tau (t), y_D (t)$ and $c(t)$) being valid "flows" over infinitesimally small sample intervals.<br /><br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://1.bp.blogspot.com/-jW80ujY8ALs/VxgPST-XdyI/AAAAAAAAA54/LgJSK4zFq1cLcxSb5KYGxfD3CgRizixWwCLcB/s1600/SIM_op_amp_inst_circ_w_ping_pong_integrators_v04.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="366" src="https://1.bp.blogspot.com/-jW80ujY8ALs/VxgPST-XdyI/AAAAAAAAA54/LgJSK4zFq1cLcxSb5KYGxfD3CgRizixWwCLcB/s640/SIM_op_amp_inst_circ_w_ping_pong_integrators_v04.png" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 1: Screen shot of SIM implemented with instantaneous equations in op amp circuit with sliding window integration to calculate "flows" (click on to enlarge)</td></tr></tbody></table><div class="separator" style="clear: both; text-align: center;"></div><br />This post borrows heavily from <a href="http://banking-discussion.blogspot.com/p/first-order-lc-circuit-1.html" target="_blank">a previous page I put up here with other circuit implementations of parts of SIM</a>, but also from the <a href="http://banking-discussion.blogspot.com/2016/04/sim9-highlighting-difference-between.html" target="_blank">2016.04.18 update to SIM9</a>. On that previous page with circuit implementations of SIM I touched on doing a full circuit implementation of SIM using a circuit with operational amplifiers (op amps) in comments dated 2016.04.17. I did produce such an implementation for the case of outputs corresponding to G&L SIM discrete time outputs ($Y, T, Y_D$ and $C$) and the SIM discrete time input ($G$) all of which represent integrated values of some underlying finer grain discrete time function or an integration of some underlying continuous time function. There are an infinite number of such underlying discrete time or continuous time functions which would map to SIM's sampled output values, but in the case of continuous time models, there's one model in particular that suggests itself as the simplest. In that simple continuous time model, the values $G, Y, T, Y_D$ and $C$ represent samples from continuous time functions, which themselves are sliding window integrals (over a window of time equal to the length of 1-sample period = $T_s$) of other continuous time functions representing <i>instantaneous rates</i>, all in dollars per unit time. My post SIM 9 discusses this further.<br /><br /><u><b>Equations to define a continuous time version of SIM using instantaneous flows: </b></u><br /><br />The following are the equations for the continuous time <a href="https://en.wikipedia.org/wiki/State-space_representation" target="_blank">state space</a> matrices we've chosen to implement here in terms of their (original) discrete time counterparts:<br />$$A_c = \frac{1}{T_{s_0}} \ln (A_d)\tag {1a}$$<br />$$B_c = \frac{A_c}{Ad - 1} T_{s_0} B_d \tag {1b}$$ <br />$$C_{c} = \frac{A_c}{A_d -1} C_d \tag 2$$<br />$$D_{c} = \frac{A_c T_{s_0} + 1 - A_d}{(A_d - 1)^2} B_d C_d + D_d = \frac{B_c - B_d}{A_d - 1} C_d + D_d \tag 3$$<br /><span style="color: blue;"><span style="color: black;">The "d" subscript indicates discrete time while the "c" subscript indicates continuous time. </span></span>In this case $A_d, B_d, A_c, B_c \in ℝ^{1 \times 1}$ (i.e. they are real valued scalars), while $C_d, D_d, C_c, D_c \in ℝ^{4 \times 1}$ (i.e. they are real valued $4 \times 1$ columns vectors). $T_{s_0}$ is the default (original) SIM sample period and is implicitly defined as "1 period" (i.e. with numerical value 1 unit of time) in G&L's description of SIM. I always call it the default (or original) sample period because the continuous time model is independent of whatever sample period ($T_s$) we choose, but it's defined in terms of a discrete time model (the original SIM model) which itself is defined in terms of an original sample period ($T_{s_0}$).<br /><br />These results could probably be generalized to cases with more than one state (i.e. $A_d, A_c \in ℝ^{N \times N}$) by replacing $1/(A_d - 1)$ with $(A_d - I)^{-1}$ and of course replacing the scalar multiplies by matrix multiplies (where appropriate), at least in cases where $A_d - I$ is invertible. The fact that $A_c A_d = A_d A_c$ should help with that (see the <a href="https://en.wikipedia.org/wiki/Matrix_exponential" target="_blank">definition of a matrix exponential</a> for why that is [and notice that $A_d = e^{A_c T_{s_0}}$]). I'd guess it can probably also be done for cases where $A_d - I$ is not invertible (i.e. it's singular) with some mess involving <a href="https://en.wikipedia.org/wiki/Jordan_normal_form" target="_blank">Jordan blocks</a> or some such.<br /><br />Keep in mind that the particular continuous time system we've chosen here is not unique, and there are an infinite number of other possible choices. Also keep in mind that the discrete time system (in this case) is not simply samples of an underlying continuous time system (as is the case in may other discrete-time continuous-time pairs, for example in many engineering applications). Instead the discrete time system represents the outputs of a series of "accounting intervals" over which continuous time rate variables (which I sometimes refer to as "instantaneous flows") (measured in dollars per unit time) must be integrated to produce values comparable with the corresponding flow values produced by the discrete time model. Essentially, the sampling is done at the end of this accounting (integration) procedure over each period. This is the reason that $C_c \neq C_d$ and $D_c \neq D_d$ in this case, unlike in many engineering applications, where the measurement (or output) matrix ($C$) and feed-through (or feed-forward) matrix ($D$) are equal to their discrete time counterparts. That's because in those engineering applications, the instantaneous rates (in constant units) are what we're typically interested in (both in continuous time and discrete time), rather than their integrals over each sample period. Because of this dependence on integrating over sample intervals in SIM, then as $T_s \rightarrow 0$ all the SIM flow values $\rightarrow 0$ as well (i.e. $G, Y, T, Y_D, C \rightarrow 0$). In contrast, the "instantaneous flows" $g, y, \tau, y_D, c \nrightarrow 0$ as $T_s \rightarrow 0$ because they are independent of the sample period ($T_s$) chosen.<br /><br />[To do: show how I derived the above equations]<br /><br /><strike>[To do: show a closed form means of using these result to change the sample period like in SIM1, SIM2, SIM3 and SIM6]</strike> Done (see equations (i) through (iv) below). <br /><br /><u><b>Op amp circuit simulation parameter (i.e. resistor) values</b></u> <br /><br />For the following explanation related to the below tables, refer to equations $(4), (5), (6), (13), (14)$, and $(15)$ in the section below this one. Given an instantaneous flow input $g(t)$ (in amperes := coulombs per second) the circuit produces instantaneous flow outputs $y(t), \tau (t), y_D (t)$ and $c(t)$ also in amperes. Integrating these instantaneous flows over each default SIM sample period of length $T_{s_0}$ produces values of charge in coulombs (equivalent to volts across the 1-F capacitors used) which are numerically equivalent to corresponding SIM flow values $G, Y, T, Y_D$ and $C$ in dollars over the period. It also produces an instantaneous stock $H(t)$ in coulombs of charge (again measurable in volts across the 1-F capacitor used), which at the default sample times is equivalent to the SIM stock value $H$ in dollars.<br /><br /><table border="0" cellpadding="0" cellspacing="0" style="width: 154px;"><colgroup><col style="mso-width-alt: 2560; mso-width-source: userset; width: 53pt;" width="70"></col> <col style="mso-width-alt: 3072; mso-width-source: userset; width: 63pt;" width="84"></col> </colgroup><tbody><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" colspan="2" height="22" style="height: 16.5pt; width: 116pt;" width="154">Table 1: SIM Parameters</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">Symbol</td> <td class="xl65">Value</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$T_{s_0}$</td> <td class="xl65">1</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">α<span class="font5"><sub>1</sub></span></td> <td class="xl65">0.6</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">α<span class="font5"><sub>2</sub></span></td> <td class="xl65">0.4</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">θ</td> <td class="xl65">0.2</td> </tr></tbody></table><br /><table border="0" cellpadding="0" cellspacing="0" style="width: 306px;"><colgroup><col style="mso-width-alt: 2011; mso-width-source: userset; width: 41pt;" width="55"></col> <col style="mso-width-alt: 6875; mso-width-source: userset; width: 141pt;" width="188"></col> <col style="mso-width-alt: 2304; mso-width-source: userset; width: 47pt;" width="63"></col> </colgroup><tbody><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" colspan="3" height="22" style="height: 16.5pt; width: 229pt;" width="306">Table 2: Useful Expressions</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">Name</td> <td class="xl65">Expression</td> <td class="xl65">Value</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">P</td> <td class="xl65">1 - α<span class="font5"><sub>1</sub></span><span class="font0">(1-θ)</span></td> <td class="xl65">0.52</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$Q$</td> <td class="xl65">$A_c/(A_d-1)$</td> <td class="xl65">1.085852</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$V$</td> <td class="xl65">$(B_c-B_d)/(A_d-1)$</td> <td class="xl65">-0.34341</td> </tr></tbody></table><br /><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody><tr><td style="text-align: center;"><a href="https://4.bp.blogspot.com/-_VIgWYD92qg/VxrqHJlPEYI/AAAAAAAAA8o/p2Y5N6aP6yMRd0i29DW74yKANUMNHP5CgCKgB/s1600/SIM_op_amp_inst_circ_w_ping_pong_integrators_v07_on_2_prds_annotaded_01_param_R_detail.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://4.bp.blogspot.com/-_VIgWYD92qg/VxrqHJlPEYI/AAAAAAAAA8o/p2Y5N6aP6yMRd0i29DW74yKANUMNHP5CgCKgB/s640/SIM_op_amp_inst_circ_w_ping_pong_integrators_v07_on_2_prds_annotaded_01_param_R_detail.png" width="356" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 0a: Detail of figure 0: parameter resistors</td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" style="width: 342px;"><colgroup><col style="mso-width-alt: 2048; mso-width-source: userset; width: 42pt;" width="56"></col> <col style="mso-width-alt: 2706; mso-width-source: userset; width: 56pt;" width="74"></col> <col style="mso-width-alt: 2267; mso-width-source: userset; width: 47pt;" width="62"></col> <col style="mso-width-alt: 2669; mso-width-source: userset; width: 55pt;" width="73"></col> <col style="mso-width-alt: 2816; mso-width-source: userset; width: 58pt;" width="77"></col> </colgroup><tbody><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl67" colspan="5" height="22" style="height: 16.5pt; width: 258pt;" width="342">Table 3: Discrete Time State Space Matrices ($SIM_d$)</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">Matrix</td> <td class="xl65">Elements</td> <td class="xl65">Name</td> <td class="xl65">Expression</td> <td class="xl65">Value</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" height="22" style="height: 16.5pt;">$A_d$</td> <td class="xl65">$A_{d_{1,1}}$</td> <td class="xl65">$A_d$</td> <td class="xl65">1 - α<span class="font5"><sub>2</sub></span><span class="font0">θ/P</span></td> <td class="xl65">0.84615385</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" height="22" style="height: 16.5pt;">$B_d$</td> <td class="xl65">$B_{d_{1,1}}$</td> <td class="xl65">$B_d$</td> <td class="xl65">1 - <span class="font0">θ/P</span></td> <td class="xl65">0.61538462</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" height="88" rowspan="4" style="height: 66.0pt;">$C_d$</td> <td class="xl65">$C_{d_{1,1}}$</td> <td class="xl65">$C_Y$</td> <td class="xl65">α<span class="font5"><sub>2</sub></span><span class="font0">/P</span></td> <td class="xl65">0.76923077</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$C_{d_{2,1}}$</td> <td class="xl65">$C_T$</td> <td class="xl65">α<span class="font5"><sub>2</sub></span><span class="font0">θ/P</span></td> <td class="xl65">0.15384615</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$C_{d_{3,1}}$</td> <td class="xl65">$C_{Y_D}$</td> <td class="xl65">α<span class="font5"><sub>2</sub></span><span class="font0">(1-θ)/P</span></td> <td class="xl65">0.61538462</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$C_{d_{4,1}}$</td> <td class="xl65">$C_C$</td> <td class="xl65">α<span class="font5"><sub>2</sub></span><span class="font0">/P</span></td> <td class="xl65">0.76923077</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" height="88" rowspan="4" style="height: 66.0pt;">$D_d$</td> <td class="xl65">$D_{d_{1,1}}$</td> <td class="xl65">$D_Y$</td> <td class="xl65">1/P</td> <td class="xl65">1.92307692</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$D_{d_{2,1}}$</td> <td class="xl65">$D_T$</td> <td class="xl65">θ/P</td> <td class="xl65">0.38461538</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$D_{d_{3,1}}$</td> <td class="xl65">$D_{Y_D}$</td> <td class="xl65">(1-θ)/P</td> <td class="xl65">1.53846154</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$D_{d_{4,1}}$</td> <td class="xl65">$D_C$</td> <td class="xl65">α<span class="font5"><sub>1</sub></span><span class="font0">(1-θ)/P</span></td> <td class="xl65">0.92307692</td> </tr></tbody></table><br /><table border="0" cellpadding="0" cellspacing="0" style="width: 636px;"><colgroup><col style="width: 48pt;" width="64"></col> <col style="mso-width-alt: 2560; mso-width-source: userset; width: 53pt;" width="70"></col> <col style="width: 48pt;" width="64"></col> <col style="mso-width-alt: 5046; mso-width-source: userset; width: 104pt;" width="138"></col> <col style="width: 48pt;" width="64"></col> <col style="mso-width-alt: 3584; mso-width-source: userset; width: 74pt;" width="98"></col> <col style="mso-width-alt: 2706; mso-width-source: userset; width: 56pt;" width="74"></col> <col style="width: 48pt;" width="64"></col> </colgroup><tbody><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl67" colspan="5" height="22" style="height: 16.5pt; width: 301pt;" width="400">Table 4: Continuous Time State Space Matrices ...</td> <td class="xl67" colspan="3" style="width: 178pt;" width="236">... and Resistors</td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">Matrix</td> <td class="xl65">Elements</td> <td class="xl65">Name</td> <td class="xl65">Expression</td> <td class="xl65">Value</td> <td class="xl65">Name</td> <td class="xl65">Expression</td> <td class="xl65"><span style="color: red;">Value (Ω)</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" height="22" style="height: 16.5pt;">$A_c$</td> <td class="xl65">$A_{c_{1,1}}$</td> <td class="xl66">$A_c$</td> <td class="xl66">$\ln(A_d)/T_{s_0}$</td> <td class="xl65">-0.16705</td> <td class="xl66">$R_a$</td> <td class="xl66">$-{A_c}^{-1}$</td> <td class="xl65"><span style="color: red;">5.986085</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" height="22" style="height: 16.5pt;">$B_c$</td> <td class="xl65">$B_{c_{1,1}}$</td> <td class="xl66">$B_c$</td> <td class="xl66">$Q T_{s_0} B_d$</td> <td class="xl65">0.668216</td> <td class="xl66">$R_b$</td> <td class="xl66">${B_c}^{-1}$</td> <td class="xl65"><span style="color: red;">1.496521</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" height="88" rowspan="4" style="height: 66.0pt;">$C_c$</td> <td class="xl65">$C_{c_{1,1}}$</td> <td class="xl66">$C_y$</td> <td class="xl66" rowspan="4">$Q C_d$</td> <td class="xl65">0.83527</td> <td class="xl66">$R_{C_y}$</td> <td class="xl66">${C_y}^{-1}$</td> <td class="xl65"><span style="color: red;">1.197217</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$C_{c_{2,1}}$</td> <td class="xl66">$C_{\tau}$</td> <td class="xl65">0.167054</td> <td class="xl66">$R_{C_{\tau}}$</td> <td class="xl66">${C_{\tau}}^{-1}$</td> <td class="xl65"><span style="color: red;">5.986085</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$C_{c_{3,1}}$</td> <td class="xl66">$C_{y_D}$</td> <td class="xl65">0.668216</td> <td class="xl66">$R_{C_{y_D}}$</td> <td class="xl66">${C_{y_D}}^{-1}$</td> <td class="xl65"><span style="color: red;">1.496521</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$C_{c_{4,1}}$</td> <td class="xl66">$C_c$</td> <td class="xl65">0.83527</td> <td class="xl66">$R_{C_c}$</td> <td class="xl66">${C_c}^{-1}$</td> <td class="xl65"><span style="color: red;">1.197217</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl66" height="88" rowspan="4" style="height: 66.0pt;">$D_c$</td> <td class="xl65">$D_{c_{1,1}}$</td> <td class="xl66">$D_y$</td> <td class="xl66" rowspan="4">$V C_d + D_d$</td> <td class="xl65">1.658918</td> <td class="xl66">$R_{D_y}$</td> <td class="xl66">${D_y}^{-1}$</td> <td class="xl65"><span style="color: red;">0.602802</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$D_{c_{2,1}}$</td> <td class="xl66">$D_{\tau}$</td> <td class="xl65">0.331784</td> <td class="xl66">$R_{D_{\tau}}$</td> <td class="xl66">${D_{\tau}}^{-1}$</td> <td class="xl65"><span style="color: red;">3.014012</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$D_{c_{3,1}}$</td> <td class="xl66">$D_{y_D}$</td> <td class="xl65">1.327135</td> <td class="xl66">$R_{D_{y_D}}$</td> <td class="xl66">${D_{y_D}}^{-1}$</td> <td class="xl65"><span style="color: red;">0.753503</span></td> </tr><tr height="22" style="height: 16.5pt; mso-height-source: userset;"> <td class="xl65" height="22" style="height: 16.5pt;">$D_{c_{4,1}}$</td> <td class="xl66">$D_c$</td> <td class="xl65">0.658918</td> <td class="xl66">$R_{D_c}$</td> <td class="xl66">${D_c}^{-1}$</td> <td class="xl65"><span style="color: red;">1.517639</span></td> </tr></tbody></table><br /><span style="color: blue;"><span style="color: black;">Table 4 (above) shows the resistor values in ohms (</span></span><span style="color: blue;"><span style="color: black;">Ω) needed to implement (via the op amp circuit) the version of the continuous time circuit described in this post. The resistors are labeled in figure 0 to match the red colored values in the right most column. Figure 0a to the right shows a detail of figure 0, so the pertinent resistor labels are easier to read. Table 1 shows the original discrete time SIM model's parameters. Table 2 defines some useful expressions. Table 3 translates the original discrete time SIM (call that model $SIM_d$) parameter values into a set of state space matrices. There's an <a href="http://banking-discussion.blogspot.com/p/sim10-tables-as-embedded-spreadsheets.html" target="_blank">interactive embedded spreadsheet version of tables 1 through 4 on this page</a>.</span></span><br /><br /><span style="color: blue;"><span style="color: black;">Note that the version of the continuous time system implemented here produces instantaneous "flow" (i.e. instantaneous rate values) (in dollars per unit time) which correspond to the original discrete time SIM flow variables. <a href="http://banking-discussion.blogspot.com/2016/04/sim8-discrete-time-and-continuous-time.html" target="_blank">SIM8</a> equation $(2)$ gives another version of a continuous time system (the continuous time state space matrices there are subscripted with "m" instead of "c"), the samples of which themselves match the discrete time SIM if $T_s = T_{s_0}$. The instantaneous flows in this version of continuous time SIM (unlike the stock variable $H(t)$, which is the same for SIM8 $(2)$ and here because $A_c = A_m$ and $B_c = B_m$) must be integrated over a sample period to recreate the corresponding SIM flow variables. These instantaneous flow values will NOT match SIM outputs without doing this integration. However, integrating these flows over any arbitrary time interval should produce results which obey G&L's accounting identities, which is not the case with SIM8 $(2)$. Note that $SIM_m$ could also be constructed with the op amp circuit presented here by using $A_c$ and $B_c$ from table 4 and $C_d$ and $D_d$ from table 3 as the basis of calculating the resistor values. If this were done, the ping-pong integrators should be removed or ignored.</span></span><br /><br /><span style="color: blue;"><span style="color: black;">The instantaneous stock variable $H(t)$ is the same for the continuous time model presented here (call that model $SIM_c$) and for the one in SIM8 $(2)$ (call that model $SIM_m$). That's because </span></span><span style="color: blue;"><span style="color: black;">$A_c = A_m$ and $B_c = B_m$. In both cases $H(t)$ matches the $SIM_d$ stock variable $H$ once the indexing depicted in figure 2 (below) is taken into account. That's because the continuous time flow variables in $SIM_m$ are directly representing the sample-period integrated instantaneous flows modeled in $SIM_c$, provided the sample period is $T_{s_0}$ and that the sample times coincide with those of $SIM_d$. $SIM_m$ stock and flow values are not guaranteed to satisfy G&L's accounting equations for other sample periods or sample times.</span></span><br /><br /><span style="color: blue;"><span style="color: black;"><u><b>Using the continuous time SIM with instantaneous flows to find new discrete time models with arbitrary sample periods (i.e. how to change the sample period):</b></u></span></span><br /><br /><span style="color: blue;"><span style="color: black;">Changing the sample periods has been one of my primary goals with this series of posts since SIM1, and in fact versions of this concept are implemented in SIM1, SIM2, SIM3 and SIM6. How will this approach differ? Well here I'm not attempting to change the sample period for the model $SIM_c$ since that model is independent of the sample times (and actually has no sample times). However, a discrete time model which is the product of integrating the instantaneous flows of $SIM_c$ over each sample period, and then sampling at the end of each integration (at the end of each sample period ($T_s$), when the output of the integration has reached a peak) will be dependent on sample times, and thus it makes sense to speak of adjusting it for the sample period. Let's call this resultant discrete time model $SIM_{T_s}$ to indicate that it's sample period is $T_s$, and let's call its output matrix $C_{T_s}$ and its feedthrough matrix $D_{T_s}$. Here are some things we know about such a discrete time model, which we can use to check our work: </span></span><br /><ol><li>When $T_s = T_{s_0}$ it reduces to the original $SIM_d$ model.</li><li>At $T_s = 0$ the flows of $SIM_{T_s}$ will also be $0$ since the integration time will be $0$, and thus $C_{T_s} = 0$ and $D_{T_s} G_n = 0$. Keep in mind also that as $T_s \rightarrow 0,\; G_n \rightarrow 0,\;\forall n$ since $G$ is also a flow, and as the integration window $T_s$ drops to $0$ so does $G_n$ (unless of course it contains Dirac delta functions).</li><li> $d C_{T_s} / d T_s$ evaluated at $T_s = 0$ will be equal to $C_c$ and $d (D_{T_s} T_s) / d T_s$ evaluated at $T_s = 0$ will be equal to $D_c$. This is because $C_c$ and $D_c$ form the measurement equation for instantaneous flows, which is what happens in the limit for flows over a sample period $T_s$ as $T_s \rightarrow 0$. Again, keep in mind $G$ is also a flow.</li><li>If as $t \rightarrow \infty,\; g(t) \rightarrow \overline{g} > 0$ (where $\overline{g} \equiv$ the steady state value of $g(t)$) then as $T_s \rightarrow \infty$ we should have $SIM_{T_s}$ flows also going to $\infty$ because we're integrating over an infinite window of the non-zero steady sate of the model. Keep in mind also that if $g(t) \rightarrow \overline{g} > 0$ as $t \rightarrow \infty$ then we'll have $G_n \rightarrow \infty,\;\forall n$ because $G$ is also a flow, and is thus integrated over an unbounded sample period. </li><li>If as $t \rightarrow \infty,\; g(t) \rightarrow \overline{g} > 0$ then as $T_s \rightarrow \infty$ we should have $SIM_{T_s}$ flows averaged over an interval of length $T_s$ going to the steady state value of the flows divided by $T_{s_0}$.</li></ol>Given the above and our previous values for $SIM_c$ and $SIM_d$ system matrices we can find values for the system matrices of this new discrete time system $SIM_{T_s}$ as follows:<br />$$A_{T_s} = {A_d}^{T_s/T_{s_0}}\tag{i}$$<br />$$B_{T_s} = \frac{A_{T_s} - 1}{A_d - 1}\frac{T_{s_0}}{T_s} B_d\tag{ii}$$<br />$$C_{T_s} = \frac{A_{T_s} - 1}{A_d - 1} C_d\tag{iii}$$<br />$$D_{T_s} = \frac{A_{T_s} - 1 - A_c T_s}{(A_d - 1)^2} \frac{T_{s_0}}{T_s} B_d C_d + D_c\tag{iv} = \frac{\frac{T_{s_0}}{T_s}(A_{T_s} - 1) - (A_d - 1)}{(A_d - 1)^2} B_d C_d + D_d$$<br />See SIM2 and SIM6 for more information on $(\text{i})$ and $(\text{ii})$. Compare the first expression for $D_{T_s}$ in $(\text{iv})$ with the first expression for $D_c$ in $(3)$ above, and notice that substituting $D_c$ from $(3)$ into the first expression for $D_{T_s}$ in $(\text{iv})$ results in the second expression for $D_{T_s}$ in $(\text{iv})$ (because the $A_c$ terms cancel), which clearly is just $D_d$ when $T_s = T_{s_0}$ (since, by $(\text{i})$ $A_{T_s} = A_d$ when $T_s = T_{s_0}$).<br /><br /><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody><tr><td style="text-align: center;"><a href="https://3.bp.blogspot.com/-GAFlWPP-8Ow/VyIqHDDgSsI/AAAAAAAAA9A/7iT-_XAjGwgxH-6cQZFxY1jxbFACgFbwgCLcB/s1600/SIM_altered_sample_period_cropped.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://3.bp.blogspot.com/-GAFlWPP-8Ow/VyIqHDDgSsI/AAAAAAAAA9A/7iT-_XAjGwgxH-6cQZFxY1jxbFACgFbwgCLcB/s1600/SIM_altered_sample_period_cropped.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 3a: changing Ts during a run</td></tr></tbody></table>Figure 3a at the right shows the effects of changing the sample period in the circuit on the fly by adjusting the frequency of the clock (CLK). See figure 3 below for an explanation of the curves, but basically it's Y(t) (green) above y(t) (yellow). Activity starts when the government spending rate (not pictured) steps up (instantaneously) from 0 to 20 dollars per unit time at t=0 (precisely where y(t) steps up in figure 3a). The 1st couple of periods were set to 2 seconds (corresponding to a clock frequency of 0.25 Hz), the middle four were at 1-second (the default, corresponding to a clock of 0.5 Hz) and the final set were at a clock of 1-Hz giving a 0.5 second sample (accounting) period. Notice how the peaks decrease in proportion to the sample period, and that the sample period has no effect on the instantaneous rate curve y(t).<br /><br />I'm not sure what the relationship is between the discrete time model here ($SIM_{T_s}$) sampled at arbitrary sample period $T_s$ not necessarily equal to $T_{s_0}$ and the model presented in post SIM6 in which the original G&L discrete time SIM (i.e. $SIM_d$) parameters $\alpha_1$ and $\alpha_2$ were adjusted (along with the period labels in the spreadsheet) to produce a discrete time model which exactly preserved $SIM_d$'s steady state values and its "adjustment time" (i.e. time constant = $T_c$), while still obeying G&L's accounting identities over each period. I suspect they may be the same model, at least over some range of the parameters. However, I'm confident the model here can be used with any sample period without any issues, since I'm not explicitly changing any $SIM_d$ parameters (other than its implicit sample period of course). NOTE: I added tables 5 through 7 to the <a href="http://banking-discussion.blogspot.com/p/sim10-tables-as-embedded-spreadsheets.html" target="_blank">interactive embedded spreadsheet here</a> and discovered that the values produced for the system matrices for $SIM_{T_s}$ match those produced by the embedded spreadsheet in <a href="http://banking-discussion.blogspot.com/2016/03/sim6-updated-sim-to-preserve-time.html" target="_blank">post SIM6</a> (for an example with $T_s = 0.4$ and $T_{s_0} = 1$, but I still need to show a mathematical connection).<br /><ol></ol><span style="color: blue;"><span style="color: black;">[To do: finish this section: explain the derivation of </span></span><span style="color: blue;"><span style="color: black;">$(\text{i})$ through $(\text{iv})$, and show that they satisfy our expectations (1 through 5) for the solution. Also, double check this whole post to make sure I have my $T_{s_0}$ and $T_s$ and corresponding explanations correct in all parts. That gets confusing! Also, figure out if $SIM_{T_s}$ presented here is the same as the discrete time model presented in post SIM6.]</span></span><br /><u><b><br /></b></u><br /><u><b>Relating G&L SIM stock and flow variables to a continuous time model with instantaneous rates: </b></u><br /><br />I'm reluctant to bring this up yet again (see SIM4, SIM7 and SIM9), because I really struggle with trying to communicate this in a logical and consistent fashion without stumbling over variable names and notation, but I need to revisit what is meant by some of the variable names on my annotated op amp circuit screen captures above. There are three issues at stake:<br /><ol><li>What I (and <a href="http://www.bondeconomics.com/2016/03/techniques-for-finding-sfc-model.html" target="_blank">Brian Romanchuk</a>) have called the "non-canonical" nature of SIM's iterative equations in comparison with a "canonical" state space expression.</li><li>What G&L's "periods" are and how they relate to a "normal" discrete time or continuous time timeline</li><li>What I've referred to as the "average vs instantaneous" continuous time equivalent "flow" variables (in the sense of stocks and flows in stock flow consistent (SFC) models).</li></ol>I don't expect I will do a much better job here than I've done before, but I will try to limit the scope and only describe what I need to in order to fill in the gaps in the diagrams. It may change in the future, but not until the diagrams above change as well. First I need to relate what G&L call a "Period" in their Table 3.4 to a continuous time timeline. Figure 2 depicts how I'm choosing to understand the relation. It's unfortunate that G&L didn't call their "Period 1" "Period 0" instead, but oh well.<br /><br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://2.bp.blogspot.com/-KgMGLB9k5pg/VxkaLnuu9JI/AAAAAAAAA6Q/5uTRfyBJxRQrPd1kRbCtqeO0EVvgR7iCACLcB/s1600/SamplePeriod.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="https://2.bp.blogspot.com/-KgMGLB9k5pg/VxkaLnuu9JI/AAAAAAAAA6Q/5uTRfyBJxRQrPd1kRbCtqeO0EVvgR7iCACLcB/s640/SamplePeriod.png" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 2: SIM periods and how they relate to sample times and the continuous time timeline</td></tr></tbody></table><br />I feel the need to introduce the concept of a "default SIM sample period" or "original SIM sample period" which I call $T_{s_0}$ only because so many of my previous SIM posts (e.g. SIM1, SIM2, SIM3, SIM6) were concerned with altering this sample period. I don't get into that much in this post, so you can take $T_{s_0} = T_s \equiv \text{$``$the SIM sample period$"$}$ in this post, and further you can take the numerical value of $T_s$ to be $1$ (i.e. $1$ default SIM sample period). Of course SIM is presented as a discrete time model from the get go by G&L, so they aren't really sampling anything, but because my purpose here it to relate this model to an example of a continuous time model which is "equivalent" in some sense, I need to introduce the concept of sampling this underlying continuous time model.<br /><br />As stated above, life would be slightly easier if G&L had chosen to name their initial period "Period 0" instead of "Period 1." An issue related to this is the "non-canonical" nature of the resulting discrete time "state space" system equations which can be written to represent SIM. These equations are:<br />$$H_{p+1} = A_d H_p + B_d G_{p+1} \tag 4$$<br />$$W_{p+1} = C_d H_p + D_d G_{p+1} \tag 5$$<br />where $A_d, B_d, C_d$ and $D_d$ are the usual state space system matrices for a discrete time linear time-invariant (LTI) system (the $d$ subscript here denoting discrete time). In this case, $H$ is the only state, thus $A_d \in ℝ^{1 \times 1}$ [1] (i.e. $A_d \in ℝ$, i.e. it's a real scalar). And since there's only a single input ($G$), then $B_d \in ℝ$ as well. For the output vector in $(5)$ I wrote $W$ to avoid confusion between the usual state space output vector name ($Y$) and one of SIM's outputs (also called $Y$). SIM as a state space mode has four outputs: $Y, T, Y_D$ and $C$ (I've chosen to write $Y_D$ rather than the $YD$ that G&L use to avoid confusing $YD$ for the product $Y \cdot D$). Thus we can write:<br />$$W \equiv \begin{bmatrix}<br />Y \\<br />T \\<br />Y_D \\<br />C<br />\end{bmatrix} \tag 6$$<br />where $W \in ℝ^{4 \times 1}$ and where I'll sometimes write it as $W = [Y\; T\; Y_D\; C]^T $ where the $T$ superscript here denotes a transpose. And since the input $G$ is a scalar we have that measurement matrices $C_d$ and $D_d \in ℝ^{4 \times 1}$.<br /><br />So why are equations $(4)$ and $(5)$ non-canonical? Well, the canonical versions use slightly different time indices:<br />$$x_{n+1} = A_d x_n + B_d u_n \tag 7$$<br />$$y_n = C_d x_n + D_d u_n \tag 8$$<br />Where $(7)$ is referred to as the "state update" equation and $(8)$ is referred to as the "measurement" equation. In this canonical form, $x$ is the state vector, $u$ is the input vector and $y$ is the measurement (or output) vector (each defined over some field, typically $ℝ$ or $ℂ$), and $A_d, B_d, C_d$ and $D_d$ are likewise defined over this same field and are all constant matrices of appropriate dimensions.<br /><br />Thus to write SIM in a truly canonical form would require us to introduce new state space variables for the input scalar and output vector, and define the corresponding SIM variables in terms of them. Note that throughout this blog I will write the time index for a discrete time sequence as either a subscript or using square argument brackets, like this: $x_n \equiv x[n]$. Thus using the subscript $\text{can}$ to denote canonical, we could make the following definitions for SIM:<br />$$G[p] \equiv G_\text{can}[p-1] \tag 9$$<br />$$W[p] \equiv W_\text{can}[p-1] \tag{10}$$<br />where I've used a subscript $p$ to remind us that G&L effectively use "Periods" a their subscript, with the unusual relation to time depicted in figure 2 above. Now that we have our canonical equivalents, we can do all the usual state space system manipulations using the canonical variables, and then translate back to SIM indexing at the end. However, rather than carry all that pedantic drudgery around with us I will do an end run around that in what follows. Perhaps I will change it, but the following quick and dirty definitions will suffice to explain the annotated screen captures above as they stand.<br /><br />First let's introduce the canonical state space continuous time equations for LTI systems (where I'm using the subscript $c$ to denote continuous time):<br />$$\dot{x}(t) = A_c x(t) + B_c u(t) \tag{11}$$<br />$$y(t) = C_c x(t) + D_c u(t) \tag{12}$$<br />where $x, u$, and $y$ are in general vectors over some field, and matrices $A_c, B_c, C_c$, and $D_c$ are constant matrices of appropriate dimension over this same field. There are many ways to relate a continuous time LTI system to a corresponding discrete time system, but one typical way is to define the discrete time system so that its input, state and output vectors match (i.e. are equivalent to) the corresponding continuous time system at each sample time. Typically some restrictions must be imposed on continuous time $u$ so this sample time equivalence occurs. We will use the typical one which requires that $u(t)$ is held constant between sample times. Thus $u(t)$ appears as a piece-wise constant function (step function) AKA a zero-order hold (ZOH) function, restricted to changing levels (instantaneously) only at sample times. <a href="http://banking-discussion.blogspot.com/2016/03/sim4.html" target="_blank">My SIM4 post</a> discusses one means of allowing a broader class of continuous time input functions while still retaining equivalence between continuous and discrete time versions of a system at each sample time. But given we make this ZOH restriction to $u(t)$ to guarantee equivalence at sample times, then the underlying field and dimensions of $x, u, y, A, B, C$ and $D$ will be equal for discrete and continuous time (where I've dropped the $c$ and $d$ subscripts so that I can speak to both sets). Of course the individual elements of the state space system matrices will in general be different [2].<br /><br />For the electrical circuit model continuous time system "equivalent" to SIM I describe in this post, we can write our continuous time state space system as:<br />$$\dot{H}(t) = A_c H(t) + B_c g(t) \tag{13}$$<br />$$w(t) = C_c H(t) + D_c g(t) \tag{14}$$<br />where<br />$$w(t) \equiv \begin{bmatrix}<br />y(t) \\<br />\tau (t) \\<br />y_D(t) \\<br />c(t)<br />\end{bmatrix} = [y(t)\; \tau (t)\; y_D(t)\; c(t)]^T \tag{15}$$<br />where I've used lower case versions of SIM's input and measurement variables, except for $T$ for which I've substituted $\tau$ to avoid confusion with the time variable $t$. Now (FINALLY!) we can define these continuous time variables:<br />$$g(t) \equiv \text{the instantaneous rate of gross government expenditure at time} = t \tag{16}$$<br />$$y(t) \equiv \text{the instantaneous rate of accumulating GDP at time} = t \tag{17}$$<br />$$\tau (t) \equiv \text{the instantaneous rate of government tax collection at time} = t \tag{18}$$<br />$$y_D (t) \equiv \text{the instantaneous rate of accumulation of disposable GDP at time} = t \tag{19}$$<br />$$c(t) \equiv \text{the instantaneous rate of consumption at time} = t \tag{20}$$<br />$$H(t) \equiv \text{the instantaneous amount ($``$stock$"$) of cash circulating in the economy at time} = t \tag{21}$$<br />There's a reason I chose to keep $H$ as upper case: namely because it's fundamentally different from the other variables defined above, in that it's a stock. This continuous time version of $H$ still suffers from the odd time offset caused by the timeline relation depicted in figure 2, but otherwise it's a stock, in the same sense that the corresponding discrete time $H$ is a stock in G&L's original SIM model. $H$ is measured in units of money (which for convenience, I'll call dollars). Being rates (or what I call "instantaneous flows" in some places), $g, y, \tau, y_D$, and $c$ are measured in dollars per unit time (what the default sample period $T_{s_0}$ in figure 2 is measured in): thus if we change sample periods, these values (unlike their SIM discrete time counterparts) do not change: they are completely independent of sample period, other than the restriction on $g(t)$ that it be a ZOH function, changing only at the sample times (if we're interested in preserving a sort of equivalence between discrete and continuous time system at every sample time).<br /><br />Given the definitions in $(16)$ through $(20)$ we can define a new set of continuous time functions to relate these continuous time functions to the "flows" in the sense of G&L's original SIM model: that is dollars accumulated over a sample period (note: not just an "original" sample period, but instead over $T_s \equiv \text{the current sample period}$, thus as $T_s \rightarrow 0$ we have $G, Y, T, Y_D, C \rightarrow 0$ as well. To make the relation between our "instantaneous flow" variables in the continuous time model and the flow variables in SIM we establishs a set of continuous time variables with the same names as the discrete time variables, defined as such:<br />$$G(t) \equiv \int_\limits{(n-1)T_s}^{t} g(t') dt',\; \text{for}\; n \in ℤ\; s.t.\; (n-1)T_s < t \leq n T_s \tag{22}$$<br />$$Y(t) \equiv \int_\limits{(n-1)T_s}^{t} y(t') dt',\; \text{for}\;n \in ℤ\; s.t.\; (n-1)T_s < t \leq n T_s \tag{23}$$<br />$$T(t) \equiv \int_\limits{(n-1)T_s}^{t} \tau (t') dt',\; \text{for}\;n \in ℤ\; s.t.\; (n-1)T_s < t \leq n T_s \tag{24}$$<br />$$Y_D (t) \equiv \int_\limits{(n-1)T_s}^{t} y_D (t') dt',\; \text{for}\;n \in ℤ\; s.t.\; (n-1)T_s < t \leq n T_s \tag{25}$$<br />$$C(t) \equiv \int_\limits{(n-1)T_s}^{t} c(t') dt',\; \text{for}\;n \in ℤ\; s.t.\; (n-1)T_s < t \leq n T_s \tag{26}$$<br />I apologize for giving these continuous time variables the same name as their discrete time counterparts (since they'll be offset in time by one sample period ($T_s$) due to the unfortunate relationships depicted in figure 2, but that's how my annotated screen captures are right now, and they'll stay that way unless I find a less overall confusing way to define variables). Thus to distinguish them from the discrete time SIM variables, I will always index them by a time variable (such as $t$) using the usual rounded parenthesis, whereas the discrete time counterparts will always be presented as unindexed, or indexed with a subscripted integer (such as $p$) or using an integer inside square braces ($[\cdot]$). In my op-amp circuits in this post, I only construct $Y(t)$, which has a saw-tooth looking waveform shown in the scope traces at the bottom of figures 0 and 1. $G(t), T(t), Y_D (t)$, and $C(t)$ could all be constructed from their corresponding instantaneous rate variables in the circuit in a similar fashion, and if they were they would also have a similar saw-tooth looking pattern. Now for the final bit relating these saw-tooth curves to their discrete time SIM flow counterparts:<br />$$G[p] \equiv G_p = G(t),\; \text{at}\;t = (p-1)T_s \tag{27}$$<br />$$Y[p] \equiv Y_p = Y(t),\; \text{at}\;t = (p-1)T_s \tag{28}$$<br />$$T[p] \equiv T_p = T(t),\; \text{at}\;t = (p-1)T_s \tag{29}$$<br />$$Y_D[p] \equiv Y_{Dp} = Y_D(t),\; \text{at}\;t = (p-1)T_s \tag{30}$$<br />$$C[p] \equiv C_p = C(t),\; \text{at}\;t = (p-1)T_s \tag{31}$$<br />where again, I use $p$ as the integer index to remind us that this is a SIM period designation. At this point we have one loose end to wrap up, and that's to relate the continuous time $H(t)$ to the discrete time SIM stock $H$, but first we relate $H(t)$ to $g(t)$ and $\tau (t)$ in equations $(16)$ and $(18)$ above:<br />$$H(t) = \int_\limits{-\infty}^{t} g(t')-\tau (t') dt' \tag{33}$$<br />$H(t)$ will <i>not</i> typically have a saw-tooth looking shape (like $G(t)$ for example) because it is not reliant on the sample period (specifically integrating over the sample period) as $G(t)$ and the others are. We could define a $\Delta H$ as G&L do (which would have a sample period dependence), but we'll avoid that complication here. So finally, relating discrete time stock $H$ to continuous time stock $H(t)$ we have:<br />$$H[p] \equiv H_p = H(t),\; \text{at}\; t = (p-1)T_s \tag{34}$$<br />Whew! To bring home the point, lets examine a couple of (slightly altered) details from the above annotated screen shot in figure 0. First figure 3 depicts how the concepts discussed in this section relate to the variables $y(t), Y(t)$ and $Y_p = Y[p]$ for $p = 1, 2$ and $3$ and nearby values of $t \in ℝ$.<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://3.bp.blogspot.com/-FM9ayuXnRQM/Vxm_yuf_ZWI/AAAAAAAAA8M/Flh0mZZHUE8XjX6mAwpF0GdvGXxcA7QNgCLcB/s1600/SIM_op_amp_inst_circ_w_ping_pong_integrators_v05_on_2_prds_annotated_03_y_scope.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://3.bp.blogspot.com/-FM9ayuXnRQM/Vxm_yuf_ZWI/AAAAAAAAA8M/Flh0mZZHUE8XjX6mAwpF0GdvGXxcA7QNgCLcB/s1600/SIM_op_amp_inst_circ_w_ping_pong_integrators_v05_on_2_prds_annotated_03_y_scope.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 3: Modified detail of annotated screen shot of op amp circuit equivalent to SIM showing the y(t) and Y(t) scope traces and associated discrete time Y[p] SIM flow values.</td></tr></tbody></table><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><br />Again note that Y is not unique among the flow variables, it's just that the circuit simulation does not (yet) integrate up the corresponding continuous time instantaneous rate variables ($g, \tau, y_D$ or $c$) to produce any other SIM flow outputs. Doing so would require we add "accountants" (see figure 1) (i.e. a means of integrating these instantaneous rates over each sample period). The circuit currently accomplishes this with a pair of "ping-pong" op amp integrators: one for odd sample periods and one for even. Theoretically, this only requires a single integrator, but the circuit simulator seems to have difficulty modeling the rapid discharge of the integrating capacitor (accomplished via the electrically controlled SPST switch across the capacitor) at the end of each sample period when I attempt that, so I resorted to this dual integrator design, which gives each capacitor adequate time to fully discharge while the other one is being used to do the integration. Each coulomb of charge represents one unit of SIM money (e.g. dollars). <br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://1.bp.blogspot.com/-5SBJTghq6QU/Vxl26vzhG6I/AAAAAAAAA7I/KYAFMAgawEwFaFzvOe3O2M-nAtJHRvwdwCLcB/s1600/SIM_op_amp_inst_circ_w_ping_pong_integrators_v05_on_2_prds_annotated_02_integrator_detail.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://1.bp.blogspot.com/-5SBJTghq6QU/Vxl26vzhG6I/AAAAAAAAA7I/KYAFMAgawEwFaFzvOe3O2M-nAtJHRvwdwCLcB/s1600/SIM_op_amp_inst_circ_w_ping_pong_integrators_v05_on_2_prds_annotated_02_integrator_detail.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><br />Figure 4: Detail of ping-pong integrator circuitry which could be added to any of the rate variables (y(t) in this case) to integrate a corresponding discrete time SIM flow variable</td></tr></tbody></table><br />---------------------------------------------------------------------------------------------------------------<br /><br />From <a href="http://banking-discussion.blogspot.com/2016/03/sim2.html" target="_blank">SIM2's embedded spreadsheet table</a> of G&L's SIM results extended to more sample periods (with Prd <span id="bc_0_81b+seedH5YLD" kind="d">≡ SIM period that G&L list in their <a href="https://3.bp.blogspot.com/-4qdQVxSJbTw/VtjXZe4PW0I/AAAAAAAAJEI/QPBSmHG_o_g/s1600/numerical%2Bgodley%2B1.png" target="_blank">Table 3.4 of numerical results</a>) from their book <a href="http://dl4a.org/uploads/pdf/Monetary%2BEconomics%2B-%2BLavoie%2BGodley.pdf" target="_blank"><i>Monetary Economics </i></a></span><span id="bc_0_81b+seedH5YLD" kind="d"><a href="http://dl4a.org/uploads/pdf/Monetary%2BEconomics%2B-%2BLavoie%2BGodley.pdf" target="_blank"><span id="bc_0_81b+seedH5YLD" kind="d">[pdf]</span></a> ):</span><br /><span id="bc_0_81b+seedH5YLD" kind="d"> </span><span id="bc_0_81b+seedH5YLD" kind="d"> </span><br /><span id="bc_0_81b+seedH5YLD" kind="d">Table 5: G&L's original discrete time SIM extended table of outputs:</span><br /><span id="bc_0_81b+seedH5YLD" kind="d"> </span> <br /><b><u>Prd* G Y T YD C ΔH H </u></b><br />1 0 0 0 0 0 0 0<br />2 20 38.46154 7.692308 30.76923 18.46154 12.30769 12.30769<br />3 20 47.92899 9.585799 38.3432 27.92899 10.4142 22.72189<br />4 20 55.93992 11.18798 44.75193 35.93992 8.812016 31.53391<br />5 20 62.71839 12.54368 50.17471 42.71839 7.456322 38.99023<br />6 20 68.45402 13.6908 54.76322 48.45402 6.309195 45.29943<br />7 20 73.30725 14.66145 58.6458 53.30725 5.33855 50.63798<br />8 20 77.41383 15.48277 61.93106 57.41383 4.517234 55.15521<br />9 20 80.88862 16.17772 64.7109 60.88862 3.822275 58.97749<br />10 20 83.82884 16.76577 67.06307 63.82884 3.234233 62.21172<br />11 20 86.31671 17.26334 69.05337 66.31671 2.736659 64.94838<br />12 20 88.42183 17.68437 70.73746 68.42183 2.315634 67.26401<br />13 20 90.20309 18.04062 72.16247 70.20309 1.959383 69.22339<br />14 20 91.7103 18.34206 73.36824 71.7103 1.657939 70.88133<br />15 20 92.98564 18.59713 74.38851 72.98564 1.402872 72.28421<br />16 20 94.06477 18.81295 75.25182 74.06477 1.187045 73.47125<br />17 20 94.97789 18.99558 75.98231 74.97789 1.004423 74.47567<br />18 20 95.75052 19.1501 76.60041 75.75052 0.849896 75.32557<br />19 20 96.40428 19.28086 77.12343 76.40428 0.719143 76.04471<br />20 20 96.95747 19.39149 77.56598 76.95747 0.608506 76.65322<br />21 20 97.42555 19.48511 77.94044 77.42555 0.514889 77.16811<br />22 20 97.82162 19.56432 78.2573 77.82162 0.435676 77.60378<br />23 20 98.15676 19.63135 78.52541 78.15676 0.368649 77.97243<br />24 20 98.44033 19.68807 78.75227 78.44033 0.311933 78.28437<br />25 20 98.68028 19.73606 78.94423 78.68028 0.263944 78.54831<br />26 20 98.88332 19.77666 79.10665 78.88332 0.223337 78.77165<br />27 20 99.05511 19.81102 79.24409 79.05511 0.188977 78.96062<br />28 20 99.20048 19.8401 79.36038 79.20048 0.159904 79.12053<br /><br />*See figure 2 for an illustration of how G&L's periods (Prd) relate to a continuous time time-line.<br /><br /><a href="http://banking-discussion.blogspot.com/p/blog-page_26.html" target="_blank">Here's a preview of an outline of an upcoming final SIM summary and conclusion post.</a> <br /><br />---------------------------------------------------------------------------------------------------------------<br />NOTES:<br /><br />[1] $ℝ \equiv$ the real numbers, and $ℝ^{n \times m}$ means the set of $n \times m$ dimensional (i.e. $n$ rows and $m$ columns) arrays defined over the field of real numbers. Similarly $ℂ \equiv$ the complex numbers and $ℤ \equiv$ the integers.<br /><br />[2] This statement is somewhat dependent on the model at hand. In many engineering applications the state space system matrices $C$ and $D$ will be the same in both discrete and continuous time because the discrete time model is concerned with sampling the continuous time measurement directly, in whatever units the continuous time model uses for them. In the case of SIM, since the measurements are defined (from the perspective of the underlying continuous time model presented here) in terms of the integrals of the underlying continuous time variables over a particular sample period length window of time, G&L's discrete time outputs are not simply samples of this underlying continuous time system, and thus $C_c \neq C_d$ and $D_c \neq D_d$. However, it is generally true that $A_c \neq A_d$ and $B_c \neq B_d$ in almost all applications (SFC economic models and engineering models alike), although it is often the case that $B_c \approx B_d$ when the sample rate is large compared to the system bandwidth, and the ZOH restriction applies to continuous time input signals $u(t)$. Note that an alternative way to construct an continuous time equivalent to SIM is the method I take in some of my other posts here (such as SIM2) which models these integrals directly, so that samples of the continuous time "flow" variables are equal to SIM discrete time flow variables provided the sample period $T_s = T_{s_0}$ or that an appropriate means of transforming the SIM parameters $\alpha_1, \alpha_2$ and $\theta$ (see SIM1, SIM2 and SIM6) is used when changing to a new sample period.<br />-----------------------------------------------------------------------------------------------------------------------------Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-64158312269181484332016-04-10T04:56:00.001-07:002016-04-19T02:27:05.619-07:00SIM9: highlighting the difference between canonical and non-canonical and between average and instantaneous rates<script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script> <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"> </script>Update: <a href="http://banking-discussion.blogspot.com/p/first-order-lc-circuit-1.html">simple circuit circuit analogy (and interactive simulation) here.</a><br /><br />The math for these plots will be posted at a later time. Please refer to <a href="http://banking-discussion.blogspot.com/2016/04/sim8-discrete-time-and-continuous-time.html" target="_blank">SIM8</a> for now. A couple of quick notes: the canonical output y from SIM8 has been replaced here with w1. The curve w2 is new. Both w1 and w2 are time shifted with respect to their corresponding SIM outputs. I've only included the tax collection rate T (so w1 = T) in the plots for an output (which I've added a subscript of "1" to), but I've worked out the math for the full set of outputs (Y, T, YD and C), which are all time shifted (along with the input G) with respect to the canonical form. The state variable H is aligned in time with the canonical state variable x. But for the others we have:<br /><br />G[n] = u[n-1]<br />T1[n] = w1[n-1]<br />...<br />etc.<br /><br />w1 is a time shifted version of the average tax collection rate over the coming period. w2 is the time shifted instantaneous tax collection rate at the start of the period. This instantaneous rate I call T2, and thus following the above we have T2[n] = w2[n-1]. All the outputs will have two versions like this: average and instantaneous. The older average versions will use the same C and D system matrices, but the newer instantaneous ones will need new C and D matrices. Those details are coming in later updates to this post.<br /><br />I've reluctantly decided to abandon y for the name of the canonical output variable in favor of w. I'm tired of the name collisions between SIM variables and canonical variable names, so I'll try to sort this out. Also, the lower case Latin letter versions with the "dots" are OK for the average rates, but I found it easier to just adopt a whole new set for continuous time based on lower case Greek letters. I'll explain the convention in later updates.<br /><br />This difference between the average and the instantaneous and between the canonical and non-canonical variables has been bothering me for some time, so I think will finally completely sort all this out, but I need wait until further updates to write it down. I thought I'd put the plots up now however: perhaps they can provide a little bit of clarity (probably not! Lol):<br /><br />UPDATE: 2016.04.12: Updated the figures and added a second canonical one with the same curves but different annotations. <br /><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://4.bp.blogspot.com/-kLbM01aQ8AE/VwyyqW-xd0I/AAAAAAAAA1Q/n5Yb6cuYAyE7ksPnwDKX1exB6ZTcOfSkwCLcB/s1600/SIM8_Canonical_Curves1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://4.bp.blogspot.com/-kLbM01aQ8AE/VwyyqW-xd0I/AAAAAAAAA1Q/n5Yb6cuYAyE7ksPnwDKX1exB6ZTcOfSkwCLcB/s1600/SIM8_Canonical_Curves1.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 1: Canonical #1</td></tr></tbody></table><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://2.bp.blogspot.com/-xtBa186ArhA/Vwy_OHIjiCI/AAAAAAAAA2E/bDgBi0DCPecSbCfy3gabhKsDqX70iZlYACLcB/s1600/SIM8_Canonical_Curves2_v3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://2.bp.blogspot.com/-xtBa186ArhA/Vwy_OHIjiCI/AAAAAAAAA2E/bDgBi0DCPecSbCfy3gabhKsDqX70iZlYACLcB/s1600/SIM8_Canonical_Curves2_v3.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 2: Canonical #2 (curves are the same as Canonical #1, but annotation is different)</td></tr></tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://2.bp.blogspot.com/-499Epgd9QlI/VwyyBrWOavI/AAAAAAAAA1E/2lIWe8WQ2C8EKj6FxndN_DNYzNqFueUIA/s1600/SIM8_NonCanonical_Curves.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://2.bp.blogspot.com/-499Epgd9QlI/VwyyBrWOavI/AAAAAAAAA1E/2lIWe8WQ2C8EKj6FxndN_DNYzNqFueUIA/s1600/SIM8_NonCanonical_Curves.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 3: Non-canonical</td></tr></tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://4.bp.blogspot.com/-lm1dZP-AKog/VwyyfuqdQvI/AAAAAAAAA1I/YaJ9F2bJ1MsQaV7GIYTamiGDTNF42p-tACLcB/s1600/SIM8_All_Curves.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://4.bp.blogspot.com/-lm1dZP-AKog/VwyyfuqdQvI/AAAAAAAAA1I/YaJ9F2bJ1MsQaV7GIYTamiGDTNF42p-tACLcB/s1600/SIM8_All_Curves.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 4: All curves</td></tr></tbody></table><div class="separator" style="clear: both; text-align: center;"></div>Update 2016.04.18: if we define P (previously referred to as $X$ in SIM7) as:<br />$$P = 1-\alpha_1 (1-\theta) \tag 1$$<br />Then we can write the elements of the "instantaneous" version of the state space representation measurement matrices ($C_{inst}$ and $D_{inst}$ in terms of their 1-period-sliding-window-average state space measurement matrices ($C_m$ (or $C_{avg}$) and $D_m$ (or $D_{avg}$)) as follows (where $i$ is the index of the $i^{th}$ row (i.e. $i^{th}$ element) of these 4x1 matrices):<br />$$C_{{inst}_i} = -\frac{C_{{avg}_i} P}{\alpha_2 \theta} a \tag 2$$<br />$$D_{{inst}_i} = D_{{avg}_i} - \frac{C_{{avg}_i} P}{\alpha_2 \theta} (b - B) \tag 3$$<br />Up to this time we've only calculated the $C_m$ and $D_m$ matrices. Here are the full set of values (including for the op-amp implementation of SIM) for the default parameter values of SIM (i.e. $\alpha_1 = 0.6,\, alpha_2 = 0.4$ and $\theta = 0.2$.<br /><br /><br /><table border="0" cellpadding="0" cellspacing="0" style="width: 550px;"><colgroup><col style="mso-width-alt: 2998; mso-width-source: userset; width: 62pt;" width="82"></col> <col style="mso-width-alt: 3035; mso-width-source: userset; width: 62pt;" width="83"></col> <col style="mso-width-alt: 4900; mso-width-source: userset; width: 101pt;" width="134"></col> <col style="mso-width-alt: 4608; mso-width-source: userset; width: 95pt;" width="126"></col> <col style="mso-width-alt: 4571; mso-width-source: userset; width: 94pt;" width="125"></col> </colgroup><tbody><tr height="20" style="height: 15.0pt;"> <td class="xl63" height="20" style="height: 15.0pt; width: 62pt;" width="82"><table border="0" cellpadding="0" cellspacing="0" style="width: 630px;"><colgroup><col style="mso-width-alt: 4022; mso-width-source: userset; width: 83pt;" width="110"></col> <col style="mso-width-alt: 4278; mso-width-source: userset; width: 88pt;" width="117"></col> <col style="mso-width-alt: 5558; mso-width-source: userset; width: 114pt;" width="152"></col> <col style="mso-width-alt: 4608; mso-width-source: userset; width: 95pt;" width="126"></col> <col style="mso-width-alt: 4571; mso-width-source: userset; width: 94pt;" width="125"></col> </colgroup><tbody><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="height: 15.0pt; width: 83pt;" width="110"><table border="0" cellpadding="0" cellspacing="0" style="width: 630px;"><colgroup><col style="mso-width-alt: 4022; mso-width-source: userset; width: 83pt;" width="110"></col> <col style="mso-width-alt: 4278; mso-width-source: userset; width: 88pt;" width="117"></col> <col style="mso-width-alt: 5558; mso-width-source: userset; width: 114pt;" width="152"></col> <col style="mso-width-alt: 4608; mso-width-source: userset; width: 95pt;" width="126"></col> <col style="mso-width-alt: 4571; mso-width-source: userset; width: 94pt;" width="125"></col> </colgroup><tbody><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="height: 15.0pt; width: 83pt;" width="110">Name</td> <td class="xl65" style="border-left: none; width: 88pt;" width="117">value</td> <td class="xl65" style="border-left: none; width: 114pt;" width="152">1/value</td> <td class="xl65" style="border-left: none; width: 95pt;" width="126">Instantaneous<span style="mso-spacerun: yes;"> </span></td> <td class="xl65" style="border-left: none; width: 94pt;" width="125">1/Instantaneous</td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">A</td> <td class="xl65" style="border-left: none; border-top: none;"><a href="https://www.blogger.com/null" name="RANGE!B2">0.846153846</a></td> <td class="xl65" style="border-left: none; border-top: none;">N/A (discrete time)</td> <td class="xl65" style="border-left: none; border-top: none;"></td> <td class="xl66" style="border-left: none; border-top: none;"></td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">B</td> <td class="xl65" style="border-left: none; border-top: none;"><a href="https://www.blogger.com/null" name="RANGE!B3">0.615384615</a></td> <td class="xl65" style="border-left: none; border-top: none;">N/A (discrete time)</td> <td class="xl65" style="border-left: none; border-top: none;"></td> <td class="xl66" style="border-left: none; border-top: none;"></td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">a_cont</td> <td class="xl65" style="border-left: none; border-top: none;"><a href="https://www.blogger.com/null" name="RANGE!B4">-0.167054085</a></td> <td class="xl67" style="border-left: none; border-top: none;">-5.9860852970</td> <td class="xl65" style="border-left: none; border-top: none;"></td> <td class="xl66" style="border-left: none; border-top: none;"></td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">b_cont</td> <td class="xl65" style="border-left: none; border-top: none;"><a href="https://www.blogger.com/null" name="RANGE!B5">0.668216339</a></td> <td class="xl67" style="border-left: none; border-top: none;">1.4965213242</td> <td class="xl65" style="border-left: none; border-top: none;"></td> <td class="xl66" style="border-left: none; border-top: none;"></td> </tr><tr height="24" style="height: 18.0pt;"> <td class="xl65" height="24" style="border-top: none; height: 18.0pt;">C<span class="font5"><sub>avg</sub></span><span class="font0"> = C</span><span class="font5"><sub>m</sub></span></td> <td class="xl65" style="border-left: none; border-top: none;"></td> <td class="xl67" style="border-left: none; border-top: none;"></td> <td class="xl65" style="border-left: none; border-top: none;">C<span class="font5"><sub>inst</sub></span><span class="font0"><span style="mso-spacerun: yes;"> </span></span></td> <td class="xl66" style="border-left: none; border-top: none;"></td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">CY</td> <td class="xl65" style="border-left: none; border-top: none;">0.769230769</td> <td class="xl67" style="border-left: none; border-top: none;">1.3000000000</td> <td class="xl65" style="border-left: none; border-top: none;">0.835270423</td> <td align="right" class="xl66" style="border-left: none; border-top: none;">1.197217059</td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">CT</td> <td class="xl65" style="border-left: none; border-top: none;">0.153846154</td> <td class="xl67" style="border-left: none; border-top: none;">6.5000000000</td> <td class="xl65" style="border-left: none; border-top: none;">0.167054085</td> <td align="right" class="xl66" style="border-left: none; border-top: none;">5.986085297</td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">CYD</td> <td class="xl65" style="border-left: none; border-top: none;">0.615384615</td> <td class="xl67" style="border-left: none; border-top: none;">1.6250000000</td> <td class="xl65" style="border-left: none; border-top: none;">0.668216339</td> <td align="right" class="xl66" style="border-left: none; border-top: none;">1.496521324</td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">CC</td> <td class="xl65" style="border-left: none; border-top: none;">0.769230769</td> <td class="xl67" style="border-left: none; border-top: none;">1.3000000000</td> <td class="xl65" style="border-left: none; border-top: none;">0.835270423</td> <td align="right" class="xl66" style="border-left: none; border-top: none;">1.197217059</td> </tr><tr height="24" style="height: 18.0pt;"> <td class="xl65" height="24" style="border-top: none; height: 18.0pt;">D<span class="font5"><sub>avg</sub></span><span class="font0"> = D</span><span class="font5"><sub>m</sub></span></td> <td class="xl65" style="border-left: none; border-top: none;"></td> <td class="xl67" style="border-left: none; border-top: none;"></td> <td class="xl65" style="border-left: none; border-top: none;">D<span class="font5"><sub>inst</sub></span><span class="font0"><span style="mso-spacerun: yes;"> </span></span></td> <td class="xl66" style="border-left: none; border-top: none;"></td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">DY</td> <td class="xl65" style="border-left: none; border-top: none;">1.923076923</td> <td class="xl67" style="border-left: none; border-top: none;">0.5200000000</td> <td class="xl65" style="border-left: none; border-top: none;">1.658918307</td> <td align="right" class="xl66" style="border-left: none; border-top: none;">0.602802438</td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">DT</td> <td class="xl65" style="border-left: none; border-top: none;">0.384615385</td> <td class="xl67" style="border-left: none; border-top: none;">2.6000000000</td> <td class="xl65" style="border-left: none; border-top: none;">0.331783661</td> <td align="right" class="xl66" style="border-left: none; border-top: none;">3.014012191</td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">DYD</td> <td class="xl65" style="border-left: none; border-top: none;">1.538461538</td> <td class="xl67" style="border-left: none; border-top: none;">0.6500000000</td> <td class="xl65" style="border-left: none; border-top: none;">1.327134645</td> <td align="right" class="xl66" style="border-left: none; border-top: none;">0.753503048</td> </tr><tr height="20" style="height: 15.0pt;"> <td class="xl65" height="20" style="border-top: none; height: 15.0pt;">DC</td> <td class="xl65" style="border-left: none; border-top: none;">0.923076923</td> <td class="xl67" style="border-left: none; border-top: none;">1.0833333333</td> <td class="xl65" style="border-left: none; border-top: none;">0.658918307</td> <td align="right" class="xl66" style="border-left: none; border-top: none;">1.517638818</td> </tr></tbody></table><br /><a href="http://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.002+38.696464541249114+23+25+50%0Aa+704+112+672+112+0+500+-500+1000000%0Ar+656+48+720+48+0+5.98608546406%0Aw+656+112+656+80+0%0Aw+720+80+720+96+0%0Ar+720+96+768+96+0+1.49652132346%0Ag+720+128+720+144+0%0Aw+704+96+720+96+0%0Aw+704+128+720+128+0%0Aw+656+112+672+112+0%0Ac+720+80+656+80+0+1+1.786713458521895e-18%0Aw+656+80+656+48+0%0Aw+720+80+720+48+0%0AO+432+128+384+128+1%0Aw+544+464+544+448+0%0Aw+544+224+544+208+0%0AR+992+96+1024+96+0+0+40+20+0+0+0.5%0Aw+480+224+496+224+0%0Aw+528+240+544+240+0%0Aw+528+208+544+208+0%0Ar+544+224+592+224+0+1.197217059%0Aw+544+192+544+208+0%0Aw+480+224+480+192+0%0Ar+480+192+544+192+0+1%0Aa+528+224+496+224+0+500+-500+1000000%0Aw+544+288+544+304+0%0Aw+432+224+480+224+1%0Aw+544+384+544+368+0%0Aw+656+304+656+224+0%0Aw+656+304+656+384+0%0Aw+656+384+656+464+0%0Aw+432+304+480+304+1%0Aa+528+304+496+304+0+500+-500+1000000%0Ar+480+272+544+272+0+1%0Aw+480+304+480+272+0%0Aw+544+272+544+288+0%0Ar+544+304+592+304+0+5.986085297%0Aw+528+288+544+288+0%0Aw+528+320+544+320+0%0Aw+480+304+496+304+0%0Aw+432+384+480+384+1%0Aa+528+384+496+384+0+500+-500+1000000%0Ar+480+352+544+352+0+1%0Aw+480+384+480+352+0%0Aw+544+352+544+368+0%0Ar+544+384+592+384+0+1.496521324%0Aw+528+368+544+368+0%0Aw+528+400+544+400+0%0Aw+480+384+496+384+0%0Aw+432+464+480+464+1%0Aa+528+464+496+464+0+500+-500+1000000%0Ar+480+432+544+432+0+1%0Aw+480+464+480+432+0%0Aw+544+432+544+448+0%0Ar+544+464+592+464+0+1.197217059%0Aw+528+448+544+448+0%0Aw+528+480+544+480+0%0Aw+480+464+496+464+0%0Aw+656+112+656+224+0%0Aw+832+192+592+192+0%0Aw+832+352+592+352+0%0Aw+832+432+592+432+0%0Aw+832+432+832+352+0%0Aw+2368+416+2336+416+0%0Aw+592+224+656+224+0%0Aw+592+304+656+304+0%0Aw+592+384+656+384+0%0Aw+592+464+656+464+0%0Ar+544+192+592+192+0+0.602802438%0Ar+544+272+592+272+0+3.014012191%0Ar+544+352+592+352+0+0.753503048%0Ar+704+-400+752+-400+0+1%0Ar+2384+528+2432+528+0+1%0Ar+544+432+592+432+0+1.517638818%0Aw+832+192+832+272+0%0Aw+960+160+960+96+0%0Aw+832+272+832+352+0%0Ar+896+160+944+160+0+1%0Aw+960+160+944+160+0%0Aw+832+192+848+192+0%0Aa+880+192+848+192+0+500+-500+1000000%0Ar+832+160+896+160+0+1%0Aw+832+192+832+160+0%0Aw+896+160+896+176+0%0Aw+880+176+896+176+0%0Aw+880+208+896+208+0%0Aw+960+96+768+96+2%0Ag+544+320+544+336+0%0Ag+544+400+544+416+0%0Ag+896+208+896+224+0%0Ag+544+480+544+496+0%0Ag+544+240+544+256+0%0Aw+832+272+592+272+0%0Ag+544+144+544+160+0%0Aw+480+128+496+128+0%0Aw+528+144+544+144+0%0Aw+528+112+544+112+0%0Aw+544+96+544+112+0%0Aw+480+128+480+96+0%0Ar+480+96+544+96+0+1%0Aa+528+128+496+128+0+500+-500+1000000%0Aw+432+128+480+128+0%0Aw+656+112+592+112+2%0Ar+544+112+592+112+0+1%0AO+432+224+384+224+1%0AO+432+304+384+304+1%0AO+432+384+384+384+1%0AO+432+464+384+464+1%0As+960+96+992+96+0+1+false%0Ar+432+304+432+336+0+1%0Ar+432+384+432+416+0+1%0Ar+432+464+432+496+0+1%0Ar+432+224+432+256+0+1%0Ag+432+256+432+272+0%0Ag+432+336+432+352+0%0Ag+432+416+432+432+0%0Ag+432+496+432+512+0%0Ao+9+64+0+550+0.0000762939453125+0.00009765625+0+-1%0A" target="_blank">A preliminary implementation of this instantaneous version of the op amp SIM circuit is here</a>.<br /><br /><a href="http://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.002+38.696464541249114+23+25+50%0Aa+704+112+672+112+0+500+-500+1000000%0Ar+720+128+784+128+0+5.98608546406%0Aw+656+112+656+64+0%0Ar+720+64+768+64+0+0.08%0Ag+720+160+720+176+0%0Aw+704+96+720+96+0%0Aw+704+128+720+128+0%0Aw+656+112+672+112+0%0Ac+720+160+720+128+0+1+2.0591683361616522e-8%0Aw+720+96+720+64+0%0Aw+544+464+544+448+0%0Aw+544+224+544+208+0%0Aw+480+224+496+224+0%0Aw+528+240+544+240+0%0Aw+528+208+544+208+0%0Ar+544+224+592+224+0+1.197217059%0Aw+544+192+544+208+0%0Aw+480+224+480+192+0%0Ar+480+192+544+192+0+1%0Aa+528+224+496+224+0+500+-500+1000000%0Aw+544+288+544+304+0%0Aw+432+224+480+224+1%0Aw+544+384+544+368+0%0Aw+656+304+656+224+0%0Aw+656+304+656+384+0%0Aw+656+384+656+464+0%0Aw+432+304+480+304+1%0Aa+528+304+496+304+0+500+-500+1000000%0Ar+480+272+544+272+0+1%0Aw+480+304+480+272+0%0Aw+544+272+544+288+0%0Ar+544+304+592+304+0+5.986085297%0Aw+528+288+544+288+0%0Aw+528+320+544+320+0%0Aw+480+304+496+304+0%0Aw+432+384+480+384+1%0Aa+528+384+496+384+0+500+-500+1000000%0Ar+480+352+544+352+0+1%0Aw+480+384+480+352+0%0Aw+544+352+544+368+0%0Ar+544+384+592+384+0+1.496521324%0Aw+528+368+544+368+0%0Aw+528+400+544+400+0%0Aw+480+384+496+384+0%0Aw+432+464+480+464+1%0Aa+528+464+496+464+0+500+-500+1000000%0Ar+480+432+544+432+0+1%0Aw+480+464+480+432+0%0Aw+544+432+544+448+0%0Ar+544+464+592+464+0+1.197217059%0Aw+528+448+544+448+0%0Aw+528+480+544+480+0%0Aw+480+464+496+464+0%0Aw+656+112+656+224+0%0Aw+800+192+592+192+0%0Aw+800+352+592+352+0%0Aw+800+432+592+432+0%0Aw+800+432+800+352+0%0Aw+2368+416+2336+416+0%0Aw+592+224+656+224+0%0Aw+592+304+656+304+0%0Aw+592+384+656+384+0%0Aw+592+464+656+464+0%0Ar+544+192+592+192+0+0.602802438%0Ar+544+272+592+272+0+3.014012191%0Ar+544+352+592+352+0+0.753503048%0Ar+704+-400+752+-400+0+1%0Ar+2384+528+2432+528+0+1%0Ar+544+432+592+432+0+1.517638818%0Aw+800+192+800+272+0%0Aw+800+192+800+128+0%0Aw+800+272+800+352+0%0Aw+800+128+784+128+2%0Ag+544+320+544+336+0%0Ag+544+400+544+416+0%0Ag+768+64+768+80+0%0Ag+544+480+544+496+0%0Ag+544+240+544+256+0%0Aw+800+272+592+272+0%0AO+432+224+384+224+1%0AO+432+304+384+304+1%0AO+432+384+384+384+1%0AO+432+464+384+464+1%0As+800+128+848+128+0+1+false%0Ar+432+304+432+336+0+1%0Ar+432+384+432+416+0+1%0Ar+432+464+432+496+0+1%0Ar+432+224+432+256+0+1%0Ag+432+256+432+272+0%0Ag+432+336+432+352+0%0Ag+432+416+432+432+0%0Ag+432+496+432+512+0%0Ar+720+64+656+64+0+0.24%0AR+848+128+880+128+0+0+40+-20+0+0+0.5%0Ao+8+64+0+34+0.009765625+0.00009765625+0+-1%0A">Same functionality with only 5 instead of 7 op amps.</a><br /><br /><a href="http://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.002+38.696464541249114+23+25+50%0Aa+704+144+672+144+0+500+-500+1000000%0Ar+656+80+720+80+0+5.98608546406%0Aw+656+144+656+112+0%0Aw+720+112+720+128+0%0Ar+720+128+768+128+0+1.49652132346%0Ag+720+160+720+176+0%0Aw+704+128+720+128+0%0Aw+704+160+720+160+0%0Aw+656+144+672+144+0%0Ac+720+112+656+112+0+1+0.0002635203471651063%0Aw+656+112+656+80+0%0Aw+720+112+720+80+0%0Aw+592+464+592+448+0%0Aw+592+224+592+208+0%0AR+896+128+928+128+0+0+40+20+0+0+0.5%0Aw+528+224+544+224+0%0Aw+576+240+592+240+0%0Aw+576+208+592+208+0%0Ar+592+224+656+224+0+1.197217059%0Aw+592+192+592+208+0%0Aw+528+224+528+192+0%0Ar+528+192+592+192+0+1%0Aa+576+224+544+224+0+500+-500+1000000%0Aw+592+288+592+304+0%0Aw+480+224+528+224+1%0Aw+592+384+592+368+0%0Aw+656+304+656+224+0%0Aw+656+304+656+384+0%0Aw+656+384+656+464+0%0Aw+480+304+528+304+1%0Aa+576+304+544+304+0+500+-500+1000000%0Ar+528+272+592+272+0+1%0Aw+528+304+528+272+0%0Aw+592+272+592+288+0%0Ar+592+304+656+304+0+5.986085297%0Aw+576+288+592+288+0%0Aw+576+320+592+320+0%0Aw+528+304+544+304+0%0Aw+480+384+528+384+1%0Aa+576+384+544+384+0+500+-500+1000000%0Ar+528+352+592+352+0+1%0Aw+528+384+528+352+0%0Aw+592+352+592+368+0%0Ar+592+384+656+384+0+1.496521324%0Aw+576+368+592+368+0%0Aw+576+400+592+400+0%0Aw+528+384+544+384+0%0Aw+480+464+528+464+1%0Aa+576+464+544+464+0+500+-500+1000000%0Ar+528+432+592+432+0+1%0Aw+528+464+528+432+0%0Aw+592+432+592+448+0%0Ar+592+464+656+464+0+1.197217059%0Aw+576+448+592+448+0%0Aw+576+480+592+480+0%0Aw+528+464+544+464+0%0Aw+656+144+656+224+0%0Aw+752+192+640+192+0%0Aw+752+352+640+352+0%0Aw+752+432+640+432+0%0Aw+752+432+752+352+0%0Aw+2368+416+2336+416+0%0Ar+592+192+640+192+0+0.602802438%0Ar+592+272+640+272+0+3.014012191%0Ar+592+352+640+352+0+0.753503048%0Ar+704+-400+752+-400+0+1%0Ar+2384+528+2432+528+0+1%0Ar+592+432+640+432+0+1.517638818%0Aw+752+160+752+192+0%0Aw+752+272+752+352+0%0Ar+816+176+864+176+0+1%0Aw+800+208+816+208+0%0Aa+800+192+768+192+0+500+-500+1000000%0Ar+752+160+816+160+0+1%0Aw+816+176+816+160+0%0Aw+752+272+752+192+0%0Aw+800+176+816+176+0%0Aw+752+192+768+192+0%0Aw+864+128+768+128+2%0Ag+592+320+592+336+0%0Ag+592+400+592+416+0%0Ag+816+208+816+224+0%0Ag+592+480+592+496+0%0Ag+592+240+592+256+0%0Aw+752+272+640+272+0%0As+864+128+896+128+0+1+false%0Ar+480+304+480+336+0+1%0Ar+480+384+480+416+0+1%0Ar+480+464+480+496+0+1%0Ar+480+224+480+256+0+1%0Ag+480+256+480+272+0%0Ag+480+336+480+352+0%0Ag+480+416+480+432+0%0Ag+480+496+480+512+0%0AO+656+144+608+144+1%0Aw+864+128+864+176+1%0Ao+95+64+0+33+0.0000762939453125+0.00009765625+0+-1%0Ao+9+64+0+34+0.009765625+0.00009765625+1+-1%0Ao+89+64+0+33+0.0006103515625+0.00625+2+-1%0Ao+86+64+0+33+0.000152587890625+0.0015625+3+-1%0Ao+87+64+0+33+0.0006103515625+0.00625+4+-1%0Ao+88+64+0+33+0.0006103515625+0.00625+5+-1%0A" target="_blank">Same functionality, but preserving H volts on capacitor and using 6 instead of 7 op amps.</a><br /><br /><a href="http://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.001+0.6798259793203881+19+25+50%0Aa+704+144+672+144+0+500+-500+1000000%0Ar+656+80+720+80+0+5.98608546406%0Aw+656+144+656+112+0%0Aw+720+112+720+128+0%0Ar+720+128+768+128+0+1.49652132346%0Ag+720+160+720+176+0%0Aw+704+128+720+128+0%0Aw+704+160+720+160+0%0Aw+656+144+672+144+0%0Ac+720+112+656+112+0+1+0.0009290533789148018%0Aw+656+112+656+80+0%0Aw+720+112+720+80+0%0Aw+592+464+592+448+0%0Aw+592+224+592+208+0%0AR+896+128+928+128+0+0+40+20+0+0+0.5%0Aw+528+224+544+224+0%0Aw+576+240+592+240+0%0Aw+576+208+592+208+0%0Ar+592+224+656+224+0+1.197217059%0Aw+592+192+592+208+0%0Aw+528+224+528+192+0%0Ar+528+192+592+192+0+1%0Aa+576+224+544+224+0+500+-500+1000000%0Aw+592+288+592+304+0%0Aw+480+224+528+224+0%0Aw+592+384+592+368+0%0Aw+656+304+656+224+0%0Aw+656+304+656+384+0%0Aw+656+384+656+464+0%0Aw+480+304+528+304+1%0Aa+576+304+544+304+0+500+-500+1000000%0Ar+528+272+592+272+0+1%0Aw+528+304+528+272+0%0Aw+592+272+592+288+0%0Ar+592+304+656+304+0+5.986085297%0Aw+576+288+592+288+0%0Aw+576+320+592+320+0%0Aw+528+304+544+304+0%0Aw+480+384+528+384+1%0Aa+576+384+544+384+0+500+-500+1000000%0Ar+528+352+592+352+0+1%0Aw+528+384+528+352+0%0Aw+592+352+592+368+0%0Ar+592+384+656+384+0+1.496521324%0Aw+576+368+592+368+0%0Aw+576+400+592+400+0%0Aw+528+384+544+384+0%0Aw+480+464+528+464+1%0Aa+576+464+544+464+0+500+-500+1000000%0Ar+528+432+592+432+0+1%0Aw+528+464+528+432+0%0Aw+592+432+592+448+0%0Ar+592+464+656+464+0+1.197217059%0Aw+576+448+592+448+0%0Aw+576+480+592+480+0%0Aw+528+464+544+464+0%0Aw+656+144+656+224+0%0Aw+752+192+640+192+0%0Aw+752+352+640+352+0%0Aw+752+432+640+432+0%0Aw+752+432+752+352+0%0Aw+2368+416+2336+416+0%0Ar+592+192+640+192+0+0.602802438%0Ar+592+272+640+272+0+3.014012191%0Ar+592+352+640+352+0+0.753503048%0Ar+704+-400+752+-400+0+1%0Ar+2384+528+2432+528+0+1%0Ar+592+432+640+432+0+1.517638818%0Aw+752+160+752+192+0%0Aw+752+272+752+352+0%0Ar+816+176+864+176+0+1%0Aw+800+208+816+208+0%0Aa+800+192+768+192+0+500+-500+1000000%0Ar+752+160+816+160+0+1%0Aw+816+176+816+160+0%0Aw+752+272+752+192+0%0Aw+800+176+816+176+0%0Aw+752+192+768+192+0%0Aw+864+128+768+128+2%0Ag+592+320+592+336+0%0Ag+592+400+592+416+0%0Ag+816+208+816+224+0%0Ag+592+480+592+496+0%0Ag+592+240+592+256+0%0Aw+752+272+640+272+0%0As+864+128+896+128+0+1+false%0Ar+480+304+480+336+0+1%0Ar+480+384+480+416+0+1%0Ar+480+464+480+496+0+1%0Ar+480+240+480+272+0+1%0Ag+480+272+480+288+0%0Ag+480+336+480+352+0%0Ag+480+416+480+432+0%0Ag+480+496+480+512+0%0AO+656+144+608+144+1%0Aw+864+128+864+176+1%0Aa+400+240+368+240+0+500+-500+1000000%0Aw+400+224+416+224+0%0Ac+416+192+352+192+0+1+-3.44290152087788e-7%0Aw+416+224+416+192+0%0Aw+352+192+352+240+0%0Aw+368+240+352+240+0%0Aw+400+256+416+256+0%0Ag+416+256+416+272+0%0A159+416+160+352+160+0+0.000001+100000000000%0Ar+416+224+480+224+0+1%0Aw+416+192+416+160+0%0Aw+352+192+352+160+0%0AR+384+144+384+112+1+2+0.5+1.5+1.5+0+0.5%0AO+384+144+272+144+1%0Aw+480+240+480+224+1%0Ao+95+64+0+33+0.0000762939453125+0.00009765625+0+-1%0Ao+9+64+0+34+0.009765625+0.00009765625+1+-1%0Ao+89+64+0+33+0.0006103515625+0.00625+2+-1%0Ao+86+64+0+33+0.000152587890625+0.0015625+3+-1%0Ao+87+64+0+33+0.0006103515625+0.00625+4+-1%0Ao+88+64+0+33+0.0006103515625+0.00625+5+-1%0Ao+108+64+0+34+10+0.00009765625+6+-1%0Ao+98+64+0+34+0.009765625+1.6+7+-1%0A" target="_blank">Same thing, but with integrator on the Y output (1/2 of a ping pong integrator)</a><br /><br /><a href="http://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.001+0.9487735836358526+19+25+50%0Aa+832+160+800+160+0+500+-500+1000000%0Ar+784+96+848+96+0+5.98608546406%0Aw+784+160+784+128+0%0Aw+848+128+848+144+0%0Ar+848+144+896+144+0+1.49652132346%0Ag+848+176+848+192+0%0Aw+832+144+848+144+0%0Aw+832+176+848+176+0%0Aw+784+160+800+160+0%0Ac+848+128+784+128+2+1+5.158109520006618e-11%0Aw+784+128+784+96+0%0Aw+848+128+848+96+0%0Aw+720+480+720+464+0%0Aw+720+240+720+224+0%0AR+1056+144+1088+144+0+0+40+20+0+0+0.5%0Aw+656+240+672+240+0%0Aw+704+256+720+256+0%0Aw+704+224+720+224+0%0Ar+720+240+784+240+0+1.197217059%0Aw+720+208+720+224+0%0Aw+656+240+656+208+0%0Ar+656+208+720+208+0+1%0Aa+704+240+672+240+0+500+-500+1000000%0Aw+720+304+720+320+0%0Aw+608+240+656+240+0%0Aw+720+400+720+384+0%0Aw+784+320+784+240+0%0Aw+784+320+784+400+0%0Aw+784+400+784+480+0%0Aw+608+320+656+320+1%0Aa+704+320+672+320+0+500+-500+1000000%0Ar+656+288+720+288+0+1%0Aw+656+320+656+288+0%0Aw+720+288+720+304+0%0Ar+720+320+784+320+0+5.986085297%0Aw+704+304+720+304+0%0Aw+704+336+720+336+0%0Aw+656+320+672+320+0%0Aw+608+400+656+400+1%0Aa+704+400+672+400+0+500+-500+1000000%0Ar+656+368+720+368+0+1%0Aw+656+400+656+368+0%0Aw+720+368+720+384+0%0Ar+720+400+784+400+0+1.496521324%0Aw+704+384+720+384+0%0Aw+704+416+720+416+0%0Aw+656+400+672+400+0%0Aw+608+480+656+480+1%0Aa+704+480+672+480+0+500+-500+1000000%0Ar+656+448+720+448+0+1%0Aw+656+480+656+448+0%0Aw+720+448+720+464+0%0Ar+720+480+784+480+0+1.197217059%0Aw+704+464+720+464+0%0Aw+704+496+720+496+0%0Aw+656+480+672+480+0%0Aw+784+160+784+240+0%0Aw+880+208+768+208+0%0Aw+880+368+768+368+0%0Aw+880+448+768+448+0%0Aw+880+448+880+368+0%0Aw+2384+400+2352+400+0%0Ar+720+208+768+208+0+0.602802438%0Ar+720+288+768+288+0+3.014012191%0Ar+720+368+768+368+0+0.753503048%0Ar+720+-416+768+-416+0+1%0Ar+2400+512+2448+512+0+1%0Ar+720+448+768+448+0+1.517638818%0Aw+880+176+880+208+0%0Aw+880+288+880+368+0%0Ar+944+192+992+192+0+1%0Aw+928+224+944+224+0%0Aa+928+208+896+208+0+500+-500+1000000%0Ar+880+176+944+176+0+1%0Aw+944+192+944+176+0%0Aw+880+288+880+208+0%0Aw+928+192+944+192+0%0Aw+880+208+896+208+0%0Aw+992+144+896+144+2%0Ag+720+336+720+352+0%0Ag+720+416+720+432+0%0Ag+944+224+944+240+0%0Ag+720+496+720+512+0%0Ag+720+256+720+272+0%0Aw+880+288+768+288+0%0Ar+608+320+608+352+0+1%0Ar+608+400+608+432+0+1%0Ar+608+480+608+512+0+1%0Ar+608+256+608+288+0+1%0Ag+608+288+608+304+0%0Ag+608+352+608+368+0%0Ag+608+432+608+448+0%0Ag+608+512+608+528+0%0AO+784+160+736+160+1%0Aw+992+144+992+192+1%0Aa+368+192+336+192+0+500+-500+1000000%0Aw+368+176+384+176+0%0Ac+384+160+320+160+2+1+2.2007865899961173e-11%0Aw+384+176+384+160+0%0Aw+320+160+320+192+0%0Aw+336+192+320+192+0%0Aw+368+208+384+208+0%0Ag+384+208+384+224+0%0A159+384+128+320+128+0+1e-12+1000000000000%0Ar+384+176+432+176+0+1%0Aw+384+160+384+128+0%0Aw+320+160+320+128+0%0AR+416+112+416+80+1+2+0.5+1.5+1.5+3.141592653589793+0.5%0Aw+608+256+608+240+1%0Aw+576+240+432+240+0%0Aw+464+160+464+128+0%0Aw+528+160+528+128+0%0Ar+528+176+576+176+0+1%0A159+528+128+464+128+1+1e-11+1000000000000%0Ag+528+208+528+224+0%0Aw+512+208+528+208+0%0Aw+480+192+464+192+0%0Aw+464+160+464+192+0%0Aw+528+176+528+160+0%0Ac+528+160+464+160+2+1+6.297012356801378e-22%0Aw+512+176+528+176+0%0Aa+512+192+480+192+0+500+-500+1000000%0Aw+576+240+576+176+0%0Aw+608+240+576+240+0%0Aw+432+240+432+176+0%0Aw+416+112+496+112+0%0Aw+416+112+352+112+0%0A159+1056+144+1024+144+0+1e-11+1000000000000%0Aw+496+112+608+112+2%0Aw+704+80+704+64+0%0Aw+704+64+1040+64+0%0Aw+1040+64+1040+128+0%0Aw+1024+144+992+144+0%0A155+608+80+640+80+0+0%0AS+608+80+608+16+0+0+false+0%0AR+624+16+656+16+0+0+40+5+0+0+0.5%0Aw+592+16+560+16+0%0Ag+560+16+560+32+0%0Ao+94+64+0+33+0.0000762939453125+0.00009765625+0+-1%0Ao+9+64+0+34+0.0000762939453125+0.00009765625+1+-1%0Ao+88+64+0+33+0.0000762939453125+0.00009765625+2+-1%0Ao+85+64+0+33+0.0000762939453125+0.00009765625+3+-1%0Ao+86+64+0+33+0.0000762939453125+0.00009765625+4+-1%0Ao+87+64+0+33+0.0000762939453125+0.00009765625+5+-1%0Ao+97+64+0+34+0.0000762939453125+0.00009765625+6+-1%0Ao+119+64+0+34+0.0000762939453125+0.00009765625+7+-1%0A" target="_blank">Same thing, but with full ping-pong integrator and synchronized start switch.</a> <br />------------------------------------------------------------------------------------------------------------------------------<br /><br />Note to self: to-do list (2016.04.10: 1:17 PM).<br />Updated 2016.04.12<br /><ol><li>Correct plots:</li><ol><li><strike>Spelling of "Instantaneous" in 1st plot</strike></li><li><strike>Replace tau as a dummy variable</strike></li><li><strike>Change the ordering of curves so H appears in a logical place in the list.</strike> <span style="background-color: yellow;">I think it's OK</span>.</li><li>Think about reducing the complexity or changing one of the plots to be more instructive <span style="background-color: yellow;">(FAIL!)</span></li><li><strike>Perhaps add some simpler plots with annotation such as "This curve is the difference of these two" or "This curve is the integrated difference of these two" etc.</strike> Simpler?? Lol<strike><br /></strike></li><li><strike>Perhaps change the colors or the background colors to make them stand out better or have better logical cohesion</strike> <span style="background-color: yellow;">(tried this: but it didn't work out too well)</span></li><li>Think about a u related curve which represents u integrated over a window of length $T_s$ like the dashed purple $T_s$-length-sliding-window integrated $w_2$. </li><li><strike>Annotate the x-axis better to show how a G&L period lines up with time, and at what point in the period G&L report the values (the start of the period, bizarrely).</strike></li><li>Rename those variables with subscript 1 to either drop the subscript completely (so T matches G&L's T for example), or replace 1 with "avg" for average or "mean" and likewise replace the subscript 2 with "inst" for instantaneous. <span style="background-color: yellow;">Maybe on another iteration?</span></li></ol><li>Write out equations that demonstrate:</li><ol><li>Continuous and discrete time average and instantaneous equations, in both canonical and G&L (non-canonical) format, like in SIM8. (Also correct SIM8)</li><li>Explain why you use the notation you do, and show a table with all the variable names</li><li>Show how the other output variables are also affected (not just T).</li><li>Write out the equations that show the solutions for all the curves.</li><li>Discuss why the canonical equations make sense with a simple 1st order continuous time and discrete time pair (with a ZOH input), and show what G&L are doing differently.</li><li>Either dispense with $T_s = 1$ at the start (i.e. justify dropping it), or carry it through so you don't forget that integrating over a window of length 1 is the same as a moving average over that window.</li></ol><li>Embed a spreadsheet that shows these plots and/or perhaps an animation that demonstrates exactly what's going on.</li><ol><li>Ensure that all G&L's accounting equations are satisfied where they should be, and demonstrate continuous time curves that satisfy them over any sample period, as well as discrete time tables of results.</li><li>Make sure everything still works for an arbitrary ZOH input G. </li></ol></ol></td></tr></tbody></table></td></tr></tbody></table>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com88tag:blogger.com,1999:blog-3393033712226955105.post-35432274320223952882016-04-07T19:15:00.006-07:002016-04-23T03:26:28.497-07:00SIM8: discrete time and continuous time state space system matrices<script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script> <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"> </script>The discrete time and continuous time system matrices of <a href="http://dl4a.org/uploads/pdf/Monetary%2BEconomics%2B-%2BLavoie%2BGodley.pdf" target="_blank">G&L's SIM model</a> written as composite arrays: first the discrete time:<br />$$<br /><br />\left[<br /><br />\begin{array}{c|c}<br /><br />A_d & B_d \\<br /><br />\hline<br /><br />C_d & D_d<br /><br />\end{array}<br /><br />\right]_{SIM_d} =<br /><br />\left[<br /><br />\begin{array}{c|c}<br /><br />1-\frac{\alpha_2 \theta}{1 - \alpha_1 (1 - \theta)} & 1-\frac{\theta}{1 - \alpha_1 (1 - \theta)} \\[1.5ex]<br /><br />\hline<br /><br />\frac{\alpha_2}{1 - \alpha_1 (1 - \theta)} & \frac{1}{1 - \alpha_1 (1 - \theta)} \\[1.5ex]<br /><br />\frac{\alpha_2 \theta}{1 - \alpha_1 (1 - \theta)} & \frac{\theta}{1 - \alpha_1 (1 - \theta)} \\[1.5ex]<br /><br />\frac{\alpha_2 (1-\theta)}{1 - \alpha_1 (1 - \theta)} & \frac{1-\theta}{1 - \alpha_1 (1 - \theta)} \\[1.5ex]<br /><br />\frac{\alpha_2}{1 - \alpha_1 (1 - \theta)} & \frac{\alpha_1 (1-\theta)}{1 - \alpha_1 (1 - \theta)}<br /><br />\end{array}<br /><br />\right] \tag 1<br /><br />$$<br />and now the continuous time assuming the input $\dot{g}$ is held constant over each period corresponding to the sample periods of the discrete time case (if that's not the case, or to see why I call the input $\dot{g}$ rather than $G$ see my posts <a href="http://banking-discussion.blogspot.com/2016/03/sim4.html" target="_blank">SIM4</a> and <a href="http://banking-discussion.blogspot.com/2016/03/sim7-determining-both-time-constant-tc.html" target="_blank">SIM7</a>): <br />$$<br /><br />\left[<br /><br />\begin{array}{c|c}<br /><br />A_m & B_m \\<br /><br />\hline<br /><br />C_m & D_m<br /><br />\end{array}<br /><br />\right]_{SIM_m} =<br /><br />\left[<br /><br />\begin{array}{c|c}<br /><br />\frac{1}{T_s} \log\left(1-\frac{\alpha_2 \theta}{1 - \alpha_1 (1 - \theta)}\right) & \frac{\theta + \alpha_1 (1-\theta) - 1}{T_s \alpha_2 \theta} \log\left(1-\frac{\alpha_2 \theta}{1 - \alpha_1 (1 - \theta)}\right) \\[1.5ex]<br /><br />\hline<br /><br />\frac{\alpha_2}{1 - \alpha_1 (1 - \theta)} & \frac{1}{1 - \alpha_1 (1 - \theta)} \\[1.5ex]<br /><br />\frac{\alpha_2 \theta}{1 - \alpha_1 (1 - \theta)} & \frac{\theta}{1 - \alpha_1 (1 - \theta)} \\[1.5ex]<br /><br />\frac{\alpha_2 (1-\theta)}{1 - \alpha_1 (1 - \theta)} & \frac{1-\theta}{1 - \alpha_1 (1 - \theta)} \\[1.5ex]<br /><br />\frac{\alpha_2}{1 - \alpha_1 (1 - \theta)} & \frac{\alpha_1 (1-\theta)}{1 - \alpha_1 (1 - \theta)}<br /><br />\end{array}<br /><br />\right] \tag 2<br /><br />$$<br />where $T_s$ is the sample period of the discrete time model. Writing the system equations in such a format allows you to easily interface with a rich set of MATLAB or Octave (open source) tools, for example the <a href="http://www.mathworks.com/help/control/ref/ss.html" target="_blank">MATLAB ss() function</a> (Octave version <a href="http://octave.sourceforge.net/control/function/ss.html" target="_blank">here</a>). You'll be writing <a href="http://www.mathworks.com/help/robust/controller-synthesis.html" target="_blank">$H_{\infty}$</a> or <a href="http://www.mathworks.com/help/robust/mu-synthesis.html" target="_blank">$\mu$-sythesis</a> robust interest rules for your central bank in no time!<br /><br /><i>Update 2016.04.23: Note that the $m$ subscripts (which I just changed: they used to be $c$ for "continuous") in the continuous time case here stands for "mean" as this particular set of continuous time equations produces as outputs values that actually represent average (or mean) rates over the discrete time sample period. This is because of a peculiarity of stock-flow consistent (SFC) models in their discrete time format. The "flows" (corresponding to the input and measurements (AKA outputs) in SIM) are dollar value accumulated over a sample period. Thus if the sample period goes to 0, so do these flow values. You can think of it as expressing an average rate in terms of dollars per current sample period. State space representations in other contexts (such as many engineering uses) do not have this peculiarity. In those cases we're not interested in having our input and output values scale with the sample period (essentially being expressed in varying units which scale with the sample period): we usually want their units to be independent of the sample period. But this isn't a problem with SFC models, it's more of a fact that someone like me has to contend with if they wish to use a state space representation with SFC models.</i><br /><br /><i>So there's nothing wrong with using this variety of a continuous time model, as long as you're aware of these facts. However, there is another way of going about constructing a continuous time counterpart to a discrete time SFC model which doesn't attempt to match the values from the discrete time case directly, but instead provide sample period independent continuous time curves, which when integrated over each sample period, match the flow outputs from the discrete time SFC model. Thus you can think of the variables corresponding to discrete time flows in this alternate approach continuous time modeling approach as being instantaneous rates (or "instantaneous flows"). IMO this latter instantaneous rate approach is a better way to construct a continuous time "equivalent" to a discrete time case: it's a bit more difficult to compare with its discrete time counterpart, but it's truly independent of any sample period, and it should obey the SFC accounting identities over any arbitrary interval of time. The former "mean" approach does not have this property, and if you translate to a new sample period, you must change the $C_m$ and $D_m$ measurement matrices as well if you want the values at the sample times to obey the SFC accounting identities. See <a href="http://banking-discussion.blogspot.com/2016/03/sim6-updated-sim-to-preserve-time.html" target="_blank">SIM6</a> for an imperfect means of doing this (imperfect because it does it through adjusting SIM parameters, but there are some restrictions on the values of those parameters). As for the instantaneous method, refer to <a href="http://banking-discussion.blogspot.com/2016/04/sim9-highlighting-difference-between.html" target="_blank">SIM9</a> and <a href="http://banking-discussion.blogspot.com/2016/04/sim10-circuit-representation.html" target="_blank">SIM10</a>, although I'll probably be providing the equations for that here in the case of SIM when I have time.</i><br /><i><br /></i><i>The "stock" variables (as opposed to the flow variables) do not suffer from this complexity because they are not integrated over each sample period. They just represent dollars (for example), at a particular time, not dollars accumulated over a sample period. In SIM there's only one stock: the total cash circulating in the economy (H), which is also the only state variable (in both the continuous and discrete cases). End Update.</i><br /><br />The operation of the system described in such a manner can be expressed with a single matrix-vector multiply equation in both cases:<br />$$<br />\left[ <br />\begin{array}{c}<br />x_{n+1} \\<br />\hline <br />y_{n}<br />\end{array}<br />\right] =<br />\left[ <br />\begin{array}{c|c}<br />A_d & B_d \\<br />\hline <br />C_d & D_d<br />\end{array}<br />\right]_{n}<br />\left[ <br />\begin{array}{c}<br />x_{n} \\<br />\hline <br />u_{n}<br />\end{array}<br />\right] \tag 3<br />$$<br />$$<br />\left[ <br />\begin{array}{c}<br />\dot{x}(t) \\<br />\hline <br />y_m(t)<br />\end{array}<br />\right] =<br />\left[ <br />\begin{array}{c|c}<br />A_m & B_m \\<br />\hline <br />C_m & D_m<br />\end{array}<br />\right]_t<br />\left[ <br />\begin{array}{c}<br />x(t) \\<br />\hline <br />u(t)<br />\end{array}<br />\right] \tag 4<br />$$<br />where the subscripts on the discrete and continuous time composite system matrices, $n$ and $t$ respectively, indicate a possible time dependence (which is not the case with SIM). I guess I should mention that in discrete time:<br />$$x_n = H_n \tag 5$$<br />$$u_n = G_{n+1} \tag 6$$<br />$$y_n = <br />\left[ <br />\begin{array}{c}<br />Y_{n+1} \\<br />T_{n+1} \\<br />Y_{Dn+1} \\<br />C_{n+1}<br />\end{array}<br />\right] \tag7<br />$$<br />where $y$ and $u$ are offset by one index relative to the associated SIM parameters so that $(3)$ can be in <a href="https://en.wikipedia.org/wiki/State-space_representation" target="_blank">canonical state space form</a>. For continuous time we have:<br />$$x(t) = h(t) \tag 8$$<br />$$u(t) = \dot{g}(t) \tag 9$$<br />$$y_m(t) = <br />\left[ <br />\begin{array}{c}<br />\dot{y}(t) \\<br />\dot{t}(t) \\<br />\dot{y}_D(t) \\<br />\dot{c}(t)<br />\end{array}<br />\right] \tag {10}<br />$$<br /><i>2016.4.10: 4:49 AM: NOTE: The following section will change because it's not quite right: $\dot{g}, \dot{y}$, etc represent the average rates over the preceding sample periods. However it's approximately correct as it stands (see <a href="http://banking-discussion.blogspot.com/2016/04/sim10-circuit-representation.html" target="_blank">SIM10</a> and <a href="http://banking-discussion.blogspot.com/2016/04/sim9-highlighting-difference-between.html" target="_blank">SIM9</a> for more information).</i><br /><br /><i>2016.04.23: 3:00 AM: I went ahead and removed the last bit of this post until I have time to fix it. See the update above at this same date and time. </i>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com6tag:blogger.com,1999:blog-3393033712226955105.post-52716594775049030392016-03-29T11:21:00.001-07:002016-04-07T04:34:03.452-07:00Comment for Roger<script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script> <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"> </script><br />This post is an expanded follow on comment for <a href="http://www.bondeconomics.com/2016/03/techniques-for-finding-sfc-model.html?showComment=1459269441455#c2086644354020128104" target="_blank">Roger Sparks in this thread</a>.<br /><br />In particular, for an LTI system $A_d = e^{A_c T_s} \approx I + A_c T_s$ (the approximation holding when the matrix norm $\lVert A_c T_s \rVert = \lVert A_c \rVert T_s \ll 1$, ... a generalization of the approximation you may recall from <a href="http://ramblingsofanamateureconomist.blogspot.com/2016/03/low-interest-rates-are-contractionary.html?showComment=1458842876394#c5013595352362210487">this comment I left you on John Handley's blog</a>). The subscripts $d$ and $c$ denote discrete and continuous time, respectively. Note that $A_d$ is different for every sample period $T_s$ used. $B_d$ is generally more complicated, but can be approximated as $B_d \approx A^{-1}_c (A_d - I) B_c$. This approximation is exact when $\mathbf{u}$ is a "zero order hold" (ZOH) function, meaning it stays constant over each sample period. More generally, for LTI systems with an arbitrary input $\mathbf{u}$ you must integrate:<br />$$<br />\mathbf{x}_{n+1} = e^{A_c T_s} \mathbf{x}_{n} + \int\limits_{0}^{T_s} e^{A_c (T_s - \tau)} B_c\, \mathbf{u}(\tau + n T_s) d \tau \tag 9<br />$$<br />and substituting for time-invariant $A_d$ from above:<br />$$<br />\mathbf{x}_{n+1} = A_d \mathbf{x}_{n} + \int\limits_{0}^{T_s} e^{A_c (T_s - \tau)} B_c\, \mathbf{u}(\tau + n T_s) d \tau \tag {9a}<br />$$<br />or more generally still, for a time-varying linear system:<br />$$<br />\mathbf{x}_{n+1} = \Phi_{(n+1) T_s, n T_s} \mathbf{x}_{n} + \int\limits_{n T_s}^{(n+1) T_s} \Phi_{(n+1) T_s, \tau} B_c (\tau) \mathbf{u}(\tau) d \tau \tag {10}<br />$$<br />and now substituting for a time varying version of the $A_d$ matrix (indexed by the sample period number $n$):<br />$$<br />\mathbf{x}_{n+1} = A_{dn} \mathbf{x}_{n} + \int\limits_{n T_s}^{(n+1) T_s} \Phi_{(n+1) T_s, \tau} B_c (\tau) \mathbf{u}(\tau) d \tau \tag {10a}<br />$$<br />where $\Phi_{t_2, t_1}$ is the <a href="https://en.wikipedia.org/wiki/State-transition_matrix" target="_blank">state transition matrix</a> from time $t_1$ to time $t_2$. Or you can, in principal, avoid the integration by doing a <a href="http://banking-discussion.blogspot.com/2016/03/sim4.html">Taylor expansion on $\mathbf{u}$ and find a separate $B_{di}$ for each $i^{th}$ term</a>. As Brian has previously pointed out, a numerical integration accomplishes much the same thing, only instead of Taylor terms sampled at one time, it uses $\mathbf{u}$ sampled at several times over a single nominal sample period.<br /><br />Additionally, as I mentioned in a comment above, some non-linear dynamic systems can be approximated over each sample period as a linear system. For example, you may have a non-linear system such as $\dot{\mathbf{x}} = \mathbf{f}(\mathbf{x},\mathbf{u} ,t$), where $\mathbf{f}, \mathbf{x}$ and $\mathbf{u}$ are generally vectors. One way to accomplish this is to approximate $\mathbf{f}$ as $A_c$ and $B_c$ where these matrices are the <a href="https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant">Jacobians</a> of $\mathbf{f}$ wrt $\mathbf{x}$ (i.e. $A_c = \partial \mathbf{f}/\partial\mathbf{x}$) and $\mathbf{u}$ (i.e. $B_c = \partial \mathbf{f}/\partial\mathbf{u}$) respectively, and to rewrite the differential equation in terms of a small perturbation of $\mathbf{x}$ (call it $\delta{\mathbf{x}}$) about a nominal solution $\mathbf{x}^*$, i.e. $\delta{\mathbf{x}} \equiv \mathbf{x} - \mathbf{x}^*$. Similarly define $\delta{\mathbf{u}} \equiv \mathbf{u} - \mathbf{u}^*$. Then we can write for an approximate perturbation to this non-linear differential equation $\delta{\dot{\mathbf{x}}} = A_c \delta\mathbf{x} + B_c \delta\mathbf{u}$. The discrete time approximation I gave above ($A_d \approx I + A_c T_s$) can be seen in this light as a two term vector Taylor expansion of $\mathbf{f}$ wrt $\mathbf{x}$, i.e. $A_d \approx I + (\partial\mathbf{f}/\partial\mathbf{x}) T_s$. Note that the "region of validity" for $A_c$ and $B_c$ may be small, and typically they are recalculated around different nominal values $\mathbf{x}^*$, $\mathbf{u}^*$ and time $t$ as the system evolves in time. An application might be, for example, a model of perturbations of a rocket about a nominal desired trajectory for purposes of implementing a feedback control system to keep it on course. As long as it never is allowed to wander too far off course, the approximation may be adequate, provided the system is "re-linearized" on a regular basis. This might suggest an economics application of a central bank "feedback control" rule for setting interest rates or determining the "high powered" money supply to "keep the economy on course" about some non-linear pre-determined solution to a set of non-linear differential equations, based on feedback from other measured macro variables, such as the inflation rate, the NGDP level or the unemployment rate.<br /><br />Another huge advantage of linear systems is the ability to analyze and manipulate them in the "frequency domain" rather than the time domain analysis I give above. This means the ability to use continuous and discrete time Fourier transforms, Laplace transforms and Z-transforms. They also have advantages in terms of being able to analyze their response to noise, modeling errors and other uncertainties, and to design optimal "state estimators" (e.g. Kalman filters) perhaps designed to work in conjunction with optimal feedback or open loop control laws, which can effectively change the natural modes of the system to more desirable ones: for example, to stabilize an unstable system by moving its unstable eigenvalues to the "right half plane" (i.e. move modes with positive real components such that they instead have negative real components... in what's known with regard to Laplace transforms as the "S-plane"). The discrete time equivalent is to move unstable eigenvalues of $A_d$ from outside the "unit circle" to inside the unit circle (this unit circle drawn in the "Z-plane" associated with the Z-transform, which is the discrete time counterpart to the Laplace transform). Sometimes you hear economists speak of "unit roots." What they're referring to are "roots" (in the sense of roots to the "characteristic polynomial" of $A_d$, which are the eigenvalues, AKA "poles" of $A_d$) on the unit circle (corresponding to the imaginary axis of the S-plane in the continuous time world), which produces "marginally stable" outputs, such as non-rising non-decaying step impulse responses (the response of a perfect "integrator") or constant amplitude oscillations (sin and cos waves, or more generally "complex exponentials," i.e. $c\, e^{i \omega n T_s}$ with $i \equiv \sqrt{-1}$, $c$ a constant and $\omega$ the unitless frequency of oscillation (which you can practically take to be radians per sample)). Everything in quotes can be Googled for more information (those are all common terms).<br /><br />I think you can probably see how important the $A$ matrix ($A_c$ or $A_d$) is to a linear system. It characterizes all the dynamics of the system, such as whether or not it's naturally stable or likely to oscillate, how fast it will respond to inputs (the time constants), and which modes are dominant (i.e. which modes are weighted with the largest coefficients). Of course the other matrices ($B$, $C$ and $D$) are also important, and you need them, for example, to analyze steady state responses or to determine if a system is "controllable" (can we control the states?) or "observable" (do we have enough sensors to observe all the states?). But $A$ is really the heart of the system.<br /><br />-----------------------------------------------------------------------------------------------------------------<br /><br /><b>Appendix A: Details about one way to calculate discrete time matrices for non-linear systems</b><br /><br />For the non-linear approximate discrete time case, it's sometimes beneficial to numerically calculate $A_d$ and $B_d$ from numerical solutions to the non-linear equations directly rather than via the partial differential Jacobian technique discussed above, especially if you have some idea of the covariance of $\delta \mathbf{x}$ (call it $C_\mathbf{x}$) and $\delta \mathbf{u}$ (call it $C_\mathbf{u}$). For example, say the eigenvalues (variances) of $C_\mathbf{x}$ are $\{\sigma^2_{\mathbf{x}, i}\}$, for $i = 1,...,n$ (assuming $\mathbf{x}$ is $n$-dimensional), and the corresponding orthonormal matrix of eigenvectors is $V_\mathbf{x} = [\mathbf{v}_{\mathbf{x}, i}]$. These eigenvectors are orthonormal since covariances are always positive semi-definite, and we'll assume positive definite (i.e. a full $n$ degrees of freedom (equivalently all variances are > 0)) for this exercise. Then a good way to calculate $A_{d n}$ which captures some of the effects of the higher order terms of the Taylor expansion as well as the dependence of $\mathbf{f}$ on $t$ (which we've so far assumed to be negligible over a sample period) is the following sum of outer products:<br />$$<br />A_{d n} = \sum_{i=1}^n [\mathbf{x}_i (t_{n+1}) - \mathbf{x}^* (t_{n+1})] \cdot \mathbf{v}^T_{\mathbf{x}, i} /\sigma_{\mathbf{x}, i} \tag {11} <br />$$<br />where $t_{m} \equiv m T_s$ and $\mathbf{x}_i (t_{n+1})$ is the numerical solution at time $t_{n+1}$ to the non-linear differential equation after perturbing the nominal solution $\mathbf{x}^* (t_{n})$ by $\mathbf{v}_{\mathbf{x}, i} \sigma_{\mathbf{x}, i}$ and propagating it forward by one sample period $T_s$ to time $t_{n+1}$. In other words we form $\mathbf{x}_i (t_n) = \mathbf{x}^* (t_{n}) + \delta \mathbf{x}_{i, n}$ where $\delta \mathbf{x}_{i, n} = \mathbf{v}_{\mathbf{x}, i} \sigma_{\mathbf{x}, i}$ and propagate that forward one time step to get $\mathbf{x}_i (t_{n+1})$. In general $C_\mathbf{x}$ and $C_\mathbf{u}$ will also be functions of time, and thus so will their eigenvalues and eigenvectors (though I've neglected a time index for them in the above). An analogous procedure exists for finding $B_{d n}$ using a formula similar to $(11)$ but with the eigenvalues and eigenvectors of $C_\mathbf{u}$ rather than $C_\mathbf{x}$. This procedure (for both $A_d$ and $B_d$) scales the non-linear effects by the size of the standard deviations ($\sigma$) of each degree of freedom in each covariance, thus in some sense capturing the expected size of the effects of higher order terms / non-linearities. Note that $(11)$ is a one-sided difference, whereas a more robust method would use both positive and negative perturbations ($\pm \delta$).<br /><br />One way to picture what's going on in $(11)$ is to imagine that $C_\mathbf{x}$ describes a multivariate spatial Gaussian probability distribution that's long and narrow (i.e. its 1-$\sigma$ ellipsoidal iso-probability density contour is cigar shaped). Then a perturbation in $\mathbf{x}$ from the nominal is most likely to be located ~$1 \sigma$ one direction or the other along the major axis of this distribution (with $\mathbf{x}^*$ right in the middle of course). For the sake of argument, say it's exactly $1 \sigma$ along the positive major axis (it actually works for any principal axis of the ellipsoid, but imagine the major one for the sake of argument), and it has no perturbation components along the other axes. Then the inner product of this perturbation and the row vector $\mathbf{v}^T_{\mathbf{x}, j}/\sigma_{\mathbf{x}, j}$ will be $1$ and it will be $0$ for $\mathbf{v}^T_{\mathbf{x}, i}/\sigma_{\mathbf{x}, i},\; i \ne j$ where we're assuming the major axis is the $j^{th}$. That's because $V_\mathbf{x}$ is orthornormal (i.e. its columns are unit length and mutually orthogonal). Such a perturbation will give an exact result for the resultant perturbation propagated to time $t_{n+1}$ (assuming $\delta \mathbf{u} = 0$). In other words, such a perturbation at time $t_n$ (call it $\delta \mathbf{x}_j (t_n)$) will give an exact result for $\delta \mathbf{x}_j (t_{n+1}) = A_{d n} \delta \mathbf{x}_j (t_n)$. This is because, substituting $(11)$ for $A_{d n}$ we have:<br />$$<br />\begin{align} <br />A_{d n} \delta \mathbf{x}_j (t_n) & = \left( \sum_{i=1}^n [\mathbf{x}_i (t_{n+1}) - \mathbf{x}^* (t_{n+1})] \cdot \mathbf{v}^T_{\mathbf{x}, i, n} /\sigma_{\mathbf{x}, i, n} \right) \cdot \delta \mathbf{x}_i (t_n)\\<br />& = \left( \sum_{i=1}^n [\mathbf{x}_i (t_{n+1}) - \mathbf{x}^* (t_{n+1})] \cdot \mathbf{v}^T_{\mathbf{x}, i, n} /\sigma_{\mathbf{x}, i, n} \right) \cdot \mathbf{v}_{\mathbf{x}, j, n} \sigma_{\mathbf{x}, j, n}\\<br />& = \sum_{i=1}^n [\mathbf{x}_i (t_{n+1}) - \mathbf{x}^* (t_{n+1})] (\mathbf{v}^T_{\mathbf{x}, i, n} \cdot \mathbf{v}_{\mathbf{x}, j, n}) ( \sigma_{\mathbf{x}, j, n} /\sigma_{\mathbf{x}, i, n}) \\ <br />& = [\mathbf{x}_j (t_{n+1}) - \mathbf{x}^* (t_{n+1})] (\mathbf{v}^T_{\mathbf{x}, j, n} \cdot \mathbf{v}_{\mathbf{x}, j, n}) ( \sigma_{\mathbf{x}, j, n}/\sigma_{\mathbf{x}, j, n})\\<br />& = \mathbf{x}_j (t_{n+1}) - \mathbf{x}^* (t_{n+1})\\<br />& = \delta \mathbf{x}_j (t_{n+1}) \tag {12}<br />\end{align} <br />$$<br />where I've added time indices where appropriate. Thus, in some sense, a "likely" perturbation gives exact results, non-linearities and all. The Jacobian method does not capture this, and may be equally difficult to calculate (although when closed form expressions are available, it's likely easier) [1]. Of course, this exact "likely" perturbation still has probability = 0, so we don't expect to actually avoid non-linear distortions altogether, but in some sense we can expect to account for them in a way not captured by the Jacobian method. Doing so is perhaps a bit conservative, but if our purpose is (for example) to keep track of how errors propagate through the system (e.g. with a Kalman filter), it's generally better to err on the conservative side, lest we fool ourselves into thinking we have a better state estimate than we actually do (which can cause us to weight new information ("innovations") with smaller gains than we should at future times). You can think of this problem as wrongly adopting overly strong "priors." If a more conservative result is desired, the perturbations can be made to be greater than 1-$\sigma$ in size.<br /><br />[1] In fact, you can think of this method as a crude numerical estimate of $e^{(\partial\mathbf{f}/\partial\mathbf{x}) T_s}$, where the $\partial \mathbf{x}$ deviations (and thus the implicit $\partial \mathbf{f}$ deviations) aren't very infinitesimal at all, and where $T_s$ is implicitly folded into the differencing estimate directly rather than as a separate multiplier. But the point isn't to approximate the matrix exponential, but to find something better. However, if the system were actually LTI, it would be an exact representation of $e^{(\partial\mathbf{f}/\partial\mathbf{x}) T_s}$. And if the system were linear but time varying, it would produce exactly $\Phi_{n+1, n}$ where I've simplified the time indices from $(10)$ above.<br /><br />-----------------------------------------------------------------<br /><br />See <a href="http://banking-discussion.blogspot.com/2016/03/comment-for-roger.html?showComment=1459451386215#c3878244067747753235" target="_blank">comment below</a>:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-ll6I7NNSfW0/Vv1291XcQVI/AAAAAAAAAzM/bgUlQyoP_nYVo39SIUi03XzuqvtfpdxVQ/s1600/error_ellipse.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-ll6I7NNSfW0/Vv1291XcQVI/AAAAAAAAAzM/bgUlQyoP_nYVo39SIUi03XzuqvtfpdxVQ/s1600/error_ellipse.jpg" /></a></div><br /><br />Below: Example of error propagation (falling objects with initial horizontal velocity): blue curve includes air resistance, and the red curve doesn't. Blue trajectory is non-linear and red is linear. Error ellipses are 1-sigma.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-6eoXc4Oo0KQ/Vv319USgjxI/AAAAAAAAAzc/o3J4aJcmstcZT4MuANYJUFZTT6WgSr1aw/s1600/error_prop.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://1.bp.blogspot.com/-6eoXc4Oo0KQ/Vv319USgjxI/AAAAAAAAAzc/o3J4aJcmstcZT4MuANYJUFZTT6WgSr1aw/s1600/error_prop.jpg" /> </a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"> </div>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com30tag:blogger.com,1999:blog-3393033712226955105.post-42347381156108888642016-03-22T20:47:00.002-07:002016-04-08T06:11:31.241-07:00SIM7: determining both the time constant (Tc) and the steady state values with the SIM parameters (α1, α2 and θ)<script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script> <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"> </script>This post was inspired by <a href="http://informationtransfereconomics.blogspot.com/2016/03/an-rlc-circuit-with-r-s-and-l-f.html" target="_blank">this post by Jason Smith</a>.<br /><br />In the case of <a href="http://banking-discussion.blogspot.com/2016/03/sim6-updated-sim-to-preserve-time.html" target="_blank">Godley & Lavoie's SIM model</a>, given an equivalent continuous time system with $h$ the equivalent of $H$ and $\dot{g}$ the equivalent of $G$ we have:<br />$$(1)\:\dot{h} = ah + b\dot{g}$$<br />Defining<br />$$X \equiv 1 - \alpha_{1}(1 - \theta)$$ <br />We have<br />$$a = \frac{1}{T_{s}} log (1 - \frac{\alpha_{2}\theta}{X})$$<br />$$b = \frac{a(\theta - X)}{\alpha_{2}\theta}$$<br />Where $T_{s}$ is the sample period of SIM (specified by G&L as 1 "period"). For the outputs (continuous time equivalents to $Y$, $T$, $Y_{D}$ and $C$) we have:<br />$$\dot{y} = \frac{\alpha_{2}}{X}h + \frac{1}{X}\dot{g}$$<br />$$\dot{t} = \frac{\alpha_{2}\theta}{X}h + \frac{\theta}{X}\dot{g}$$<br />$$\dot{y}_{D} = \frac{\alpha_{2}(1 - \theta)}{X}h + \frac{1 - \theta}{X}\dot{g}$$<br />$$\dot{c} = \frac{\alpha_{2}}{X}h + (\frac{1}{X} - 1)\dot{g}$$<br />Where $\dot{h}$, $\dot{g}$, $\dot{y}$, $\dot{t}$, $\dot{y}_{D}$ and $\dot{c}$ are all rates expressed in dollars per sample period $T_{s}$ and $h$ is expressed in dollars. Then solving for (steady state $h$) $\equiv h_{ss}$ by setting $\dot{h} = 0$ in (1), we have:<br />$$(2)\:h_{ss} = K_{h}\dot{g}_{ss}$$<br />Where the steady state gain $K_{h}$ is:<br />$$(3)\:K_{h} \equiv \frac{h_{ss}}{\dot{g}_{ss}} = -\frac{b}{a} = \frac{X - \theta}{\alpha_{2}\theta} = \frac{1 - \alpha_{1}(1 - \theta) - \theta}{\alpha_{2}\theta}$$<br />And $\dot{g}_{ss} \equiv$ (the steady state value of exogenous input $\dot{g}$). Substituting $h_{ss}$ for $h$ and $\dot{g}_{ss}$ for $\dot{g}$ in the above equations for $\dot{y}$, $\dot{t}$, $\dot{y}_{D}$ and $\dot{c}$ to find the corresponding steady state values, and then solving for the corresponding steady state system gains we have:<br />$$(4)\:K_{\dot{y}} \equiv \frac{\dot{y}_{ss}}{\dot{g}_{ss}} = \frac{1}{\theta}$$<br />$$(5)\:K_{\dot{t}} \equiv \frac{\dot{t}_{ss}}{\dot{g}_{ss}} = 1$$<br />$$(6)\:K_{\dot{y}_{D}} \equiv \frac{\dot{y}_{Dss}}{\dot{g}_{ss}} = \frac{1 - \theta}{\theta}$$<br />$$(7)\:K_{\dot{c}} \equiv \frac{\dot{c}_{ss}}{\dot{g}_{ss}} = \frac{1 - \theta}{\theta}$$<br />And finally, expressing the system time constant $T_{c}$ as a function of $\alpha_{1}$, $\alpha_{2}$, $\theta$ and sample period $T_{s}$, we have:<br />$$(8)\:T_{c} = -\frac{1}{a} = -\frac{T_{s}}{log(1 - \frac{\alpha_{2}\theta}{X})} = -\frac{T_{s}}{log(1 - \frac{\alpha_{2}\theta}{1 - \alpha_{1}(1 - \theta)})}$$<br />Now culling the above equations for the interesting bits, and expressing in the more familiar discrete time notation we conclude that we have only four interesting equations for our desired values of $K_{H}$, $K_{Y}$, $K_{Y_{D}}$ and $T_{c}$ with three unknown parameters ($\alpha_{1}$, $\alpha_{2}$, and $\theta$) and solving (8) for the ratio of the system time constant to the sample period $T_{c}/T_{s}$:<br />$$(3A)\:K_{H} = \frac{1 - \alpha_{1}(1 - \theta) - \theta}{\alpha_{2}\theta}$$<br />$$(4A)\:K_{Y} = \frac{1}{\theta}$$<br />$$(6A)\:K_{Y_{D}} = K_{C} = \frac{1 - \theta}{\theta}$$<br />$$(8A)\:\frac{T_{c}}{T_{s}} = \frac{-1}{log(1 - \frac{\alpha_{2}\theta}{1 - \alpha_{1}(1 - \theta)})}$$<br />Clearly we can choose to determine $\theta$ with either (4A) or (6A) (but not both) and then we can solve (3A) and (8A) for $\alpha_{1}$ and $\alpha_{2}$, thus determining both the steady state and the time constant of the system.<br /><br />Without loss of generality, we can set $T_{s} = 1$ and choose to let (4A) determine $\theta$. Thus if we select ahead of time $K_{Y}$, $K_{H}$, and $T_{c}$ we can determine $\alpha_{1}$, $\alpha_{2}$, and $\theta$ as follows:<br />$$(9)\:\theta = \frac{1}{K_{Y}}$$<br />$$(10)\:\alpha_{1} = \frac{K_{H}(e^{-\frac{1}{T_{c}}} - 1) + 1 - \theta}{(K_{H}(e^{-\frac{1}{T_{c}}} - 1) + 1)(1 - \theta)}$$<br />$$(11)\:\alpha_{2} = \frac{1 - \alpha_{1}(1 - \theta) - \theta}{K_{H}\theta}$$<br /><br />To see a demonstration of how this works, I've updated <a href="http://banking-discussion.blogspot.com/2016/03/sim6-updated-sim-to-preserve-time.html" target="_blank">SIM6</a> with the ability to set these parameters via these equations (look for the green cells under the results table). You'll note that not all combinations of $K_{Y}$, $K_{H}$, and $T_{c}$ are valid or work very well. For example, setting $K_{Y} = 1$ causes $\theta = 1$ which makes (10) blow up. I discuss more of these problems in <a href="http://informationtransfereconomics.blogspot.com/2016/03/an-rlc-circuit-with-r-s-and-l-f.html?showComment=1458748944122#c8988929057437845528" target="_blank">this comment</a>.<br /><br /><br />Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-58705441413638260262016-03-21T12:07:00.001-07:002016-03-21T23:14:46.634-07:00Japan Philips Curve Regression 2003.12 to 2013.12I created this version of <a href="http://banking-discussion.blogspot.com/2016/03/japan-philips-curve-regression-200502.html" target="_blank">this post</a> to address the <a href="http://informationtransfereconomics.blogspot.com/2016/03/japans-phillips-curve-is-also-flattening.html?showComment=1458584561477#c7446866535272558472" target="_blank">2014 VAT tax Jason mentioned here</a> (by sliding the time frame forward to 2003.12 to 2013.12 to avoid 2014 altogether).<br /><br /><br /><br /><iframe frameborder="0" height="1300" scrolling="no" src="https://onedrive.live.com/embed?cid=ADAE118FF12AB43B&resid=ADAE118FF12AB43B%21325&authkey=AH-78P_0RrYWsZI&em=2&AllowTyping=True&ActiveCell='FRED%20Graph'!A1&wdDownloadButton=True" width="1050"></iframe> <br /><br /><br />Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com4tag:blogger.com,1999:blog-3393033712226955105.post-57165235366339669232016-03-20T23:29:00.005-07:002016-03-21T11:05:42.444-07:00Japan Philips Curve Regression 2005.02 to 2015.02This is me trying to recreate either Jason's or John's results from <a href="http://informationtransfereconomics.blogspot.com/2016/03/japans-phillips-curve-is-also-flattening.html" target="_blank">this post</a>, and in particular, <a href="http://informationtransfereconomics.blogspot.com/2016/03/japans-phillips-curve-is-also-flattening.html?showComment=1458531494664#c6220523353329047723" target="_blank">this comment.</a><br /><br /><span class="_Tgc"></span>The data I do the regression on is copied up to the top (yellow cells) under the right side of the chart in columns H and I (starting at row 30) labeled ΔEMP and <span class="_Tgc"></span>ΔCPI. The <span class="_Tgc"></span>ΔEMP represents a 12 month difference. These cells were copied from the big table to the left, down at the bottom (stopping at row 380) and also colored yellow. My results don't seem to match either Jason or John. Not a surprise since I'm probably doing it wrong.<br /><br /><u><b>Instructions for repeating what I did:</b></u><br /><br />First download the data from <a href="https://research.stlouisfed.org/fred2/graph/?g=3QzI" target="_blank">FRED (following John's link)</a> in Excel format. Or just download my spreadsheet (icon in lower right corner of sheet). From here on I'll assume you've downloaded my sheet (so the differences have been computed and data copied to look like mine). Select the "Data Analysis" option on the "Data" tab and then the "Regression" sub-option. You may need to download and install a Data Analysis plug-in first. For the y values select the column of yellow cells including the ΔCPI label at the top starting at I30. For the x values select the column of yellow cells immediately to the left of that including the ΔEMP label at the top (starting at H30). I selected the option check-box to output the analysis on a new tab (which I called "Regression"). That's all.<br /><br />For the plot (which I did separately) I used the linear regression ("show trend?") built directly into the scatter plot options. Another option there lets you display the the equation for the linear trend and the R squared value. I found that after making the plot and then looking at the options associated with the data series. The answers should match the Data Analysis results!<br /><br /><br /><br /><iframe frameborder="0" height="1500" scrolling="no" src="https://onedrive.live.com/embed?cid=ADAE118FF12AB43B&resid=ADAE118FF12AB43B%21323&authkey=AL88sc8GfaJoYpk&em=2&AllowTyping=True&wdDownloadButton=True" width="1050"></iframe> <br /><br /><br />Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-61080668369187379382016-03-15T22:07:00.000-07:002016-04-27T22:19:02.200-07:00SIM6: updated SIM to preserve time constant (Tc) and G&L's accounting equationsThis post updates <a href="http://banking-discussion.blogspot.com/2016/03/sim.html" target="_blank">SIM</a> to preserve the system time constant (thus making the dynamics invariant to the sample period). And like SIM, all G&L's expressions are satisfied. This is accomplished by using the same mechanism as was used in SIM, but replacing not just alpha2 when Ts is changed, but alpha1 as well.<br /><br />I updated the sheet so that as an option you can edit the "master" green cells under the results table to set Ky, Tc and Kh, which in turn determine the green cells in the upper left (alpha1_0, alpha2_0 and theta). This is to demonstrate the equations in <a href="http://banking-discussion.blogspot.com/2016/03/sim7-determining-both-time-constant-tc.html" target="_blank">SIM7</a>. Or you can just edit the cells in the upper left directly (thus breaking their link to the lower "master" green cells -- to reestablish the link, reload the page).<br /><br /><br /><iframe frameborder="0" height="1400" scrolling="no" src="https://onedrive.live.com/embed?cid=ADAE118FF12AB43B&resid=ADAE118FF12AB43B%21316&authkey=ADgzCWiEDkYSLpQ&em=2&AllowTyping=True&ActiveCell='Sheet1'!B3&Item='Sheet1'!A1%3ABB1024&wdHideGridlines=True&wdDownloadButton=True" width="1080"></iframe> <br />Scroll to the right to see the columns which do the calculations. The columns immediately under the chart are what's plotted. Note that <span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ is the </span></span><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ that Jason defined as</span></span> ΔH/(G - T) := <span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ, not the </span></span><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ I define in <a href="http://banking-discussion.blogspot.com/2016/03/sim4.html" target="_blank">SIM4</a>. The goal is to keep </span></span><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ = 1 here (to satisfy G&L's expression). As T approaches G as t -> inf, this ratio becomes numerically unstable (0/0), so it's really only valid before that happens (at the early times).</span></span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">The only curve that truly represents an accumulated value is the single state variable H (money supply or cash in the economy). The curves G, Y, T, YD and C are all scaled by 1/T_ratio when plotted. You may notice the curve C and some of the others seem to change slightly (other than just the interpolation between more widely separated sample points). <b>I'm not sure why that is</b> [Update: see paragraph below], <strike>but it may be because there's one more degree of freedom I haven't yet tried to adjust: namely the balance between alpha1 and theta.</strike> [Update: I don't think so because it works with theta the way it is now (see below)]. But the main dynamics captured by curve H are truly invariant [Update: as are the others, it's just that they represent average rates over each interval, so they are fundamentally different than H and dependent on the sample times: see below] to the sample period: the points sampled are always from the same underlying (and unchanging) continuous curve, with only the linear interpolation between them (on the plot) showing any difference (which is entirely an artifact of the plotting procedure).</span></span><br /><br /><b><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">"</span></span></b><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><b>I'm not sure why that is,..."</b> At least part of the reason is Y, T, YD and C are still plotted at rates (so is G, but it won't have this problem as explained above): rates effectively estimated from differencing underlying and uncalculated integrals of each of them between sample times. Thus even if those underlying integrated curves were exactly the same for different sample periods, estimated rates calculated in that manner would still differ from one another if Y, T, YD and C are anything except constants (G is a constant, and thus does not have this problem) for t >= 0, assuming they are all 0 for t < 0. As an example, consider the function y(t) = t^2. If sampled with period = 2 at t=0 and t=2, the answers would be y(0) = 0 and y(2) = 4. If I calculated a rate based on differencing and plotted that at the end of the sample period I'd have at t=2, ydot(2) = 4/2 = 2. Now imagine the sample period is 1. Then I'd get y(1) = 1, y(2) = 4. An estimated rate based on those samples plotted at t=2 gives me ydot(2) = (4-1)/1 = 3. The only fair way to compare them is in terms of y, not ydot. The ydot's represent accurate <b>average</b> rates over each sample period. So if I just had access to the ydots from each set of samples, I could use them to reconstruct y in both cases, and those should match (assuming ydot(0) = 0 in both cases).</span></span></span></span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Sample period = 2:</span></span></span></span><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">y(2) = ydot(2)*2 = 4</span></span></span></span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Sample period = 1:</span></span></span></span><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">y(2) = ydot(2)*1 + ydot(1)*1 = 3 + 1 = 4</span></span></span></span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">I need to do that exercise (calculate integrated Y, T, YD and C curves) for two different sample periods, one an integral multiple of the other, and see if they match at those sample times that they have in common. I still suspect that there may be a problem with my extra degree of freedom (I mention above), but we'll see. <span style="color: #b45f06;"><i>[</i><i>UPDATE: 2016.04.22:</i> <i>I don't think there's a problem with this so-called "extra" degree of freedom: see equations 4, 4A, 6, 6A and 9 in <a href="http://banking-discussion.blogspot.com/2016/03/sim7-determining-both-time-constant-tc.html" target="_blank">SIM7</a>. They demonstrate that theta, and theta alone determines the steady state gain of Y, YD and C (at a fixed sample period). Scaling the sample period should scale those steady state gains by the same value, thus there's no room for us to fool with theta, else it would change the steady state gain for Y, YD and C to a wrong value if we did. So the answer is there is no extra degree of freedom!</i></span> <i><span style="color: #b45f06;">In fact, one way to think about what's going on in this post (SIM6) is in terms of SIM7: here in SIM6, we're effectively using equation 10 from SIM7 to set alpha1 (given we don't want to change any steady state gains, and thus we can't change theta). We do that by changing the time constant Tc in equation 10. You might object saying "I thought the goal of this post was to keep the time constant fixed!" Yes, that's true, but you can think of changing Tc in eq. 10 such that it's the value of the old (fixed) time constant but expressed in terms of our new sample period. For example, say originally Tc = 6 original sample periods, and we want to change the sample period from 1 to 2, then in terms of the NEW sample period, Tc looks like just 3 (3 new sample periods, which are twice as big as the old sample periods). So after figuring out what Tc will be expressed in new sample periods (our goal sample period), then use SIM7 equation 10 to find alpha1, and then use SIM7 equation 11 to find alpha2. I *think* that's the same as what I'm doing here (but I haven't actually done the math to verify it)].</span></i></span></span></span></span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">UPDATE: Just did that exercise. You can find the results by scrolling out further to the extreme right on the spreadsheet, where I compare Y, T, YD and C integrated and then sampled with sample period Ts against the next table to its left showing a copy of the values integrated with default Ts = Ts_0 = 1 (the yellow cells in both tables). They are the same at identical sample times (chose Ts as an integral multiple or fraction of Ts_0 so some sample times will coincide), so my underlying integrated versions of Y, T, YD and C are invariant with sample period. </span></span></span></span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Also note that G_Rate in fixed units of dollars/(Ts_0=1 year) can be edited in the green User Input cells in the upper left of the spreadsheet, but you can also just overwrite the values in the green cells in the 2nd table (the results calculation table) immediately to the right of the table of plotted values under the chart. More information about how to do that in a sample period invariant way in <a href="http://www.bondeconomics.com/2016/03/models-are-not-frequency-invariant.html?showComment=1458156126970#c1754417516867181724" target="_blank">this comment on Brian Romanchuk's blog</a> repeated here for convenience:</span></span></span></span><br /><br /><i><span id="bc_0_25b+seedBoUND" kind="d">I did not attempt to make this work with any other functions for G other than a scaled unit step. You can choose G&L's $20/period to match theirs, or any other. More general <a href="http://banking-discussion.blogspot.com/2016/03/sim4.html" rel="nofollow">G functions addressed here</a>. But even with the spread sheet above, you could make it work for G at a constant rate per period, by typing over the G values in the calculation table: so long as you matched the function precisely: for example originally you may have G be $20/period for period 1 and then $40/period for period 2. If you halved the sample rate to 0.5 periods, then you'd leave G at $20/period (=$10/half-period in the spreadsheet) for the 1st 2 sample periods, and then switch it to $40/period (=$20/half-period in the spreadsheet) for the next two, etc.</span></i><br /><br /><i><span id="bc_0_25b+seedBoUND" kind="d">-------------------------------------------------------------------------------------------------------- </span></i><br /><br /><a href="http://informationtransfereconomics.blogspot.com/2016/03/more-on-stock-flow-models.html?showComment=1458192351122#c1952505938711252475" target="_blank"><span id="bc_0_25b+seedBoUND" kind="d">Note in a comment here by me about Jason's formulation of </span>ΔH = Γ*(G - T)</a> and how Γ is equivalent to the approximate adjustment for a new sample period (Ts2) in my <a href="http://banking-discussion.blogspot.com/2016/03/sim.html" target="_blank">original SIM formulation</a>, except without changing the sample times on the plot (thus approximately scaling the time constant). In this case Γ plays the role of the alpha2 and B scalar Ts2/Ts1 = T_ratio.<span id="bc_0_25b+seedBoUND" kind="d"> </span><i><span id="bc_0_25b+seedBoUND" kind="d"> </span></i><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">-------------------------------------------------------------------------------------------------------- </span></span> </span></span><br /><br />Expressions from the spreadsheet's table repeated below for convenience:<br /><br /><br /><table border="0" cellpadding="0" cellspacing="0" style="width: 500px;"><colgroup><col style="width: 48pt;" width="64"></col> <col style="mso-width-alt: 2011; mso-width-source: userset; width: 41pt;" width="55"></col> <col style="mso-width-alt: 1901; mso-width-source: userset; width: 39pt;" width="52"></col> <col style="mso-width-alt: 2523; mso-width-source: userset; width: 52pt;" width="69"></col> <col style="mso-width-alt: 2011; mso-width-source: userset; width: 41pt;" width="55"></col> <col style="mso-width-alt: 2596; mso-width-source: userset; width: 53pt;" width="71"></col> <col style="mso-width-alt: 4900; mso-width-source: userset; width: 101pt;" width="134"></col> </colgroup><tbody><tr height="22" style="height: 16.5pt;"> <td class="xl63" height="22" style="height: 16.5pt; width: 48pt;" width="64">Matrix</td> <td class="xl63" style="border-left: none; width: 41pt;" width="55">Element</td> <td class="xl63" style="border-left: none; width: 39pt;" width="52">Name</td> <td class="xl69" colspan="4" style="border-left: none; border-right: 1.5pt solid black; width: 247pt;" width="329">Expression</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl67" height="22" style="border-top: none; height: 16.5pt;">A</td> <td class="xl68" style="border-left: none; border-top: none;">(1,1)</td> <td class="xl68" style="border-left: none; border-top: none;">A_0</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>1-theta*alpha2_0/(1-alpha1_0*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl67" height="22" style="border-top: none; height: 16.5pt;">B</td> <td class="xl68" style="border-left: none; border-top: none;">(1,1)</td> <td class="xl68" style="border-left: none; border-top: none;">B_0</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>1-theta/(1-alpha1_0*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl75" height="88" rowspan="4" style="border-bottom: 1.5pt solid black; border-top: none; height: 66.0pt;">Cm</td> <td class="xl64" style="border-left: none; border-top: none;">(1,1)</td> <td class="xl64" style="border-left: none; border-top: none;">CY</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>alpha2/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl65" height="22" style="border-left: none; height: 16.5pt;">(2,1)</td> <td class="xl65" style="border-left: none;">CT</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>theta*alpha2/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl65" height="22" style="border-left: none; height: 16.5pt;">(3,1)</td> <td class="xl65" style="border-left: none;">CYD</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>(1-theta)*alpha2/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl66" height="22" style="border-left: none; height: 16.5pt;">(4,1)</td> <td class="xl66" style="border-left: none;">CC</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>alpha2/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl75" height="88" rowspan="4" style="border-bottom: 1.5pt solid black; border-top: none; height: 66.0pt;">D</td> <td class="xl64" style="border-left: none; border-top: none;">(1,1)</td> <td class="xl64" style="border-left: none; border-top: none;">DY</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>1/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl65" height="22" style="border-left: none; height: 16.5pt;">(2,1)</td> <td class="xl65" style="border-left: none;">DT</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>theta/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl65" height="22" style="border-left: none; height: 16.5pt;">(3,1)</td> <td class="xl65" style="border-left: none;">DYD</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>(1-theta)/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl66" height="22" style="border-left: none; height: 16.5pt;">(4,1)</td> <td class="xl66" style="border-left: none;">DC</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>1/(1-alpha1*(1-theta)) - 1</td> </tr><tr height="22" style="height: 16.5pt;"> <td height="22" style="height: 16.5pt;"><br /></td> <td><br /></td> <td><br /></td> <td><br /></td> <td><br /></td> <td><br /></td> <td><br /></td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl69" colspan="2" height="22" style="border-right: 1.5pt solid black; height: 16.5pt;">Description</td> <td class="xl63" style="border-left: none;">Name</td> <td class="xl69" colspan="4" style="border-left: none; border-right: 1.5pt solid black;">Expression</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl78" colspan="2" height="22" style="border-right: 1.5pt solid black; height: 16.5pt;">sample prd ratio</td> <td class="xl68" style="border-left: none; border-top: none;">T_ratio</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;">Ts/Ts_0</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl78" colspan="2" height="22" style="border-right: 1.5pt solid black; height: 16.5pt;">A(T_ratio)</td> <td class="xl68" style="border-left: none; border-top: none;">A</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;">A_0^T_ratio</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl78" colspan="2" height="22" style="border-right: 1.5pt solid black; height: 16.5pt;">B(T_ratio)</td> <td class="xl68" style="border-left: none; border-top: none;">B</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;">(B_0*(A-1)/(A_0-1))/T_ratio</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl78" colspan="2" height="22" style="border-right: 1.5pt solid black; height: 16.5pt;">alpha1(T_ratio)</td> <td class="xl68" style="border-left: none; border-top: none;">alpha1</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;">((1-B)-theta)/((1-B)*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl78" colspan="2" height="22" style="border-right: 1.5pt solid black; height: 16.5pt;">alpha2(T_ratio)</td> <td class="xl68" style="border-left: none; border-top: none;">alpha2</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;">(1-A)*(1-alpha1*(1-theta))/theta</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl78" colspan="2" height="22" style="border-right: 1.5pt solid black; height: 16.5pt;">orig. time const.</td> <td class="xl68" style="border-left: none; border-top: none;">Tc_0</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;">-Ts_0/LN(A_0)</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl78" colspan="2" height="22" style="border-right: 1.5pt solid black; height: 16.5pt;">Tc(T_ratio)</td> <td class="xl68" style="border-left: none; border-top: none;">Tc</td> <td class="xl72" colspan="4" style="border-left: none; border-right: 1.5pt solid black;">-Ts/LN(A) [note: you should have Tc = Tc_0]</td> </tr></tbody></table><br />Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-69042521573168600632016-03-13T14:45:00.004-07:002016-04-23T00:28:58.104-07:00SIM5: summary and to-doThis post is meant to be a stand-in for an eventual fully fleshed out post tying my previous posts on this subject together: namely <a href="http://banking-discussion.blogspot.com/2016/03/sim.html" target="_blank">SIM</a>, <a href="http://banking-discussion.blogspot.com/2016/03/sim2.html" target="_blank">SIM2</a>, <a href="http://banking-discussion.blogspot.com/2016/03/answer-for-henry-1.html" target="_blank">Answer for Henry #1</a>, <a href="http://banking-discussion.blogspot.com/2016/03/sim3.html" target="_blank">SIM3</a> and <a href="http://banking-discussion.blogspot.com/2016/03/sim4.html" target="_blank">SIM4</a>. A brief summary follows:<br /><br /><u><b>SIM:</b></u> 1st attempt to code up G&L's SIM in a spreadsheet in a discrete time state space format. It worked the 1st time with the sample period (Ts) set to 1. H is the sole state variable producing the system dynamics, and at first I interpreted the exogenous input G and the outputs (system "measurements") all as rates in dollars/original-period (and I named the original period (Ts1) a "year" for convenience). The outputs are Y, T, YD and C. Ramanan, commenting on Jason's blog, suggested scaling the parameter alpha2 by Ts2/Ts1 to change sample periods, where Ts1 = 1 and Ts2 is the new desired sample period. This didn't work for me at first because I was interpreting G, Y, T, YD and C as rates and I wasn't changing their units to match the new sample period. Naturally Ramanan assumed I would think of these as quantities, not rates, so that their values would scale with the sample period (which amounts to keeping them as rates and changing their units to dollars per Ts2). Once I sorted that out, I redid the spreadsheet and found that scaling alpha2 by Ts2/Ts1 was an OK approximation, but not perfect: the system time constant (Tc) does change, and the reason is G&L are doing one of the following:<br /><ol><li>Assuming the "compounding times" always precisely coincide with the sample times, so Tc does change when the sample period changes (because it means a different compounding rate).</li><li>Approximating continuous compounding by approximating exp(-t/Tc) as 1 - t/Tc</li></ol>Another problem with SIM the way G&L formulate it is that you cannot select a Ts2 >= Ts1*alpha1/alpha2_orig (where alpha2_orig is the the original value of alpha2 before scaling it by Ts2/Ts1). You can set it to what you like of course, but they specify in their text that 0 < theta < 1 and that 0 < alpha2 < alpha1 < 1. This means starting with their default values for the parameters, Ts2 must be < 1.5*Ts1 = 1.5 periods. You can actually make it bigger (of course) and it works OK up until about Ts2 = 6.5... then the resulting A parameter in the difference equation goes 0 and then it goes negative as Ts2 > 6.5. This results in wild oscillations in the curves as Ts2 gets up to values like 10 or 20. But following G&L's restrictions, then varying Ts2 over (0,1.5) brings a variation in time constant (Tc) of about 14% (from a low of about 5.7 at Ts2 = 1.5 to a high of 6.5 as Ts2 -> 0). The default value of Tc with Ts = 1 is about 6 "periods."<br /><br /><u><b>SIM2:</b></u> I started this one when I 1st apparently failed to get SIM to be sample period invariant by using Ramanan's method of scaling alpha2 by Ts2/Ts1. Essentially what I did here was find the equivalent continuous time system and use the time constant from that to find the discrete time state space parameters A and B for Ts2. This amounted to replacing the approximation for exp(-t/Tc) with the exact value. This version did not require changing my interpretation of G, Y, T, YD and C as rates expressed in dollars/(period=Ts1), so naturally I was excited to see that the curves were indeed invariant to the sample period. However, looking at it later and calculating Jason's <span id="bc_0_154b+seedR7m8D" kind="d">Γ = </span>ΔH/(G - T) I realized that <span id="bc_0_154b+seedR7m8D" kind="d">Γ = 1 only when Ts=1. So essentially, SIM2 violates stock-flow consistency (SFC), even though H, G, Y, T, YD and C are all sample period invariant. However, I did add an alternative means of calculating the constants CT and DT which are used to produce T: namely T[n] = CT*H[n-1] + DT*G[n]. Using these alternative expressions produces a different T curve, which I added to the plot. It is precisely the same as the original T curve when Ts=1, but differs slightly when Ts </span><span class="_Tgc">≠ 1. In addition SIM2 has no upper bound on Ts2 (no oscillation problem as in SIM1).</span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><u><b>Answer for Henry #1:</b></u> Not much to say here, except that this is where I introduce block diagrams of both the discrete and continuous time system equivalents. Note that my naming convention for G and T (and I suppose for the other outputs Y, YD and C) are a bit confusing on the plots up through this one, and in my block diagram as well. That's because of the confusion about G being dollars, or dollars per period=Ts1 or dollars per period=Ts2, etc.</span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><u><b>SIM3:</b></u> Here I was determined to get the best of both SIM and SIM2: Namely match G&L's SIM with Ts=1, have sample period invariance and satisfy all of G&L's equations over any sample period (or more generally, between any two arbitrary sample times). I accomplished that goal with some qualifications: 1st I restrict Gdot (Gdot a rate of government spending measured in constant units of dollars/(period=Ts1) to be a scaled unit step function: 0 for t < 0, and constant for all t >= 0. Then H takes the form of Hss*(1 - exp(-t/Tc)), where Hss = steady state H = Gdot*B/(1-A). G (now interpreted as the sum from -inf to t = sum from 0 to t of all government spending) is 0 for t < 0 and Gdot*t for t >= 0. Thus I define T (the sum from 0 to t of all taxes collected) as T = G - H. This has the effect of both making the system sample period invariant and forcing it to satisfy G&L's accounting equation (i.e. </span><span id="bc_0_154b+seedR7m8D" kind="d">Γ = 1, once you use the right version of G and T (the confusion with symbols in this post continues)), and (of course) forcing it to agree with G&L when Ts=1. However, I didn't check Y, YD or C, only H, G and T.</span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><u><b>SIM4:</b></u> This post does not include a spreadsheet, but it does document the math required to extend SIM3 to accept more general G functions and to turn it back into an iterative state space discrete time difference equation. In this post I explicitly show the connection between the continuous time formulas and discrete time formulas for a broad class of G functions (really g functions). Also, I make an attempt to provide consistent variable names: both internally consistent and consistent with G&L. Namely, G and T become quantities again, measured in dollars, and thus dependent on the sample period length. The math is mostly done in relation to g = sum total of all dollars spent by the government, and it's derivative gdot (or g') (and a lower and upper case gamma (</span><span id="bc_0_214b+seedDWD" kind="d">γ and </span><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"></span><span id="bc_0_154b+seedR7m8D" kind="d">Γ respectively), and some Dirac delta components of g', which I refer to by gm, giving us the ability to introduce step functions into g).</span> Like SIM3, this model does not attempt to sort out or check what Y, YD or C are or ensure I have the correct expressions for them so that they always satisfy G&L's accounting equations.</span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d">---------------------------------------------------------------------------------------------------------</span><br /><br /><span id="bc_0_154b+seedR7m8D" kind="d"><u><b>SIM5:</b></u> Which brings us to the point of this post. The bit I'm missing in all but the non-sample-period-invariant SIM above is ensuring that ALL of G&L's accounting equations are always satisfied between any arbitrary sample times. I can get </span>ΔH = G - T to be satisfied in all of them (using T-alt in SIM2), but not necessarily the rest. This got me thinking about a couple of strategies:<br /><ol><li> Starting with SIM 1, which guarantees that all G&L's accounting equations will always be satisfied, it occurred to me that I can adjust alpha2 for a new sample period (Ts2) from the original sample period (Ts1=1) in a way other than scaling it by Ts2/Ts1: Given that A1 is the original feedback parameter (see SIM1), I can calculate a new alpha2 like this: alpha2 = (1 - A1^(T1/T2))*(1 - alpha1*(1 - theta))/theta (where alpha1 and theta are the original values). This preserves the time constant (Tc), but probably messes up the steady state value, so I'd need to adjust B1 as well (this change to alpha2 will produce a new A, which I'll call A2). But this may lead to having to change all the "C" and "D" parameters (the former used to scale H[n-1] and the latter used to scale G[n] such that their sum produce the set of outputs Y, T, YD and C). Thus really, this will probably lead to having to adjust alpha1 and theta as well, so that all the accounting equations are always satisfied. <i><span style="color: #b45f06;">[Update 2016.04.22: Just alpha1 actually. See the update this date in SIM6]</span></i></li><li>Starting with the alternate variables I added to the SIM2 spreadsheet (alpha2alt, T-alt, CTalt and DTalt), I can actually solve for an alpha1alt and theta1alt<span style="color: #b45f06;"><i> [Update 2016.04.22: No, this doesn't actually work for solving for alpha1alt and theta1alt]</i></span>. I have a feeling doing so will result in the same solution as for strategy 1 above. Note that when Ts=1 these alternative values are the same as the regular values. The original intent was to see if I could find a new CT and a new DT when Ts = Ts2 <span class="_Tgc">≠ 1 that would always satisfy </span>ΔH/(G - T) := Jason's <span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ = 1. (Note that Jason's </span></span><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ </span></span><span class="_Tgc">≠ </span><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ in SIM4). I could by starting with T = G - </span></span>ΔH and solving for CTalt and DTalt. Then I can use the fact that CTalt = alpha2*DTalt when Ts=1 (since when Ts=1, CT = alpha2*DT) to find a new alpha2alt = CTalt/DTalt when Ts <span class="_Tgc">≠ 1. I can then use other expressions in the table of expressions for coefficients in the lower left of the spreadsheet in SIM to solve for thetaalt in terms of alpha1alt, and then to solve for alpha1alt, and back-substitute to find a value for thetaalt. Essentially I'll be finding a new set of parameters to go with the new sample period (Ts2), and thus all G&L's accounting formulas should continue to be satisfied.</span></li><li><span class="_Tgc">It occurred to me that I could adjust theta, alpha1 and alpha2 for a new sample period Ts2 by assuming they are currently representing the effective rate for continuously compounding over the default sample periods Ts1 = 1. G&L's (Ramanan's) procedure of only scaling alpha2 by Ts2/Ts1 is an approximation to this, assuming continuous compounding. They only scale alpha2 because it's the only one multiplying the total accumulated cash (H) in the economy, while both alpha1 and theta scale quantities which only apply that particular sampler period. Thus for example, if Ts2 = 1/4, then they scale alpha2 by (1/4)/1 = 1/4. But if we assume that exp(x*Ts1) = 1+alpha2, then x = log(1+alpha2)/Ts1, and scaling to Ts2 would give alpha2_new = alpha2(Ts2) = alpha2^(Ts2/Ts1)-1. Scaling theta and alpha1 would be slightly different (they'd maintain values much closer to their starting values), but I'm not sure what that would be yet. I don't have a lot of hope that this strategy (strategy 3) will actually work. <span style="color: #b45f06;"><i>[Update 2016.04.22: a lack of hope for this strategy is probably a good thing. See SIM6, SIM7, SIM9 and SIM10] </i></span></span></li></ol><span class="_Tgc">[Update: it's strategy 1. that actually worked. See Update #1 below for more details and a new post demonstrating this]</span><br /><br /><span class="_Tgc">I did a little more preliminary work on Strategy 2 above and came up with the following:</span><br /><br /><strike><span class="_Tgc">Using the equation for the original B, I can put thetaalt in terms of alpha1alt: </span></strike><br /><strike><span class="_Tgc">thetaalt = [(1-Balt) + alpha1alt*(1-Balt)]/(1 + alpha1alt*(1-Balt))</span></strike><br /><strike><span class="_Tgc"><br /></span></strike><strike><span class="_Tgc">Also this is useful:</span></strike><br /><strike><span class="_Tgc">1-thetaalt = Balt/</span><span class="_Tgc">(1 + alpha1alt*(1-Balt))</span></strike><br /><strike><br /></strike><strike><span class="_Tgc">Then using the equation for the original A, I already have alpha2alt (see Strategy 2 above), and replacing thetaalt with the above expression, I get an expression only in alpha1alt, which looks like a quadratic, which I can then solve for alpha1alt and back-substitute into the above to find thetaalt:</span></strike><br /><strike><br /></strike><strike><span class="_Tgc">(1-Aalt)*(1+alpha1alt)*(1+alpha1alt*(1-Balt)) = alpha2alt*(1-Balt+alpha1alt*(1-Balt))*(1+alpha1alt*(1-Balt))</span></strike><br /><br /><span class="_Tgc">Then I should have a complete new set of parameters which give me the same time constant Tc (and thus sample period invariance) and because they are a complete new set, simultaneously cause all variables (H, </span><span class="_Tgc">ΔH, G, Y, T, YD and C) to satisfy all G&L's equations. </span><span style="color: #b45f06;"><i>[Update 2016.04.22: Nope]</i></span><br /><br /><span class="_Tgc">I'll leave that for another day! </span><br /><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div>Note that Brian Romanchuk has been doing some posts on related issues, <a href="http://www.bondeconomics.com/2016/03/models-are-not-frequency-invariant.html" target="_blank">here </a>and <a href="http://www.bondeconomics.com/2016/03/discrete-time-models-and-sampling.html" target="_blank">h<span id="goog_1509406968"></span><span id="goog_1509406969"></span>ere</a>.<br /><br />UPDATE #1: March 15, 2016 10:17 PM<br />Another day has arrived!<br />Note that what I crossed out above I think had an error in it (or at least it didn't reduce to a quadratic or any other equation that would uniquely determine the parameters, as I'd anticipated). Also I found that theta and alpha1 were not uniquely determined by the equations. But leaving theta as the original value seemed to work best, so I just adjust alpha1 and alpha2 now <span style="color: #b45f06;"><i>[Update 2016.04.22: See the SIM6 update of this date about why "leaving theta as the original" seemed to work best]</i></span>. The resulting spreadsheet is a direct modification of SIM called <a href="http://banking-discussion.blogspot.com/2016/03/sim6-updated-sim-to-preserve-time.html" target="_blank">SIM6</a> and it seems to be successful in being sample period invariant and satisfying all G&L's expressions (which I verified by calculated integrated values for Y, T, YD and C for an arbitrary Ts and comparing those with integrated values for Ts=1).<br />END UPDATE #1<br /><br />------------------------------------------------------------------------------------------------------------<br /><br />UPDATE #2: March 17, 2016:<br /><br /><a href="http://banking-discussion.blogspot.com/2016/03/sim6-updated-sim-to-preserve-time.html" target="_blank">SIM6</a>: A modified version of my <a href="http://banking-discussion.blogspot.com/2016/03/sim.html" target="_blank">SIM</a> post which adjusts alpha1 and alpha2 to keep the time constant fixed when the sample period (Ts) changes. Because SIM obeys all G&L's expressions by it's construction, then so does SIM6. Also it matches G&L's results with their default parameters (alpha1=0.6, alpha2=0.4, theta=0.2, Ts=1). Tables (that you must scroll all the way to the right to see, using the scroll bar along the bottom of the embedded spreadsheet) integrate Y, T, YD and C so that you can compare these integrated (accumulated) values with a static table for which this was done with G&L's default parameters. This allows you to see that indeed all of G&L's expressions must be satisfied.<br /><br /><br />To-do: I list some things that could be on a to-do list (for SIM7?) in <a href="http://www.bondeconomics.com/2016/03/models-are-not-frequency-invariant.html?showComment=1458232374029#c5554042812002405660" target="_blank">this comment on Brian Romanchuk's blog</a>: (repeated here for convenience):<br /><br /><i><span id="bc_0_29b+seedD49SD" kind="d">"Or you could just keep the continuous time model without any extra terms in b. Then you can do an observability and controllability analysis (easy in this case), do pole and zero placement with a fixed feedback law, add noise to the analysis, design a Kalman filter, design a time varying optimal feedback control law for various objective functions or design a robust control law to achieve a minimum performance level over a whole set of plants that could exist due to our uncertainty about the plant. These things could be done in either discrete or continuous time, but the model is simpler in continuous time"</span></i><br /><br /><br />Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-39080111967740607782016-03-12T15:09:00.004-08:002016-03-21T22:45:49.486-07:00SIM4: the math for an updated SIM3 for a broader class of government spending functions.The below model fleshes out a pair of comments made to Henry <a href="http://banking-discussion.blogspot.com/2016/03/answer-for-henry-1.html?showComment=1457648477325#c4285117314032871480" target="_blank">here</a> as well as one made to Bill <a href="http://informationtransfereconomics.blogspot.com/2016/03/more-on-stock-flow-models.html?showComment=1457722911634#c3705380402966650575" target="_blank">here</a>. If it looks fuzzy, zoom in with your browser (CTRL+) and then refresh the page (it worked for me). It's essentially an update of <a href="http://banking-discussion.blogspot.com/2016/03/sim3.html" target="_blank">SIM3</a>.<br /><br />To do: I'm positive this will match G&L's SIM at Ts = 1 with dg/dt = a constant = G per period. And I'm sure that it will be time invariant if we calculate A and B as shown, while we continue to satisfy ΔH = G - T over any pair of sample times. (I know, because I can force T = G - ΔH). What I don't know is if the other accounting formulas for Y, YD and C will continue to hold at different sample periods (given the way they are all expressed now as a linear combination of H and G with coefficients which are only functions of theta, alpha1 and alpha2) [Update: see <a href="http://banking-discussion.blogspot.com/2016/03/sim5-summary-and-to-do.html" target="_blank">new post here</a>]. See <a href="http://banking-discussion.blogspot.com/2016/03/sim.html" target="_blank">here for a listing of what these coefficients are at Ts=1</a>. I suspect I may need to change theta, alpha1 alpha2, or the whole expressions to match different sample periods. This would be akin to interpreting their current values as the result of continuous compounding over Ts=1.<br /><br /><br /><iframe frameborder="0" height="1370" scrolling="yes" src="https://onedrive.live.com/embed?cid=ADAE118FF12AB43B&resid=ADAE118FF12AB43B%21311&authkey=AGcgKdS020oJIgU&em=2" width="1060"></iframe> Note that incorporating steps in g(t) (equivalent to scaled and shifted Dirac deltas in g'(t)) in the discrete time version is a bit of a pain in the ass because you have to keep track of when those steps are in time, and constantly check to see if the last sample period (i*Ts to (i+1)*Ts) included any... and then you have to adjust the state transition function (exp(a*((i+1)*Ts-tm)) for each one in the interval (assuming they can happen anywhere (t=tm) withing the sample period). The corresponding element of row vector B for the mth step in g (called gm) would be b*exp(a*((i+1)*Ts-tm)). So if there were a finite number (M) of such steps, you could augment B and <span id="bc_0_154b+seedR7m8D" kind="d">Γ each with</span> M more entries. The M extra entries in <span id="bc_0_154b+seedR7m8D" kind="d">Γ would always be 0 except when a step occurred over the sample period, in which case the entries corresponding to the steps happening in that sample period would take a value of gm, as per the expressions above (m being the index to gm and tm, ranging from 0 to M-1)</span>. So it's not impossible, but messy. At least it's a linear system and the effects from all that stuff just adds together. Allowing a single step at t=0 might be a good compromise (for simulations restricted to t >= 0): it'd be easy to accommodate, and it would allow for easily maintaining sample period invariance. (You could fairly easily allow them at each sample time, but then it wouldn't be so fun if you changed to a new arbitrary sample period).<br /><br />Also note that I've used a confusing array of notation for variables related to G&L's G (and T) over the past few posts. I think the above document is my most consistent take on it. But just to be explicit:<br /><br />G[i] = integral of g'(t) over one sample period = g((i+1)*Ts) - g(i*Ts)<br /><br />T will have a similar definition, and unfortunately lower case t is going to be a mess. So instead I'll define (ΔH)[i] = H[i] - H[i-1], and from that set T[i] = G[i] - (ΔH)[i]. I didn't do any of that above, but based on <a href="http://banking-discussion.blogspot.com/2016/03/sim3.html" target="_blank">SIM3</a>, I know that doing so will satisfy ΔH = G - T (obviously) for all sample periods, but also match G&L's T at Ts=1. I have everything I need above and in the expressions for Y, T, YD and C <a href="http://banking-discussion.blogspot.com/2016/03/sim.html" target="_blank">here</a> to find an expression for T and see if theta, alpha1 and alpha2 need adjustment when Ts changes. I'll leave that as an exercise for another day (SIM5?). Ultimately I want to be able to say what G&L should do to preserve sample period invariance while still satisfying all their equations. If that means the parameters have to be adjusted somehow, then so be it. <br /><br />If you spot an error, do me a favor and let me know in the comments. Or better yet, download the document (in the bar at the bottom), correct it and email it back to me at brown.tom5@gmail.com. Or if you see a way to improve my notation, let me know. I struggled with allowing step functions in g(t) while also doing a Taylor expansion of g'(t)... thus I introduced big and little gamma. Perhaps there's a much cleaner way to state the whole thing, while preserving G as G&L define it.<br /><br />UPDATE 1:<br />Jason Smith put a post up with an <a href="http://informationtransfereconomics.blogspot.com/2016/03/an-rlc-circuit-with-r-s-and-l-f.html" target="_blank">electrical circuit analogy</a>. I solve it with <a href="http://informationtransfereconomics.blogspot.com/2016/03/an-rlc-circuit-with-r-s-and-l-f.html?showComment=1458620655720#c4241249849246239926" target="_blank">particular values for R and L</a>. Also <a href="http://www.bondeconomics.com/2016/03/finding-solution-in-simple-sfc-model.html" target="_blank">Brian Romanchuk has another post specifically on G&L's SIM model.</a><br />END UPDATE 1. <br /><span style="font-size: x-small;"><br /></span><span style="font-size: x-small;">Note to self: The embedded document above has height set to 1370 and width at 1060 (in case accidentally erase it again!) </span>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-20763483652885043842016-03-09T13:26:00.005-08:002016-03-12T16:58:22.800-08:00SIM3: 1) Matches G&L's SIM @ Ts=1; 2) Invariant to Ts; 3) Always satisfies ΔH = G - T1. Matches <a href="http://banking-discussion.blogspot.com/2016/03/sim2.html" target="_blank">G&L's SIM</a> with the sample period Ts = 1 (year)<br /><br />2. Sample period (Ts) invariant<br /><br />3. Satisfies ΔH = ΔG - ΔT over all intervals [1]<br /><br />To do: calculate Y, YD and C and check that they also satisfy G&L's equations over any pair of sample times.<br /><br />Limitations: Gdot := dG/dt restricted to scaled step function with step at t=0. Note that this is not a fundamental limitation of the approach, it just represents more work to add generality, and this was just a quick and easy check to make sure I could do numbers 1, 2 and 3 above.<br /><br /><span style="color: blue;">UPDATE 1: March 12, 2016, 4:54 PM</span><br />I generalized the approach below in <a href="http://banking-discussion.blogspot.com/2016/03/sim4.html" target="_blank">a new post called SIM4</a> to handle a much broader class of government spending functions. I just did the math at this point. If you find an error, let me know (see the note under the document of equations).<br /><span style="color: blue;">END UPDATE 1 </span><br /><br />Notes:<br />[1] My ΔG here is called G in G&L, and my ΔT is called T in G&L. I reserve G for the integrated total of all government spending since t=-inf, and T as the integrated total taxes collected since t=-inf.<br /><br /><br /><iframe frameborder="0" height="1000" scrolling="no" src="https://onedrive.live.com/embed?cid=ADAE118FF12AB43B&resid=ADAE118FF12AB43B%21309&authkey=AL_54B4uumrZbrY&em=2&AllowTyping=True&ActiveCell='Sheet1'!B7&Item='Sheet1'!A1%3AM45&wdHideGridlines=True&wdDownloadButton=True" width="900"></iframe> <br /><br /><br /><br /><br /><br />Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-80726894047305304042016-03-06T18:56:00.000-08:002016-03-11T22:04:07.655-08:00Answer for Henry #1<span id="bc_0_214b+seedDWD" kind="d">Below is my answer to <a href="http://informationtransfereconomics.blogspot.com/2016/03/more-like-stock-flow-in-consistent.html?showComment=1457287424511#c6003614861912876177" target="_blank">a question posed by Henry on Jason's blog</a>.</span><br /><br /><span id="bc_0_214b+seedDWD" kind="d">"My question is do these terms make sense"<br /><br />Examining those terms in isolation is misleading. I'm NOT saying the whole expression makes sense (as per Jason's point, I think), but looking at those terms in isolation and examining their sensical-ness (new word) is the wrong approach. For example, what if I told you that x(t) -> inf as t -> 0 and y(t) -> inf as t->0, is it possible that x(t) - y(t) could approach something meaningful as t -> 0? Of course it is, because I'm interested in their difference, not the individual terms.<br /><br />Allow me to take a stab at explaining the issue in a way that perhaps isn't as general as Jason's approach, but which I nonetheless find to be clearer. Going back to his definition:<br /><br />γ := rate of government spending, in dollars/year (say)<br /><br />But instead of making ξ := rate of taxation in dollars/year, let's leave that out of it. Now say<br /><br />ΔH[n+1,n] = H[n+1] - H[n] = γ*Δt - T (abandoning your <> notation in favor of [] because of technical difficulties)<br /><br />Now lets say (as is the case in the SIM model if you do the algebra) T = r*H, with r a fraction (a constant fraction to make it simple, say on (0,1), defined as a rate per unit of time τ, which initially happens to be τ = Δt, but of course will not hold if Δt changes), or putting indices on it:<br /><br />T[n+1,n] = r*H[n]<br /><br />Now we have:<br /><br />ΔH</span><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">[n+1,n]</span> = H[n+1] - H[n] = γ*Δt - T = γ*Δt - r*H[n]<br /><br />To simplify further, set γ = 0 for now, so we have:<br /><br />H[n+1] = (1-r)*H[n] = A*H[n] where A = 1-r<br /><br />This has a well known solution:<br /><br />H[k] = H0*(A^k), for all k >= 0, and where H0 = H[0] (i.e. H0 is the initial allotment of money in the economy).<br /><br />And because r is on (0,1) then so is A, so this will be an exponentially decaying function (a sampled exponential).<br /><br />Now what happens if we change our sample period Δt? Well r doesn't change, nor does τ it's defined over, but <br /><br />(1) H[n+1] = </span><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">A*H[n] =</span> (1-r)*H[n] <br /><br />No longer holds. Why? Imagine that it did hold, and that say r = A = 0.5. So in one time step Δt, half the money disappears from the economy through taxation. If Δt = τ = 1 year to start out, then in 1 year half the money is gone. Now say Δt is reduced to 1 day... then if equation (1) still held, then in one day half the money is gone. Thus (1) would NOT be describing the same system. We're sampling an underlying continuous time system, so we have to account for that. The real rate of decay (time constant) of the system should be independent of the sample period. The answer is we need to adjust A as Δt changes, because A was always an implicit function of Δt (i.e. A in (1) is A(</span><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">τ), and so is only valid when </span></span><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">Δt = </span></span></span><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">τ</span></span></span>)</span>. We can write a valid version of (1) if we adjust A for when </span><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">Δt </span></span></span><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_22b+seedSpED" kind="d">≠</span> </span></span></span><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">τ as follows:</span></span></span></span></span><br /><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"> </span><br />(2) A(Δt) = A(τ)^(Δt/τ)</span><br /><span id="bc_0_214b+seedDWD" kind="d"><br /></span><span id="bc_0_214b+seedDWD" kind="d">So then using (2) our valid version of (1) for any </span><span id="bc_0_214b+seedDWD" kind="d">Δt is as follows:</span><br /><span id="bc_0_214b+seedDWD" kind="d"><br /></span><span id="bc_0_214b+seedDWD" kind="d">(3) H[n+1] = A(</span><span id="bc_0_214b+seedDWD" kind="d">Δt)*H[n]</span><br /><span id="bc_0_214b+seedDWD" kind="d"><br />Now in this simple case, it turns out that 1-r*Δt/τ </span><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_115b+seedKssTD" kind="d">≈</span> A(Δt), but it's not exact. Also, in the limit as Δt -> 0 we have A(Δt) -> 1, so our difference equation (1) breaks down. We need to replace it with a differential equation:<br /><br />dh/dt = (ln(A)/τ)*h = a*h, where ln() is natural log<br /><br />and where a = ln(A)/τ, and H[n] = h(n*Δt). Note that a < 0 in this example because A is on (0,1)<br /><br />The solution to this equation is:<br /><br />h(t) = exp(a*t)*H0 <br /><br />That's the underlying continuous time system. Since a < 0, it's a decaying exponential, as before. We can sample it at any Δt we choose:<br /><br />H[n] = (exp(a*Δt)^n)*H0<br /><br />or in difference formula form:<br /><br />H[n+1] = exp(a*Δt)*H[n]</span><br /><span id="bc_0_214b+seedDWD" kind="d"><br />Which suggests an alternative formulation of equation (2) when the continuous-time time constant -1/a is known [1]:</span><span id="bc_0_214b+seedDWD" kind="d"><br /></span><br /><br /><span id="bc_0_214b+seedDWD" kind="d">(4) A(</span><span id="bc_0_214b+seedDWD" kind="d">Δt) = exp(a*</span><span id="bc_0_214b+seedDWD" kind="d">Δt)</span><br /><span id="bc_0_214b+seedDWD" kind="d"><br />I leave as an exercise to the reader the case where γ > 0. :D</span><br /><span id="bc_0_214b+seedDWD" kind="d"> </span><span id="bc_0_214b+seedDWD" kind="d"> </span><br /><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">[Hint, try <a href="http://wolfweb.unr.edu/%7Efadali/ee472/DTState-Space.pdf" rel="nofollow">this</a>] <br /><br />Or if you want to see it worked out for the SIM example, look at how I calculate B <a href="http://banking-discussion.blogspot.com/2016/03/sim2.html" rel="nofollow">here at the bottom</a>.</span></span><br /><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-Wl8jGPivS3Y/VuG-88lrQoI/AAAAAAAAAvk/X8DtHDc7N5M/s1600/SIM2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="422" src="https://2.bp.blogspot.com/-Wl8jGPivS3Y/VuG-88lrQoI/AAAAAAAAAvk/X8DtHDc7N5M/s640/SIM2.png" width="640" /></a></div><br />What G&L are doing amounts to assuming that (2) below (the first two terms of (1) (also below)) is a good approximation, and I think they try to restrict alpha1, apha2 and theta to accomplish that. But even with those restrictions, (2) can sometimes be a terrible approximation for (1). Either that or they are assuming the rate of compounding always matches the sample rate. Note that in the more general case where we substitute square matrix A for <i>a</i>, (1) and (2) still hold, provided we take A raised to n to represent A matrix multiplied by itself n times in (1), and substitute the identity matrix I for 1 in (2).<br /><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-xaA8ZF_ElRY/VuHdUBzjhtI/AAAAAAAAAwI/FoyuvmevuuA/s1600/approx_exp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://2.bp.blogspot.com/-xaA8ZF_ElRY/VuHdUBzjhtI/AAAAAAAAAwI/FoyuvmevuuA/s320/approx_exp.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://1.bp.blogspot.com/-R1nMSqvwgfQ/VuM0DdUL_YI/AAAAAAAAAw8/bbTA3yukTH8VhrOiWYsSNnsoIoeZ1Cl1g/s1600/SIM_discrete_and_continuous_time.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="206" src="https://1.bp.blogspot.com/-R1nMSqvwgfQ/VuM0DdUL_YI/AAAAAAAAAw8/bbTA3yukTH8VhrOiWYsSNnsoIoeZ1Cl1g/s640/SIM_discrete_and_continuous_time.png" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">Discrete and continuous time system equivalents, where H[n] = h(n*Ts), etc. Ts being the sample period</span></span></td></tr></tbody></table></span></span><br /><div class="separator" style="clear: both; text-align: center;"></div><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"></span></span><div class="separator" style="clear: both; text-align: center;"></div><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d"></span></span><br /><br /><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">NOTES:</span></span><br /><br /><span id="bc_0_214b+seedDWD" kind="d" style="font-size: small;"><span id="bc_0_214b+seedDWD" kind="d">[1] </span></span><span id="bc_0_214b+seedDWD" kind="d" style="font-size: small;">-1/a is defined as the time constant of the decaying exponential. It's the time t > 0 by which the exponential has decreased from it's value at t=0 (unity) by 63%, or equivalently, decreased down to 37% of 1: since if t = -1/a, then exp(a*t) = exp(-1) </span><span id="bc_0_214b+seedDWD" kind="d" style="font-size: small;"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_115b+seedKssTD" kind="d">≈</span></span> 0.37.</span>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com23tag:blogger.com,1999:blog-3393033712226955105.post-79841592120052876942016-03-05T13:09:00.004-08:002016-04-24T11:01:39.083-07:00SIM2: Interactive spreadsheet implementing Godley & Lavoie's SIM model (now w/ sample period invariance! [Hint: the secret is expm(A*Ts) & its integral have Ts parameters!])<div style="text-align: justify;">tl;dr version: Everything you need to know is <a href="http://wolfweb.unr.edu/~fadali/ee472/DTState-Space.pdf" target="_blank">right here</a> (except when A is singular, in which case you'll need <a href="http://math.stackexchange.com/questions/658276/integral-of-matrix-exponential" target="_blank">this too</a> to find discrete time B) which tells you about converting back and forth from continuous to discrete time in a problem like this, namely, given the system:<br /><br /><div style="text-align: center;"><span style="font-size: large;"><i>dx/dt = A∙x + B∙u</i> </span> </div><br />for vectors <i>x(t)</i> and <i>u(t)</i> and constant matrices <i>A</i> and <i>B</i> and <i>u(t) </i>held constant over each sample period <i>T</i>, we have the discrete time equivalent:<br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-Km-bL_sYNAc/VtxqWVVpYUI/AAAAAAAAAuM/ntLtMOErm04/s1600/StateSpaceContToDiscretePart2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="https://3.bp.blogspot.com/-Km-bL_sYNAc/VtxqWVVpYUI/AAAAAAAAAuM/ntLtMOErm04/s320/StateSpaceContToDiscretePart2.png" width="320" /></a></div>Notice that the discrete time constant matrix coefficients <i>A<span style="font-size: xx-small;">d</span></i> and <i>B<span style="font-size: xx-small;">d</span></i> are dependent on the sample period <i>T</i>.<br /><div style="text-align: left;">end tl;dr</div><br />Success!! (I think). I changed my <a href="http://banking-discussion.blogspot.com/2016/03/sim.html" target="_blank">previous spreadsheet</a> to make it truly invariant to the sample period (Ts in the green box below). Please refer to the previous version and the description underneath the spreadsheet for what the formulas are doing and the discrete time state space representation of the system, and to links to Jason and Ramanan's blogs (from whence this whole exercise originated). Below the spreadsheet on this page I describe what I'm doing differently. Feel free to play with the values: I only planned on people editing the green cells (in this embedded version), and if you get it irrevocably screwed up, just refresh the page (you can't hurt my original copy). Also you can download your own copy using the tool on the right side of the black toolbar running along the bottom of the sheet. Note that setting Ts < 0.1 will limit the data to less than 100 years (so the plot won't be filled out) because the number of time samples in my table is fixed at 1000.<br /><br />Note the names and values with the modifier "alt" in them below don't affect anything: they're part of an experiment to get SIM2 to always satisfy all of G&L's accounting expressions. I've had success with the ΔH = G - T expression by using T-alt (in columns to the right, you have to scroll to see). I did add T-alt to the plot so you can see how it differs slightly from T. More in Update 5 below and <a href="http://banking-discussion.blogspot.com/2016/03/sim5-summary-and-to-do.html" target="_blank">here</a>. </div><br /><iframe frameborder="0" height="1200" scrolling="no" src="https://onedrive.live.com/embed?cid=ADAE118FF12AB43B&resid=ADAE118FF12AB43B%21303&authkey=ABSfwVPDdoSxpsw&em=2&AllowTyping=True&ActiveCell='Sheet1'!B3&Item='Sheet1'!A1%3AU50&wdHideGridlines=True&wdDownloadButton=True" width="1010"></iframe> <br /><br /><span style="color: #b45f06;"><i>NOTE (update of 2016.04.22): in the above sheet to calculate the so-called experimental "alt" version of values use CTalt = (1-A)/Ts and DTalt = (Ts-B)/Ts and alpha2alt = CTalt/DTalt, where A and B are a function of the new sample period Ts (assuming the old one Ts0 = 1). These expressions come from T as a function of Ts := T(Ts) = T*Ts = G(Ts) - ΔH(Ts) = G[n]*Ts - H[n](Ts) + H[n-1] = G[n]*Ts - A*H[n-1] - B*G[n] + H[n-1] = (1-A)*H[n-1] + (Ts-B)*G[n] = CTalt*H[n-1] + DTalt*G[n], assuming H[n-1] didn't change with Ts, and that A and B are functions of Ts, and that B requires multiplication by G expressed in old units (i.e. per Ts0). Then our new T expressed in old units as a rate (i.e. dollars per Ts0) is just T = T(Ts)/Ts = ((1-A)/Ts)*H[n-1] + ((Ts-B)/Ts)*G[n], thus matching terms we have CTalt = (1-A)/Ts and DTalt = (Ts-B)/Ts, and because C/D = alpha2 (where C is Cm, not SIM's consumption output C), then alpha2alt = CTalt/DTalt. I think the idea came from <a href="http://banking-discussion.blogspot.com/2016/03/sim3.html" target="_blank">SIM3</a>. Also see <a href="http://banking-discussion.blogspot.com/2016/03/sim5-summary-and-to-do.html" target="_blank">SIM5</a>. Talt is calculated in terms of CTalt and DTalt in the columns you need to scroll to the right to see. The alpha2alt isn't actually used for anything (I don't think). It's a given that this experiment will "work" and that Jason's </i></span><span style="color: #b45f06;"><i>Γ = 1 for all Ts (the purpose of the "experiment"), given that we could just directly calculate Talt from the other columns: namely Talt = G - </i></span><span style="color: #b45f06;"><i>ΔH/Ts where the Talt and G columns are expressed as dollars per Ts0. Thus </i></span><span style="color: #b45f06;"><i>ΔH/Ts is just </i></span><span style="color: #b45f06;"><i>ΔH expressed in those same units. But ultimately the alpha2alt I calculate here doesn't lead anywhere. In contrast, <a href="http://banking-discussion.blogspot.com/2016/03/sim6-updated-sim-to-preserve-time.html" target="_blank">SIM6</a> is a successful approach: it adjusts both alpha1 and alpha2 (but not theta) to change sample periods without affecting steady state values (expressed in dollars per Ts0 and in dollars for the case of H) or the time constant Tc (expressed in Ts0). An update there of the date of this update explains why you adjust alpha1 and alpha2 but not theta to accomplish that. Given that Ts is changed by changing these parameters, then it's a given that </i></span><span style="color: #b45f06;"><i>Jason's </i></span><span style="color: #b45f06;"><i>Γ = 1 for all Ts in SIM6 as well. That's not really the case here in SIM2 because the resultant alpha2alt is not used (because there's probably not a way to make it useful). Thus really </i></span><span style="color: #b45f06;"><i>Jason's </i></span><span style="color: #b45f06;"><i>Γ </i></span><span style="color: #b45f06;"><i><span class="_Tgc">≠</span> 1 for all Ts here (i.e. using the method here to change sample periods). And no, alpha2alt here is not equal to the alpha2 from SIM6. However, that's not to say that the SIM3 idea didn't ultimately lead to a greater success: see <a href="http://banking-discussion.blogspot.com/2016/04/sim9-highlighting-difference-between.html" target="_blank">SIM9</a> and <a href="http://banking-discussion.blogspot.com/2016/04/sim10-circuit-representation.html" target="_blank">SIM10</a> for example.</i></span><br /><br />The problem with my previous sheet was that the H curve changed when I changed the sample period (Ts). This was in spite of modifying the alpha2 parameter as per Ramanan's instructions.<br /><br />I've changed tactics here: instead of scaling alpha2 (from a user provided alpha2_R parameter), I instead just use the User Parameters (in the green cells) directly without doing any modifications, (e.g. modifications such as scaling alpha2 by the ratio of change in the sample period (Ts/Ts_orig)).<br /><br />What I do instead is record the original Ts setting (Ts_orig = 1 years). Then from the alpha1, alpha2 and theta parameters I derive continuous time parameters for the system. In particular I do the following:<br /><br />Starting with the original discrete time system with A_orig and B_orig based on alpha1, alpha2 and theta, we have:<br /><br />H[n+1] = A_orig*H[n] + B_orig*G[n+1]<br /><br />From this I calculate the parameters for an equivalent continuous time system assuming G is held constant over each sample period:<br /><br />dH(t)/dt = H'(t) = a_cont*H(t) + b_cont*G(t)<br /><br />From this continuous time system, I re-descretize it with a new sample period (the user input sample period Ts in the green cells in the upper left). This gives me a new A and a new B, which I simply call A and B like in the old spreadsheet, and use them as follows in the results table:<br /><br />H[n+1] = A*H[n] + B*G[n+1]<br /><br />Here's how I do the calculations. First I assume the A_orig and B_orig resulted from a discetization of a continuous time system with an original sample period Ts = 1 year (Ts_orig = 1). Thus:<br /><br />A_orig = expm(a_cont*Ts_orig) = exp(a_cont*Ts_orig) (<a href="https://en.wikipedia.org/wiki/Matrix_exponential" target="_blank">matrix exponentiation expm()</a> reduces to scalar exponentiation exp() in this case, since the system has a single state).<br /><br />B_orig = (A_orig - 1)*b_cont/a_cont (to see why this is, <a href="http://wolfweb.unr.edu/~fadali/ee472/DTState-Space.pdf" target="_blank">look here</a>).<br /><br />I solve for a_cont and b_cont from the above, and then use these same formulas with a new sample period (Ts) to calculate A and B.<br /><br />Some of these calculations are performed in the cells to the right of the chart, and the rest are in the cells for the A and B matrices respectively.<br /><br />Matrices C and D (used for calculating the measurement vector [Y T YD C]' at sample n+1 by scaling H[n] and G[n+1] respectively), were not changed.<br /><br />Now (you may notice) instead of H changing with Ts, <span id="bc_0_21b+seedGeB8D" kind="d">ΔH changes with Ts. Is that a problem? I don't think so, because it SHOULD change with Ts: each Ts period of time now adds less to the total stock of money in the economy. H should NOT be changing with Ts, because the sample period should not affect the total stock of money accumulated in the economy at a fixed time in years.</span><br /><br /><span id="bc_0_21b+seedGeB8D" kind="d">--------------------------------------------------------------------------------------------------------------------------- </span><br /><span id="bc_0_21b+seedGeB8D" kind="d">Further information about calculating A and B as a function of Ts/Ts_orig: </span><span class="MathJax" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="normal">&#x0394;</mi></math>" id="MathJax-Element-1-Frame" role="presentation" style="position: relative;" tabindex="0"><span class="math" id="MathJax-Span-1" role="math" style="display: inline-block; width: 1.004em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 0.821em;"><span style="clip: rect(1.367em, 1000.77em, 2.462em, -1000em); left: 0em; position: absolute; top: -2.273em;"><span class="mrow" id="MathJax-Span-2"><span class="mi" id="MathJax-Span-3" style="font-family: "mathjax_main";"> </span></span></span></span></span></span><br /><span class="MathJax" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="normal">&#x0394;</mi></math>" id="MathJax-Element-1-Frame" role="presentation" style="position: relative;" tabindex="0"><span class="math" id="MathJax-Span-1" role="math" style="display: inline-block; width: 1.004em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 0.821em;"><span style="clip: rect(1.367em, 1000.77em, 2.462em, -1000em); left: 0em; position: absolute; top: -2.273em;"><span class="mrow" id="MathJax-Span-2"><span class="mi" id="MathJax-Span-3" style="font-family: "mathjax_main";"> </span></span></span><span style="clip: rect(1.367em, 1000.77em, 2.462em, -1000em); left: 0em; position: absolute; top: -2.273em;"><span class="mrow" id="MathJax-Span-2"><span class="mi" id="MathJax-Span-3" style="font-family: "mathjax_main";">DoΔ</span></span></span></span></span></span> <span class="MathJax" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="normal">&#x0394;</mi></math>" id="MathJax-Element-1-Frame" role="presentation" style="position: relative;" tabindex="0"><span class="math" id="MathJax-Span-1" role="math" style="display: inline-block; width: 1.004em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 0.821em;"><span style="clip: rect(1.367em, 1000.77em, 2.462em, -1000em); left: 0em; position: absolute; top: -2.273em;"><span class="mrow" id="MathJax-Span-2"><span class="mi" id="MathJax-Span-3" style="font-family: "mathjax_main";">Δ</span></span></span></span></span></span> <br />Starting with A_orig and B_orig and doing a little algebra reveals:<br /><br />(1) A_orig = A(Ts_orig) = 1 - theta * alpha2 / (1 - alpha1 * (1 - theta))<br /><br />(2) B_orig = B(Ts_orig) = 1 - theta / (1 - alpha1 * (1 - theta))<br /><br />I write A(Ts_orig) and B(Ts_orig) because they are <i><b><u>implicit</u> </b></i>functions of Ts_orig! Equations (1) and (2) were our starting point for A and B on the previous spreadsheet. Now what happens when we change Ts_orig to Ts?:<br /><br />(3) A(Ts) = A_orig^(Ts/Ts_orig)<br /><br />(4) B(Ts) = (B_orig/(A_orig - 1)) * (A(Ts) - 1) = -[(1 - alpha1*(1 - theta) - theta)/(theta*alpha2)] * (A(Ts) - 1)<br /><br />Note: I didn't bother with that algebra in the spreadsheet above: I just used exp() and ln() according the the development above equation (1).<br /><br />Enjoy!<br /><br />UPDATE 1: March 6, 2016 1:02 AM<br />I made a few changes to the plot to eliminate apparent sensitivity to Ts. Basically two things: I start the plot at t=0 years, but I start the table at -Ts. Secondly, instead of plotting H (which I leave in the main table), I plot H[n-1] (H delayed by one). H[n-1] takes the place of x[n] in a normal (canonical) discrete time state space formulation, so I suspected that I was plotting the wrong sequence against the others (off by one), and sure enough, once I changed that it helped quite a bit. The plot now shows near complete Ts invariance, as it should.<br />UPDATE 1: END<br /><br />UPDATE 2: March 7, 2016 9:06 PM<br />Note that I resolved my problem with the old method of changing sample periods suggested by Ramanan on <a href="http://banking-discussion.blogspot.com/2016/03/sim.html" target="_blank">that older post, and I've updated it accordingly</a> (read Update #2 there at the top). However that doesn't mean that the alpha2 scaling method is the same as this method: it is for small values of Ts, but try Ts >= 10 on this sheet and that one to see how they still differ. <br />UPDATE 2: END<br /><br />UPDATE 3: March 8, 2016 12:33 AM<br />Note the <span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ below is Jason Smith's </span></span><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ from his March 2016 posts on SIM.</span></span><br /><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d"></span></span><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-o0z2DyRjxp4/Vt6NFkNjJuI/AAAAAAAAAuo/iy4chs9ZFc4/s1600/SIM_Gamma_vs_Ts.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-o0z2DyRjxp4/Vt6NFkNjJuI/AAAAAAAAAuo/iy4chs9ZFc4/s1600/SIM_Gamma_vs_Ts.png" /></a></div><br />UPDATE 3: END<br /><br />UPDATE 4: March 9, 2016, 5:21 PM<br />I made a new version called <a href="http://banking-discussion.blogspot.com/2016/03/sim3.html" target="_blank">SIM3 posted here</a> which combines the best of the version above (SIM2) with the old version (SIM), for the price of restricting the functional form of G.<br />UPDATE 4: END<br /><br />UPDATE 5: March 13, 2016, 2:50 PM<br />I added some "alternative" parameters and variables to the spreadsheet. They don't affect any of the previous parameters or the plot, except that I've plotted T-alt to the plot. It differs slightly from T when Ts is changed. T-alt satisfies G&L's ΔH = G - T (actually ΔH = Ts*(G - T) since G and T are always rates expressed in dollars/(Ts_orig = Ts1 = 1 period = 1 year) in SIM2). Eventually there will be alternate versions of theta (thetaalt) and alpha1 (alpha1alt) as well. The idea is to eventually satisfy ALL of G&L's accounting equations, while maintaining sample period invariance, and matching G&L at Ts=1 (at least with G functions restricted to the form of their example). I have more information about it under the heading "SIM5" on a <a href="http://banking-discussion.blogspot.com/2016/03/sim5-summary-and-to-do.html" target="_blank">new post called SIM5</a>.<br />UPDATE 5: END<br /><br />UPDATE 6: March 17, 2016, 10:17 AM<br />As I explain in a new post (<a href="http://banking-discussion.blogspot.com/2016/03/sim6-updated-sim-to-preserve-time.html" target="_blank">SIM6</a>), and in <a href="http://informationtransfereconomics.blogspot.com/2016/03/more-on-stock-flow-models.html?showComment=1458192351122#c1952505938711252475" target="_blank">a comment on Jason's blog</a>, think Jason's <span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ (above) represents both an approximate change to a new sample time (without actually changing the sample time values in the table), thus a time constant change without a change in steady states (what I explain in the comment). And, as I explain in the text of SIM6 below the spreadsheet) Jason's </span></span><span id="bc_0_154b+seedR7m8D" kind="d"><span id="bc_0_154b+seedR7m8D" kind="d">Γ as calculated above represents the difference between a sampled rate variable (like I treat G, Y, T, YD and C in the spreadsheet in this post) and an average rate calculated across a sample period interval (how they are treated in SIM and SIM6). As Ts gets larger, that difference grows.</span></span><br />UPDATE 6: ENDTom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com9tag:blogger.com,1999:blog-3393033712226955105.post-60877747767846917582016-03-05T01:28:00.003-08:002016-04-24T10:37:42.599-07:00SIM: Interactive spreadsheet implementing Godley & Lavoie's SIM model (with "approximate" sample period invariance)<span style="color: red;"><b>UPDATE 1: March 5, 2016, 3:36 PM</b></span><br /><b>I think I solved the problem</b> with changing the sample period Ts I describe below, but rather than edit this spreadsheet (which highlights the problem pretty well I think), I created a new spreadsheet in a <a href="http://banking-discussion.blogspot.com/2016/03/sim2.html" target="_blank">new blog posting here</a>.<br /><span style="color: red;"><b>END UPDATE 1.</b></span><br /><br /><span style="color: red;"><b>UPDATE 2: March 7, 2016, 8:04 PM</b></span><br /><span style="font-size: small;"><b>I think I solved the problem</b> with changing the sample period Ts <u><b>on this sheet</b></u> after receiving <a href="http://informationtransfereconomics.blogspot.com/2016/03/more-on-stock-flow-models.html?showComment=1457375339457#c7227354756142629438" target="_blank">this comment from commenter "A H" on Jason's blog.</a> I realized that when stock-flow consistent (SFC) modelers put together their model there's a difference in philosophy compared to how an engineer putting together a <a href="https://en.wikipedia.org/wiki/State-space_representation" target="_blank">discrete time state space finite difference model</a> approaches it. The engineer does NOT in general want the units of his exogenous inputs and outputs (output AKA "measurements") to change simply because he's chosen a new sample period (Ts).<b> </b>In contrast the SFC modeler assumes they change to match the new time scale </span><span style="font-size: small;"><span style="font-size: small;">[1]</span>. For example, G&L use a sample period of 1 (which I call a "year" to give it a name). I call this Ts_orig and its value is fixed at 1. Ts is the sample period actually used (a user input) and it's therefore measured in years. So Ts = 2 means 2 years, etc. <b>Thus when I change Ts I now scale the numerical value of the exogenous input by Ts/Ts_orig to express it in dollars/Ts and I interpret the outputs Y, T, YD and C as if they are expressed per Ts (rather than per Ts_orig)</b>. These rates have not changed, but the units they are expressed in have. This fixes the biggest problem I had before with Ramanan's suggested method of just scaling alpha2 by Ts/Ts_orig to change sample periods. He naturally thought I'd be changing units on G and interpreting the outputs as if they'd changed units as well, when from a state space perspective (which is the framework I used to construct this model) that would never be done. This fix required adding a new results table in which the results are actually calculated with scaled alpha2 and G expressed in new units. You have to scroll out to the right to see this new table. The results are scaled appropriately and copied back to the old table, from whence the plot is made. Note that I have now applied the same fixes to the plot here that I did in my next post using a different method for changing sample periods (see Update #1 above).</span><br /><br /><span style="font-size: large;"><b><u>"Approximate" results with alpha2 scaling:</u> </b></span><br />The only other issue is that scaling alpha2 by Ts/Ts_orig produces results which are an approximation of sampling an equivalent continuous time system.<span style="font-size: small;"> Or put differently, when Ts changes, the equivalent continuous time system changes.</span> The difference in this case is pretty small until you get out to Ts >= 10, in which case you can see it start to break down. The results may still be SFC, but they are no longer samples of the same underlying continuous time system which Ts=1 were samples of. Try it out and see: if you set Ts = 10 in the green box below, the system starts to "ring." Another way to think of this is the compounding is no longer a good approximation to continuous compounding. To avoid these kinds of problems (if indeed it is a problem for you, it may not be), make sample period adjustments as <a href="http://banking-discussion.blogspot.com/2016/03/sim2.html?m=1" target="_blank">I describe in my next post</a>, and the continuous time system you'll be sampling will be independent of the sample period. Try it out: set Ts=10 on the spreadsheet on that post, and you'll continue to get samples from the same rising exponential, without any ringing. I have not done a careful analysis, but I suspect that's what's going on.<br /><span style="color: red;"><b>END UPDATE 2.</b></span><br /><br /><span style="color: red;"><b>UPDATE 3: March 7, 2016, 10:24 PM</b></span><br /><span style="color: red;"><span style="color: black;">Regarding setting Ts to large values, <a href="http://informationtransfereconomics.blogspot.com/2016/03/more-on-stock-flow-models.html?showComment=1457416711125#c1687787668072746040" target="_blank">Jason Smith has pointed out an important point [2]</a> regarding G&L restrictions on the values of alpha2 and alpha1, so the method of scaling alpha2 can really only be used for Ts < Ts_orig*alpha1/alpha2. With alpha1 = 0.6 and alpha2 = 0.4 originally, that means Ts <= 1.5.</span></span><br /><span style="color: red;"><span style="color: black;"><span style="color: red;"><b>END UPDATE 3.</b></span> </span></span><br /><br /><span style="color: red;"><b>UPDATE 4: March 9, 2016, 5:23 PM</b></span><br /><div class="post-title entry-title" itemprop="name"><span style="color: red;"><span style="color: black;"><a href="http://banking-discussion.blogspot.com/2016/03/sim3.html" target="_blank">I've got a new version (SIM3)</a> which still matches G&L at Ts=1, is completely Ts invariant, and always satisfies </span></span>ΔH = G - T. The downside is the functional form of G is restricted to a scaled step (as it is in G&L's example). </div><span style="color: red;"><span style="color: black;"><span style="color: red;"><b>END UPDATE 4.</b></span> </span></span><br /><br /><span style="color: red;"><b>UPDATE 5: March 15, 2016, 10:00 PM</b></span><br /><div class="post-title entry-title" itemprop="name"><a href="http://banking-discussion.blogspot.com/2016/03/sim6-updated-sim-to-preserve-time.html" target="_blank">SIM6</a> is a direct replacement for this spreadsheet: it adjusts both alpha1 and alpha2 to preserve both the time constant (thus achieving sample period invariance), and satisfying all G&L's expressions. </div><span style="color: red;"><span style="color: black;"><span style="color: red;"><b>END UPDATE 5.</b></span> </span></span> <br /><span style="color: red;"><span style="color: black;"> </span></span> <br /><span style="color: red;"><span style="color: black;"> </span></span> <br /><br /><iframe frameborder="0" height="1100" scrolling="no" src="https://onedrive.live.com/embed?cid=ADAE118FF12AB43B&resid=ADAE118FF12AB43B%21299&authkey=AAAeX1CqtdN3bBs&em=2&AllowTyping=True&ActiveCell='Sheet1'!B3&Item='Sheet1'!A1%3AY48&wdHideGridlines=True&wdDownloadButton=True" width="1010"></iframe> <br /><br />More information here on Jason Smith's blog post:<br /><a href="http://informationtransfereconomics.blogspot.com/2016/03/more-like-stock-flow-in-consistent.html">http://informationtransfereconomics.blogspot.com/2016/03/more-like-stock-flow-in-consistent.html</a><br /><br />Note that the difference equation implemented in the table (under the chart) is:<br /><br />Difference equation: <br />H[n+1] = A*H[n] + B*G[n+1]<br /><br />Measurement equations: <br />Y[n+1] = CY*H[n] + DY*G[n+1]<br />T[n+1] = CT*H[n] + DT*G[n+1]<br />YD[n+1] = CYD*H[n] + DYD*G[n+1]<br />C[n+1] = CC*H[n] + DC*G[n+1]<br /><br />Which is not quite <a href="http://wolfweb.unr.edu/~fadali/ee472/DTState-Space.pdf" target="_blank">standard discrete time space space representation</a> (normally the index on H (normally called the state vector x) and G (normally called the input vector u) would match instead of be off by one in relation to each other), but I wanted my table to match Jason Smith and Godley & Lavoie, at least in terms of the contents across one row (columns in their cases). Also, in the table, I subtracted one sample period (Ts) from my time index in relation to theirs so I could start at 0 rather than Ts. The purpose of this is to cause less disruption on my plot should the Ts user parameter be changed.<br /><br />Also note that with the default parameters, this model works as expected and reproduces the results of Godley & Lavoie (just as Jason Smith's model does), but a secondary purpose was to test the idea of changing the sample period (Ts). Ramanan notes in comments on Jason's post an on <a href="http://www.concertedaction.com/2016/03/04/stock-flow-inconsistent/" target="_blank">his own blog post on this subject</a> that doing so requires a change in alpha2. That's why I introduced the alpha2_R parameter and have a separate alpha2 which is adjusted by Ts in the manner Ramanan suggested (I think!). Most of the curves do seem to be invariant to a change in Ts with this adjustment made to alpha2, <strike>except for the H curve. So I need to find out why.</strike> <b>See my Update #2 at the top: I now know why, and have fixed this sheet.</b><br /><br /><div class="separator" style="clear: both; text-align: center;"></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://4.bp.blogspot.com/-jnIzMKUApWE/VuG9VlTXPDI/AAAAAAAAAvY/mMwv6ePal40/s1600/SIM2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="432" src="https://4.bp.blogspot.com/-jnIzMKUApWE/VuG9VlTXPDI/AAAAAAAAAvY/mMwv6ePal40/s640/SIM2.png" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Block diagram of system showing a single output ("measurement") variable T (the others (Y,YD,C) being similar)</td></tr></tbody></table><div class="separator" style="clear: both; text-align: center;"></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://1.bp.blogspot.com/-R1nMSqvwgfQ/VuM0DdUL_YI/AAAAAAAAAw8/bbTA3yukTH8VhrOiWYsSNnsoIoeZ1Cl1g/s1600/SIM_discrete_and_continuous_time.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="206" src="https://1.bp.blogspot.com/-R1nMSqvwgfQ/VuM0DdUL_YI/AAAAAAAAAw8/bbTA3yukTH8VhrOiWYsSNnsoIoeZ1Cl1g/s640/SIM_discrete_and_continuous_time.png" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><span id="bc_0_214b+seedDWD" kind="d"><span id="bc_0_214b+seedDWD" kind="d">Discrete and continuous time system equivalents, where H[n] = h(n*Ts), etc. Ts being the sample period</span></span></td></tr></tbody></table><div class="separator" style="clear: both; text-align: center;"></div><br /><br /><b>Notes:</b><br />[1] Note that another way to think of it in SFC discrete time model terms is that the inputs and outputs are not rates (like they are for the continuous time case), but rather quantities during the interval Ts. Ramanan made mention of this more than once in <a href="http://informationtransfereconomics.blogspot.com/2016/03/more-like-stock-flow-in-consistent.html" target="_blank">his comments on Jason's posts</a>. Again, this is something an engineer would not normally do: he wouldn't change the interpretation from a rate to an amount just because he changed from continuous time to discrete time or vice versa. That'd be like changing from amperes to coulombs. But I guess the moral is that when playing with SFC models, do as the SFC modelers do! <b></b><br /><b><br /></b>[2]<b> </b>For convenience I'll reproduce <a href="http://informationtransfereconomics.blogspot.com/2016/03/more-on-stock-flow-models.html?showComment=1457416711125#c1687787668072746040" target="_blank">Jason's comment</a> about restrictions on alpha1 and alpha2 here:<br /><div class="separator" style="clear: both; text-align: center;"></div><br /><i><span id="bc_0_51b+seedDCygD" kind="d">In order to take larger time steps, you need to *increase* the value of alpha2. Unfortunately, alpha2 is restricted to be less than alpha1 by the model (and both must be less than one). <br /><br />See Eq. (3.7) in Godley and Lavoie.<br /><br />The values of alpha1 and alpha2 are later constrained in the text such that <br /><br />(1- alpha1)/alpha2 = 1<br /><br />called the "stock-flow norm".<br /><br />It's a totally incoherent way to deal with the changes induced by changing the time step -- it violates the model assumptions and the rest of the analysis in G&L.</span></i><br /><br />[3] <span id="bc_0_51b+seedDCygD" kind="d">Parameters expressions, reprinted here for convenience: </span><br /><br /><table border="0" cellpadding="0" cellspacing="0" style="width: 491px;"><colgroup><col style="width: 48pt;" width="64"></col> <col style="mso-width-alt: 2011; mso-width-source: userset; width: 41pt;" width="55"></col> <col style="mso-width-alt: 1572; mso-width-source: userset; width: 32pt;" width="43"></col> <col style="mso-width-alt: 2523; mso-width-source: userset; width: 52pt;" width="69"></col> <col style="mso-width-alt: 2011; mso-width-source: userset; width: 41pt;" width="55"></col> <col style="mso-width-alt: 2596; mso-width-source: userset; width: 53pt;" width="71"></col> <col style="mso-width-alt: 4900; mso-width-source: userset; width: 101pt;" width="134"></col> </colgroup><tbody><tr height="22" style="height: 16.5pt;"> <td class="xl65" height="22" style="height: 16.5pt; width: 48pt;" width="64">Matrix</td> <td class="xl65" style="border-left: none; width: 41pt;" width="55">Element</td> <td class="xl65" style="border-left: none; width: 32pt;" width="43">Name</td> <td class="xl74" colspan="4" style="border-left: none; border-right: 1.5pt solid black; width: 247pt;" width="329">Expression</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl69" height="22" style="border-top: none; height: 16.5pt;">A<span class="font5"><sub>d</sub></span></td> <td class="xl70" style="border-left: none; border-top: none;">(1,1)</td> <td class="xl70" style="border-left: none; border-top: none;">A</td> <td class="xl73" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>1-theta*alpha2/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl69" height="22" style="border-top: none; height: 16.5pt;">B<span class="font5"><sub>d</sub></span></td> <td class="xl70" style="border-left: none; border-top: none;">(1,1)</td> <td class="xl70" style="border-left: none; border-top: none;">B</td> <td class="xl73" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>1-theta/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl77" height="88" rowspan="4" style="border-bottom: 1.5pt solid black; border-top: none; height: 66.0pt;"><span class="font0">C</span><span class="font5"><sub>d</sub></span></td> <td class="xl66" style="border-left: none; border-top: none;">(1,1)</td> <td class="xl66" style="border-left: none; border-top: none;">CY</td> <td class="xl73" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>alpha2/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl67" height="22" style="border-left: none; height: 16.5pt;">(2,1)</td> <td class="xl67" style="border-left: none;">CT</td> <td class="xl73" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>theta*alpha2/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl67" height="22" style="border-left: none; height: 16.5pt;">(3,1)</td> <td class="xl67" style="border-left: none;">CYD</td> <td class="xl73" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>(1-theta)*alpha2/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl68" height="22" style="border-left: none; height: 16.5pt;">(4,1)</td> <td class="xl68" style="border-left: none;">CC</td> <td class="xl73" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>alpha2/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl77" height="88" rowspan="4" style="border-bottom: 1.5pt solid black; border-top: none; height: 66.0pt;"><span class="font0">D</span><span class="font5"><sub>d</sub></span></td> <td class="xl66" style="border-left: none; border-top: none;">(1,1)</td> <td class="xl66" style="border-left: none; border-top: none;">DY</td> <td class="xl73" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>1/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl67" height="22" style="border-left: none; height: 16.5pt;">(2,1)</td> <td class="xl67" style="border-left: none;">DT</td> <td class="xl73" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>theta/(1-alpha1*(1-theta))</td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl67" height="22" style="border-left: none; height: 16.5pt;">(3,1)</td> <td class="xl67" style="border-left: none;">DYD</td> <td class="xl73" colspan="3" style="mso-ignore: colspan;"><span style="mso-spacerun: yes;"> </span>(1-theta)/(1-alpha1*(1-theta))</td> <td class="xl72" style="border-top: none;"></td> </tr><tr height="22" style="height: 16.5pt;"> <td class="xl68" height="22" style="border-left: none; height: 16.5pt;">(4,1)</td> <td class="xl68" style="border-left: none;">DC</td> <td class="xl73" colspan="4" style="border-left: none; border-right: 1.5pt solid black;"><span style="mso-spacerun: yes;"> </span>1/(1-alpha1*(1-theta)) - 1</td> </tr></tbody></table><br />where the "d" subscript indicates "discrete time."Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com2tag:blogger.com,1999:blog-3393033712226955105.post-31717397973560655562016-02-07T17:39:00.003-08:002016-02-07T17:42:26.318-08:00Algebra Part 1Starting with <a href="http://informationtransfereconomics.blogspot.com/2014/03/information-transfer-and-cobb-douglas.html" target="_blank">Jason's second expression here:</a><br /><br /><br /><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"> <mfrac> <mi>J</mi> <msub> <mi>J</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>r</mi> <mi>e</mi> <mi>f</mi> </mrow> </msub> </mfrac> <mo>=</mo> <msup> <mrow> <mo>(</mo> <mfrac> <mi>L</mi> <msub> <mi>L</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>r</mi> <mi>e</mi> <mi>f</mi> </mrow> </msub> </mfrac> <mo>)</mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> <mrow class="MJX-TeXAtom-ORD"> <mo>/</mo> </mrow> <mi>κ<!-- κ --></mi> </mrow> </msup></math><br /><br /><br />Raise both sides to the (κ - 1)th power:<br /><br /><br /><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"> <msup> <mrow> <mo>(</mo> <mfrac> <mi>J</mi> <msub> <mi>J</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>r</mi> <mi>e</mi> <mi>f</mi> </mrow> </msub> </mfrac> <mo>)</mo> </mrow><mrow class="MJX-TeXAtom-ORD"><mn>(</mn> <mrow class="MJX-TeXAtom-ORD"><mo></mo></mrow><mi>κ-1)<!-- κ --></mi> </mrow> </msup> <mo>=</mo> <msup> <mrow> <mo>(</mo> <mfrac> <mi>L</mi> <msub> <mi>L</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>r</mi> <mi>e</mi> <mi>f</mi> </mrow> </msub> </mfrac> <mo>)</mo> </mrow><mrow class="MJX-TeXAtom-ORD"><mn>(</mn> <mrow class="MJX-TeXAtom-ORD"><mo></mo></mrow><mi>1-1/κ)<!-- κ --></mi> </mrow> </msup></math><br /><br /><br />Now divide both sides by the right side:<br /><br /><br /><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"> <msup> <mrow> <mo>(</mo> <mfrac> <mi>J</mi> <msub> <mi>J</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>r</mi> <mi>e</mi> <mi>f</mi> </mrow> </msub> </mfrac> <mo>)</mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi>κ<!-- κ --></mi> <mo>−<!-- − --></mo> <mn>1</mn> </mrow> </msup> <msup> <mrow> <mo>(</mo> <mfrac> <mi>L</mi> <msub> <mi>L</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>r</mi> <mi>e</mi> <mi>f</mi> </mrow> </msub> </mfrac> <mo>)</mo> </mrow><mrow class="MJX-TeXAtom-ORD"><mn></mn><mo><!-- − --></mo> <mn>1</mn> <mrow class="MJX-TeXAtom-ORD"> <mo>/</mo> </mrow> <mi>κ - 1<!-- κ --></mi> </mrow> </msup> <mo>=</mo> <mn>1</mn></math>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-47887902926988200202014-07-05T00:55:00.001-07:002016-04-01T16:44:15.965-07:00Scott in Hell<br /><span style="font-size: large;">Getting all caught up on every MF lecture he ignored...</span><br /><br /><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-sG0oWlgt_V8/U7eywpjzglI/AAAAAAAAAjE/EN0rGfpZL8Q/s1600/4+-+Copy.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="190" src="https://1.bp.blogspot.com/-sG0oWlgt_V8/U7eywpjzglI/AAAAAAAAAjE/EN0rGfpZL8Q/s1600/4+-+Copy.jpg" width="320" /></a></div><a href="http://3.bp.blogspot.com/-nbxJNKMEdng/U7eunYPEqnI/AAAAAAAAAi4/UJANczkmCaM/s1600/4.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><br /><b><span style="font-size: x-large;"> ...FOREVER! Mwha-hahahahaha!</span></b>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-41030105892621997132014-04-13T17:18:00.004-07:002014-04-25T15:57:15.454-07:00Nick Edmonds' simulation model for Samuelson and inside money: interactive version<div style="text-align: justify;">Here is an updated interactive sheet. Six iterations are done now at each time step and I've produced all the plots. If you download the spreadsheet you'll see all the calculations are done on a single page now. Instead of parameter "gL" entered as a percentage (like I had before) I kept it as factor "g" so for example instead of entering 2% you'd now enter 1.02. I did this just to be consistent with <a href="http://monetaryreflections.blogspot.com/2014/03/simulation-model-for-samuelson-and.html" target="_blank">Nick Edmond's blog post</a>. I kept my original blog post here underneath this new spreadsheet. Enjoy! (<strike>There may be a bug: this one is not as robust as the old one: it doesn't handle changing in the inflation rate very well: but on the plus side you can try changing some of the other parameters).</strike> I corrected one bug: the solution always started from the same initial guess when it should have used the solution for the time step before as the first guess, thus it didn't always converge: <a href="http://en.wikipedia.org/wiki/Newton%27s_Method" target="_blank">Newton's method</a> (in this case the <a href="http://en.wikipedia.org/wiki/Newton%27s_method#k_variables.2C_k_functions">vector version</a>) is sensitive to where you start: you need to be close enough (in which case it converges rapidly), which you can get a feel for <a href="http://en.wikipedia.org/wiki/File:NewtonIteration_Ani.gif" target="_blank">here</a>. But I still have a problem with the auto-scaling of the plots. I think this is because I'm plotting values across hidden rows. The values in the hidden rows are not plotted, which is what I want, but I suspect they still do contribute to the axis auto-scaling solution. This problem is only apparent in the Price of Land plot with the default input parameters, but becomes apparent in other plots when you change some of the other parameters. The "eps" parameter only affects the Newton's method solution (it's the size of perturbations used to numerically calculate the <a href="http://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant" target="_blank">Jacobian matrix</a>) and has nothing to do with the model, but you can change that too (note in this case the Jacobian could well be calculated in closed form, but I wanted a more general approach). I have not tried changing all the different parameters, so it's quite possible you could break it! I've mostly just played with "g" and "alpha."<br /><br /><br /><iframe frameborder="0" height="1000" scrolling="no" src="https://onedrive.live.com/embed?cid=ADAE118FF12AB43B&resid=ADAE118FF12AB43B%21150&authkey=ABs9Xj1ltYzLpx4&em=2&AllowTyping=True&ActiveCell='Parameters'!B11&Item='Parameters'!A1%3AN48&wdHideGridlines=True&wdDownloadButton=True" width="900"></iframe> <br /><br /><br />I never did end up using the <a href="http://banking-discussion.blogspot.com/p/non-linear-equation-solver-with-up-to.html" target="_blank">circular reference iteration facility</a> in Excel because of the nature of this problem: each time step depends on the prior one. Thus you can't really iterate at each time step independently. Thus the iterations are hardcoded in the spreadsheet, but in a fairly compact fashion. If you try downloading the spreadsheet, the "Results" sheet does all the work and looks fairly tidy, with the solution at each time step laid out one per row in a table. If you were to unhide all the rows and columns however, it would look worse, but not unmanageable. Between each pair of rows (save the 1st two), are the six Newton's method iterations laid out with the solutions in columns (I transpose to save vertical space). It's set up in such as way that if you want to add time periods, you can just copy and paste these unhidden blocks to the end (so, for example, it'd be easy to nearly double the number of time steps with a single copy and paste of the existing solution blocks appended to the end). Unhiding all the cells is not obvious, but only because I hid cell A1. Unhide that one and you're good (I'll let you figure that out... you may need to do some Googling). In fact, probably unhiding is not necessary to simply extend this solution to more time steps: simply copy paste rows of the existing table to the end. You'd need to adjust the plots of course. But if you want to see how it works or change the formulas, then you need to unhide.<br /><br />Here's an update to the above. You can indeed keep the spreadsheet looking tidy and use a copy and paste procedure to extend the solution to more times, but doing this is not completely obvious, so I'll give some instructions here. The problem is a straight copy and paste leaves out some of the hidden cells at the top which allows the solution to propagate forward to each subsequent time. To get around this problem you need to unhide at least one of the hidden rows. First go to the "Results" tab of the downloaded spreadsheet. The cells implementing Newton's method are not present between times 0 and 1 (though unlabeled, time is in the 1st columns of the table on the left on the results page). You *could* just unhide all the hidden rows and columns, but to keep it looking tidy and to make it easier to work with we'll just unhide the first row after the time = 1 row, which at the time of this writing is row 4. Use the <a href="http://office.microsoft.com/en-us/excel-help/unhide-the-first-column-or-row-in-a-worksheet-HA102489549.aspx" target="_blank">instructions here</a> (I'm solving the puzzle I proposed you solve yourself with Google in the above paragraph, except on row 4 instead of cell A1). To do this for row 4, replace "A1" in those instructions with any hidden cell in the spreadsheet under row 1 that you'd be able to see if all rows (not columns) were unhidden. So for example the one on the far left of the unhidden columns in row 4 should work: as of this writing, that would be cell "E4." Following the instruction on the link, select "unhide row" in the drop down box on the format menu. Now you should see a blank row appear between the time = 1 and time = 2 rows: in this case row 4, starting with cell E4 on the left. Now copy the full rows starting with row 4 down to however many times you want to add. If you want to add 5 new times, copy from row 4 to row 108 (keep in mind there's a lot of hidden rows in between, which is why the end row is not row 9 = 4 + 5 here), then paste them starting in the first row beyond the bottom of the table (row 403). Be sure to select that whole blank row (row 403) to paste into, otherwise it won't let you do the paste operation, as depicted in Figure 1. Also note in Figure 1 the dashed green outline near the top showing the cells selected to copy. Column W separates the results table on the left from the charts data table on the right (only two columns of which are depicted).<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-e6H6BWZ7c9g/U1rTe93PNTI/AAAAAAAAAiY/bmC_anHnpI0/s1600/spreadsheet_screenshot_01.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-e6H6BWZ7c9g/U1rTe93PNTI/AAAAAAAAAiY/bmC_anHnpI0/s1600/spreadsheet_screenshot_01.png" height="380" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 1: Screenshot of spreadsheet just prior to pasting the copied rows</td></tr></tbody></table><br />You should see the block of rows get filled in with answers. The times in the far left column should now range from 21 to 25 in the new rows. This is depicted in Figure 2. Notice how the 1st column on the left (time) started not with 2 (the time in the copied row 4) but with 21 (the first time past the last time entry in the existing table).<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-PzcDODAm10A/U1rT8Fm0lkI/AAAAAAAAAig/hT8xy63xAXc/s1600/spreadsheet_screenshot_02.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://3.bp.blogspot.com/-PzcDODAm10A/U1rT8Fm0lkI/AAAAAAAAAig/hT8xy63xAXc/s1600/spreadsheet_screenshot_02.png" height="432" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 2: Screenshot of spreadsheet immediately after pasting the copied rows. </td></tr></tbody></table><br />Now you can continue to paste more cells until you get the table extended out to the time you want. Finish up by re-hiding all the blank rows in the results table. You'll notice that you get some bad values in the table to the right of the results table (in the otherwise blank rows): that's the chart data table for the charts on the "Parameters" sheet. Ignore those: once the row is hidden you can make new charts by either creating them from scratch or updating the data series in the existing charts to include the new rows: the bad values in the hidden rows should not get plotted. You'll need to reformat the x-axis of the chart(s) too because I fixed the maximum value at 20. Good luck!<br /><br /><br /><h4>Below is my original post which I'll leave intact for now:</h4><h4> </h4>From Nick Edmonds' <a href="http://monetaryreflections.blogspot.com/2014/03/simulation-model-for-samuelson-and.html" target="_blank">Simulation Model for Samuelson and Inside Money</a> post. You can edit the whole workbook. If you mess it up and want to start over, just reload the page. This is a first attempt at doing this kind of thing online iteratively with free online spreadsheets. I think I may be onto a better approach <a href="http://banking-discussion.blogspot.com/p/non-linear-equation-solver-with-up-to.html" target="_blank">here</a>, but have yet to connect all the dots. The "Growth rate for nominal loans" cell at the top changes the gL variable in Nick's write up (see this <a href="http://monetaryreflections.blogspot.com/2014/03/simulation-model-for-samuelson-and.html?showComment=1395589556073#c6293477177053583178" target="_blank">comment</a>). Nick actually discusses the "Growth parameter for nominal loans (g)" in his table of variables, but the relationship is simple: g = 1 + gL. Enter it as a percentage in the long orange cell near the top (A2:E2). The workbook iteratively solves the equations, but only two iterations are used for each point in time. Check the columns "Cw err," "pa err" and "pc err" to see how close to a solution the two iterations get you. You may need to use the scroll bars. You should see the plot change when you change gL. It's definitely not perfect, but it should work reasonably well for values of gL near 2%.</div><br /><iframe frameborder="0" height="900" scrolling="no" src="https://onedrive.live.com/embed?cid=ADAE118FF12AB43B&resid=ADAE118FF12AB43B%21130&authkey=ADJMMNgZnwYKRzc&em=2&wdAllowInteractivity=False&AllowTyping=True&ActiveCell='Results'!M27&wdDownloadButton=True" width="900"></iframe> <br /><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Newton's method: a forward difference is used to calculate a Jacobian to solve the problem and "delta_base" is the size of the perturbation to the Cw, pa, and pc variables at each time (Each year is a row in the spreadsheet). You can change "delta_base" by editing cell F2 (dark gray) just to the right of gL. The solution shouldn't be too sensitive to delta_base. I could improve the solution by adding more iterations to each of the other tabs labeled 2 through 21. These sheets are a bit ugly... I was interested in getting it to work online with minimal effort (Excel "Solver" and macros are not available online). You can download the workbook by clicking on the Green "X" Excel symbol on the right hand side of the black bar across the bottom of the spreadsheet.</div>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-73006579708172425032014-03-21T23:06:00.001-07:002014-04-16T16:58:46.179-07:00Nick Rowe's example from 'The sense in which the stock of money is "supply-determined"'<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-LVzchBepnvg/Uy4wKHs5d_I/AAAAAAAAAe8/KrDLcs2NE84/s1600/NicksSupplyDeterminedMoneyExample04.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://3.bp.blogspot.com/-LVzchBepnvg/Uy4wKHs5d_I/AAAAAAAAAe8/KrDLcs2NE84/s1600/NicksSupplyDeterminedMoneyExample04.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Figure 1: Diagram of Nick Rowe's example</span></td></tr></tbody></table><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div style="text-align: justify;"><br />In a <a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/03/the-sense-in-which-the-stock-of-money-is-supply-determined.html" target="_blank">post from Nick Rowe</a> regarding the sense in which the stock of money is "supply-determined" he sketches out an example with the following definition for the money demand function:</div><div style="text-align: justify;"><blockquote><i>Md=L(P,Y)=PY</i></blockquote></div><div style="text-align: justify;">He also mentions that:</div><div style="text-align: justify;"><blockquote><i>By cutting the rate of interest, the central bank increases the quantity of loans from the central bank, which creates more money. Eventually P and/or Y will increase and the quantity of money demanded will increase in proportion to the quantity created.</i></blockquote></div><div style="text-align: justify;">Figure 1 is my attempt to sketch out what this example looks like. The items with "0" indicate the original values prior to the central bank's exogenous cut in interest rates from r0 to r1. Keep in mind that the central bank (CB) is the ONLY bank in this example: there are no commercial banks, and it only loans cash (so no deposits at all in this world) and it is compelled to lend to anyone because they are all good credit risks. I'll also assume that the bank is compelled to sell back to each individual borrower their debt on a dollar for dollar basis at the discretion of the borrower. Some of these assumptions may not be important for the logic of the post though! </div><div class="separator" style="clear: both; text-align: center;"></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Note that the blue downward sloping curve in the upper plot is the "supply curve for loans determined by borrowers" which <a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/03/one-general-theory-of-money-creation-to-rule-them-all.html?cid=6a00d83451688169e201a73d91f439970d#comment-6a00d83451688169e201a73d91f439970d" target="_blank">Nick states is equivalent</a> to "demand for loans by borrowers" in "normal language." He points this out in the comments in his previous post. Also note Md0 corresponds to Y0 and Md1 corresponds to Y1 (if P did not change from P0). However, it's possible also that Y does not change from Y0 and P instead changes from P0 to P1. In fact Nick implies that either or both P and Y could increase in this case which gives us the set of solutions for 1/P lying between the two blue money demand curves (Md0 and Md1) along the red supply curve on the right (Ms1).</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;"><a href="http://www.themoneyillusion.com/?p=26400" target="_blank">Scott Sumner thinks</a> that Nick must mean that where Md0 and Ms1 cross is the solution. He also claims that the MMT people would say that the solution is where Md1 and Ms1 cross. I think Nick is actually saying it can lie anywhere between those extremes.<br /><br />Also note that in the upper plot the two horizontal green solid lines are the "perfectly-elastic supply functions" for money (each at a fixed interest rate, r0 and r1), and that the two vertical red lines in the upper chart are the two "perfectly interest inelastic" demand curves for money. Assume the red vertical line on the left is Md0 and that it has already reached equilibrium to match the supply of money (Ms0 in the lower chart). After r is lowered from r0 to r1, then Ms0 goes to Ms1 in accordance with the borrower determined supply for loans curve in the upper plot. Then *eventually* the demand curve for money in the upper plot (still perfectly interest inelastic, and thus vertical) will move right to match the supply curve (Ms1) in the lower plot.<br /><br />One more thought on the upper plot (with the CB "exogenously" determined interest rate on the y-axis). The solution where the downward sloping blue curve (borrower determined supply curve for loans) intersects the horizontal green "perfectly interest-elastic 'supply' curves for money." I've already noted how in "normal language" (according to Nick) the "supply curve for loans" is called "demand for loans." However, it's better described as a supply curve. But then we have two supply curves intersecting. But then it occurred me to make the following linguistic substitutions, and I think it all becomes a lot more clear:<br /><br />Replace "loans" with "bonds."<br />Replace "borrowers" with "bond issuers."<br /><br />Then the blue line's name makes more sense as a supply curve as we've noted. But also, the horizontal "supply for money" curves instead become "perfectly interest-elastic *DEMAND* curves for bonds at exogenously fixed rates of interest." So then we're back to quantity being determined in the usual way by a supply curve intersecting a demand curve. Hurray! I comment on that <a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/03/the-sense-in-which-the-stock-of-money-is-supply-determined.html?cid=6a00d83451688169e201a73d9df95e970d#comment-6a00d83451688169e201a73d9df95e970d" target="_blank">here</a> on Nick's post.<br /><br />The red perfectly interest-inelastic vertical demand for money curves in the upper plot do NOT determine the quantity of money, and instead follow the solution determined by the other two curves.<br /><br />Note: <a href="http://www.themoneyillusion.com/?p=26400#comment-324985" target="_blank">Scott Sumner suggested</a> in a comment that instead of 1/P on the y-axis in the lower plot, I should instead plot 1/NGDP = 1/(P*Y). If I did this, then there would only be a single downward sloping (rectangular hyperbola) blue Md curve and the solution set of Nick Rowe at Ms1 would collapse to a single point on that curve. I.e. Scott's solution and the "MMT" solution would be indistinguishable (which would probably not please Scott!).<br /><br />Note that in the upper plot, the x-axis could be labeled "Quantity of loan-principal demanded/supplied (measured in dollars)."<br /><br />With <a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/04/temporary-vs-permanent-money-multipliers.html?cid=6a00d83451688169e201a73da1f4af970d#comment-6a00d83451688169e201a73da1f4af970d" target="_blank">this later comment</a>, Nick Rowe essentially establishes his solution set at r1 (in Figure 1's lower plot) to be the entire red ray labelled "Ms1"... it would be the small line segment if P and Y were precluded from decreasing. </div>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com4tag:blogger.com,1999:blog-3393033712226955105.post-7421316213610288182014-03-18T08:08:00.000-07:002014-04-17T21:53:53.774-07:00Nick Rowe vs Scott Sumner: Different Answers to a Simple HPE Hypothetical<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="http://banking-discussion.blogspot.com/p/epsilon-animation.html" imageanchor="1" style="margin-left: auto; margin-right: auto;" target="_blank"><img border="0" src="http://4.bp.blogspot.com/--0MiGgUY0jU/UyuU6G2LYiI/AAAAAAAAAeA/4W54EyebkL4/s1600/EpsilonProblem03.png" height="577" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><a href="http://banking-discussion.blogspot.com/p/epsilon-animation.html" target="_blank"><span style="font-size: small;">Figure 1: Nick Rowe's and Scott Sumner's solutions for P</span></a></td></tr></tbody></table><div style="text-align: justify;"><br /></div><div style="text-align: justify;">This is a simple hypothetical that I feel get's to the core of concepts like the <a href="http://en.wikipedia.org/wiki/Neutrality_of_money" target="_blank">long term neutrality of money</a>, the <a href="http://en.wikipedia.org/wiki/Quantity_theory_of_money" target="_blank">quantity theory of money</a> (QTM), and the <a href="http://www.themoneyillusion.com/?p=23314" target="_blank">hot potato effect</a> (HPE) which undergird much of <a href="http://en.wikipedia.org/wiki/Market_monetarism" target="_blank">Market Monetarist</a> (MM) thought. If I'm not mistaken, Nick Rowe seems to think my hypothetical is a case where those concepts don't work, while Scott disagrees. Why do I care? Well if they don't work here, then what about our real situation does make them work? How can we be certain that they are indeed working, and if they are how do we know they are completely working?</div><br />Setup: This is <a href="http://www.themoneyillusion.com/?p=26355#comment-323558" target="_blank">basically the same</a> as Scott Sumner's <a href="http://www.themoneyillusion.com/?p=23314" target="_blank">"cashless society" hypothetical (case 7)</a> except with the added stipulation that there's just one commercial bank and that the <a href="http://www.themoneyillusion.com/?p=26355#comment-323565" target="_blank">reserve requirement is 0%</a> (Scott didn't specify the number of commercial banks or the reserve requirement). In particular, we have:<br /><div style="text-align: justify;"><ol><li>Cashless society (no paper reserve notes and no coins).</li><li>A central bank (CB) which can buy and sell assets (open market operations (OMOs)).</li><li>A single commercial bank with a CB deposit (i.e. reserve deposit). This is the only existing CB deposit account.</li><li>The reserve requirement is 0%. </li><li>A non-bank private sector which holds deposits at the commercial bank.</li></ol>Scott points out that in such a case base money consists only of bank reserves (as there's no cash) and thus reserves alone are the <a href="http://jpkoning.blogspot.com/2014/03/credit-cards-as-media-of-account.html" target="_blank">medium of account</a> (MOA)*. Now for some <a href="http://slulibertarians.tumblr.com/post/33623592973/the-strange-economics-of-money#notes" target="_blank">important definitions</a>:<br /><blockquote>P = average steady state price level in the private economy <br />Ms = reserve supply<br />Mdn = nominal reserve demand<br />Mdr = real reserve demand = Mdn/P </blockquote><a href="http://www.themoneyillusion.com/?p=26355#comment-323611" target="_blank">Scott Sumner</a> and <a href="http://www.themoneyillusion.com/?p=26355#comment-323706" target="_blank">Mark A. Sadowski</a> say that if Ms changes (e.g. through CB OMOs), then P will change in proportion. <a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/03/one-general-theory-of-money-creation-to-rule-them-all.html?cid=6a00d83451688169e201a511867eb4970c#comment-6a00d83451688169e201a511867eb4970c" target="_blank">Nick Rowe says</a> that in this case demand for reserves will change with Ms<i>. </i>Specifically he noted that if Ms goes to zero then demand for reserves will go to zero. If we take this to mean that demand is proportional to Ms, then P stays fixed regardless of the change in Ms.<br /><br />The difference between Nick's and Scott's solution is illustrated in Figure 1 for two different values of Ms: we're assuming they start off the same at Ms = Ms0, but then the CB sells assets such that Ms = Ms1. The demand curve (Mdn) in Nick's case scales in proportion to Ms (this is accomplished by scaling Mdr).<span style="font-size: small;"> Nick Rowe says that my Figure 1 <a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/03/two-lm-curves.html?cid=6a00d83451688169e201a51188bb48970c#comment-6a00d83451688169e201a51188bb48970c" target="_blank">looks roughly right.</a></span> Click <a href="http://banking-discussion.blogspot.com/p/epsilon-animation.html" target="_blank">here to see an animation.</a><br /><br />My question for Nick is what is preventing the long term neutrality of money in this case? What would I need to change about my example, aside from adding cash, for him to agree with Scott? For example, would adding multiple commercial banks do it? Something else? What's the minimum change required?<br /><br />Relating my hypothetical back to reality, is it really so outlandish to consider the case of a single commercial bank? Mark Sadowski identified a case in France in which the banks were nationalized, and he notes with little effect. In terms of a cashless society, Mark is convinced we'll still have cash a hundred years from now, but Scott agrees it is going away at some point. I believe Canada looked into the consequences of going cashless. But even if Mark is right and cash is here for the long haul, does it really make much of a difference? Isn't it just an arbitrary choice by the depositor about which form to keep his money in? (Mark & Mishkin agree it's the "depositor's choice.") Does it really affect the long term neutrality of money, the QTM and the HPE? <br /><br /><span style="font-size: x-small;">*Although only reserves are MOA, I think both Scott & Nick would agree that both reserves and commercial bank deposits are a medium of exchange (MOE) in this case.</span><br /><br /><span style="font-size: x-small;"><span style="font-size: small;">For those wishing to see the above change in Ms sketched out in balance sheets, <a href="http://banking-discussion.blogspot.com/p/nick-vs-scott-hpe-hypothetical-balance.html" target="_blank">look here</a>. </span></span><br /><br /></div><a href="http://banking-discussion.blogspot.com/p/epsilon-example-additional-notes.html" target="_blank">Additional notes and links can be found here (warning: redundant and unorganized!)</a><br /><br /><div style="text-align: justify;">Although I compiled a more succinct history of this question <a href="http://monetaryrealism.com/market-monetarism-monetary-base-overdrive/#comment-111365" target="_blank">here</a>, (a copy <a href="http://banking-discussion.blogspot.com/2013/09/trash.html" target="_blank">here</a>) and the question itself has been brought up again <a href="http://monetaryrealism.com/market-monetarism-monetary-base-overdrive/#comment-111214" target="_blank">here</a> and <a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/04/monetary-monarchy.html?cid=6a00d83451688169e201a511a1d525970c#comment-6a00d83451688169e201a511a1d525970c" target="_blank">here</a>. Also, I discuss the history of a preceding related question <a href="http://monetaryrealism.com/market-monetarism-monetary-base-overdrive/#comment-111228" target="_blank">here</a> (in which the CB buys up the commercial banks).</div>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com24tag:blogger.com,1999:blog-3393033712226955105.post-63895588583964627682013-09-30T11:55:00.000-07:002013-09-30T11:55:05.287-07:00Reponse to OdieOdie, you wrote:<br /><br /><span id="comment-6a00d83451688169e2019affb28564970d-content">"Instead it will be income for the bank which it will use to pay e. g. one of its employees by crediting its account. No money being created are destroyed there, simply shifting funds around. For those $1200 the bank's deposit liabilities stay the same. (More maybe later)"</span><br /><br /><span id="comment-6a00d83451688169e2019affb28564970d-content">http://worthwhile.typepad.com/worthwhile_canadian_initi/2013/09/if-banks-bought-houses.html</span><br /><br /><span id="comment-6a00d83451688169e2019affb28564970d-content">I agree with everything in your comment up until that part!</span><br /><br /><span id="comment-6a00d83451688169e2019affb28564970d-content">There's two separate and completely independent IOUs at play here between you and the banking system in aggregate: Your IOU to them (the mortgage) and their IOU to you (your deposit). You are each others creditors and debtors. If you pay $2000 to them with your deposit, that is accomplished by them debiting your deposit account. Now it so happens that $800 of that payment is principal, so it also affects your IOU to them, so they mark that IOU down by $800 for that. Your mortgage though is not a medium of exchange and thus it is not "inside money." $2000 of inside money was destroyed in this example: $800 of your IOU was also destroyed for a net gain by the banks of $1200 of equity (the abstract dollar amount of the value of assets in excess of the value of liabilities). They have no obligation to turn around and create more inside money by crediting other people's or entities' bank deposits with $2000 or $1200 or any other amount. There's no law of the preservation of bank deposits. You and I can't destroy bank deposits because to us bank deposits are "outside money." "Inside" and "outside" are relative terms. Relative to non-bank private entities, bank deposits are outside. Relative to the private sector (the usual vantage point from which to define "inside" and "outside") they are "inside." If we included the Fed in our vantage point, then Fed created money (reserve notes and Fed deposits) would also be "inside" and only coins and the extremely rare "US notes" would remain "outside." If you and I write out our own IOUs and use them as money, then we CAN destroy those and that "money" would be "inside" us.</span><br /><span id="comment-6a00d83451688169e2019affb28564970d-content"><br /></span><span id="comment-6a00d83451688169e2019affb28564970d-content"><br /></span>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-44702720815358640632013-09-13T23:23:00.003-07:002016-03-22T17:17:47.287-07:00Equation Test<script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); </script> <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"> </script><br />λ<sub>b0 </sub>λ<sub>b0</sub> λ<sub>b0</sub><br /><br /><sub>λ<sub>b0 </sub>λ<sub>b0</sub> λ<sub>b0</sub> </sub><br /><br /><sub>$\Delta$ </sub><br /><br />Another equation test, this time from this blog:<br /><a href="http://informationtransfereconomics.blogspot.com/2014/03/the-islm-model-again.html?showComment=1396510569711#c5498535460855094305">http://informationtransfereconomics.blogspot.com/2014/03/the-islm-model-again.html?showComment=1396510569711#c5498535460855094305</a><br /><br />$$<br />r = \frac{1}{\kappa} \; \frac{\langle I\rangle}{M_{0}}<br />$$<br /><br /><script async="async" src="http://ji.revolvermaps.com/2/2.js?i=8akipsvtv2v&m=0&s=130&c=ff0000&t=1" type="text/javascript"></script> <br /><div class="MathJax_Display" role="textbox" style="text-align: center;"><span class="MathJax" id="MathJax-Element-9-Frame"><nobr><span class="math" id="MathJax-Span-72" style="display: inline-block; width: 15.095em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 12.563em;"><span style="clip: rect(1.154em, 1000em, 4.015em, -0.522em); left: -49px; position: absolute; top: -37px;"><span class="mrow" id="MathJax-Span-73"><span class="mi" id="MathJax-Span-74" style="font-family: "mathjax_main";">Δ</span><span class="mi" id="MathJax-Span-75" style="font-family: "mathjax_math"; font-style: italic;">I<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.064em;"></span></span><span class="mo" id="MathJax-Span-76" style="font-family: "mathjax_main"; padding-left: 0.278em;">≡</span><span class="mi" id="MathJax-Span-77" style="font-family: "mathjax_math"; font-style: italic; padding-left: 0.278em;">I<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.064em;"></span></span><span class="mo" id="MathJax-Span-78" style="font-family: "mathjax_main"; padding-left: 0.222em;">−</span><span class="msubsup" id="MathJax-Span-79" style="padding-left: 0.222em;"><span style="display: inline-block; height: 0px; position: relative; width: 1.526em;"><span style="clip: rect(1.716em, 1000em, 2.778em, -0.542em); left: 0em; position: absolute; top: -2.588em;"><span class="mi" id="MathJax-Span-80" style="font-family: "mathjax_math"; font-style: italic;">I<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.064em;"></span></span><span style="display: inline-block; height: 2.588em; width: 0px;"></span></span><span style="left: 0.441em; position: absolute; top: -2.245em;"><span class="texatom" id="MathJax-Span-81"><span class="mrow" id="MathJax-Span-82"><span class="mi" id="MathJax-Span-83" style="font-family: "mathjax_math"; font-size: 70.7%; font-style: italic;">r</span><span class="mi" id="MathJax-Span-84" style="font-family: "mathjax_math"; font-size: 70.7%; font-style: italic;">e</span><span class="mi" id="MathJax-Span-85" style="font-family: "mathjax_math"; font-size: 70.7%; font-style: italic;">f<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.042em;"></span></span></span></span><span style="display: inline-block; height: 2.399em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-86" style="font-family: "mathjax_main"; padding-left: 0.278em;">=</span><span class="mfrac" id="MathJax-Span-87" style="padding-left: 0.398em; padding-right: 0.12em;"><span style="display: inline-block; height: 0px; position: relative; width: 1.015em;"><span style="clip: rect(3.105em, 1000em, 4.332em, -0.542em); left: 50%; margin-left: -0.447em; position: absolute; top: -4.654em;"><span class="msubsup" id="MathJax-Span-88"><span style="display: inline-block; height: 0px; position: relative; width: 0.895em;"><span style="clip: rect(1.716em, 1000em, 2.778em, -0.542em); left: 0em; position: absolute; top: -2.588em;"><span class="mi" id="MathJax-Span-89" style="font-family: "mathjax_math"; font-style: italic;">I<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.064em;"></span></span><span style="display: inline-block; height: 2.588em; width: 0px;"></span></span><span style="left: 0.441em; position: absolute; top: -2.312em;"><span class="texatom" id="MathJax-Span-90"><span class="mrow" id="MathJax-Span-91"><span class="mn" id="MathJax-Span-92" style="font-family: "mathjax_main"; font-size: 70.7%;">0</span></span></span><span style="display: inline-block; height: 2.462em; width: 0px;"></span></span></span></span><span style="display: inline-block; height: 3.977em; width: 0px;"></span></span><span style="clip: rect(1.957em, 1000em, 2.789em, -0.519em); left: 50%; margin-left: -0.284em; position: absolute; top: -1.902em;"><span class="mi" id="MathJax-Span-93" style="font-family: "mathjax_math"; font-style: italic;">κ</span><span style="display: inline-block; height: 2.588em; width: 0px;"></span></span><span style="clip: rect(0.805em, 1000em, 1.263em, -0.568em); left: 0em; position: absolute; top: -1.293em;"><span style="border-left: 1.015em solid; display: inline-block; height: 1.25px; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="display: inline-block; height: 1.073em; width: 0px;"></span></span></span></span><span class="mi" id="MathJax-Span-94" style="font-family: "mathjax_main"; padding-left: 0.167em;">log</span><span class="mo" id="MathJax-Span-95"></span><span class="mfrac" id="MathJax-Span-96" style="padding-left: 0.287em; padding-right: 0.12em;"><span style="display: inline-block; height: 0px; position: relative; width: 2.197em;"><span style="clip: rect(1.902em, 1000em, 3.28em, -0.458em); left: 50%; margin-left: -0.915em; position: absolute; top: -3.589em;"><span class="mrow" id="MathJax-Span-97"><span class="mo" id="MathJax-Span-98" style="font-family: "mathjax_main";">⟨</span><span class="mi" id="MathJax-Span-99" style="font-family: "mathjax_math"; font-style: italic;">M<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.081em;"></span></span><span class="mo" id="MathJax-Span-100" style="font-family: "mathjax_main";">⟩</span></span><span style="display: inline-block; height: 2.841em; width: 0px;"></span></span><span style="clip: rect(3.105em, 1000em, 4.466em, -0.533em); left: 50%; margin-left: -1.039em; position: absolute; top: -3.291em;"><span class="msubsup" id="MathJax-Span-101"><span style="display: inline-block; height: 0px; position: relative; width: 2.077em;"><span style="clip: rect(1.716em, 1000em, 2.778em, -0.533em); left: 0em; position: absolute; top: -2.588em;"><span class="mi" id="MathJax-Span-102" style="font-family: "mathjax_math"; font-style: italic;">M<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.081em;"></span></span><span style="display: inline-block; height: 2.588em; width: 0px;"></span></span><span style="left: 0.992em; position: absolute; top: -2.245em;"><span class="texatom" id="MathJax-Span-103"><span class="mrow" id="MathJax-Span-104"><span class="mi" id="MathJax-Span-105" style="font-family: "mathjax_math"; font-size: 70.7%; font-style: italic;">r</span><span class="mi" id="MathJax-Span-106" style="font-family: "mathjax_math"; font-size: 70.7%; font-style: italic;">e</span><span class="mi" id="MathJax-Span-107" style="font-family: "mathjax_math"; font-size: 70.7%; font-style: italic;">f<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.042em;"></span></span></span></span><span style="display: inline-block; height: 2.399em; width: 0px;"></span></span></span></span><span style="display: inline-block; height: 3.977em; width: 0px;"></span></span><span style="clip: rect(0.805em, 1000em, 1.263em, -0.568em); left: 0em; position: absolute; top: -1.293em;"><span style="border-left: 2.197em solid; display: inline-block; height: 1.25px; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="display: inline-block; height: 1.073em; width: 0px;"></span></span></span></span></span><span style="display: inline-block; height: 2.841em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 3.131em; overflow: hidden; vertical-align: -1.258em; width: 0px;"></span></span></nobr></span> </div><br /><br /><br />$$ r = \frac{1}{\kappa} \; \frac{\langle I\rangle}{M_{0}} $$<br /><br /><br />$$ K_{h,g'} = \frac{1}{\theta}$$<br />$$ K_{y',g'} = \frac{1-\theta}{\theta}$$<br /><br /><br />$K_{h,g'} = \frac{1}{\theta}$<br /><br /><br />$K_{y',g'} = \frac{1-\theta}{\theta}$<br /><br />How about in the middle $K_{h,g'} = \frac{1}{\theta}$ of a sentence?<br /><br /><br /><br /><br /><div class="MathJax_Display" role="textbox" style="text-align: center;"><span class="MathJax" id="MathJax-Element-5-Frame"><nobr><span class="math" id="MathJax-Span-17" style="display: inline-block; width: 11.307em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 9.407em;"><span style="clip: rect(1.281em, 1000em, 3.732em, -0.568em); left: -42px; position: absolute; top: -29px;"><span class="mrow" id="MathJax-Span-18"><span class="mtext" id="MathJax-Span-19" style="font-family: "mathjax_main";">(1) </span><span class="mi" id="MathJax-Span-20" style="font-family: "mathjax_math"; font-style: italic;">r</span><span class="mo" id="MathJax-Span-21" style="font-family: "mathjax_main"; padding-left: 0.278em;">=</span><span class="mfrac" id="MathJax-Span-22" style="padding-left: 0.398em; padding-right: 0.12em;"><span style="display: inline-block; height: 0px; position: relative; width: 1.698em;"><span style="clip: rect(1.705em, 1000em, 2.788em, -0.535em); left: 50%; margin-left: -0.505em; position: absolute; top: -3.265em;"><span class="mrow" id="MathJax-Span-23"><span class="mi" id="MathJax-Span-24" style="font-family: "mathjax_math"; font-style: italic;">d<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-25" style="font-family: "mathjax_math"; font-style: italic;">I<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.064em;"></span></span></span><span style="display: inline-block; height: 2.588em; width: 0px;"></span></span><span style="clip: rect(1.705em, 1000em, 2.788em, -0.535em); left: 50%; margin-left: -0.789em; position: absolute; top: -1.897em;"><span class="mrow" id="MathJax-Span-26"><span class="mi" id="MathJax-Span-27" style="font-family: "mathjax_math"; font-style: italic;">d<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-28" style="font-family: "mathjax_math"; font-style: italic;">M<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.081em;"></span></span></span><span style="display: inline-block; height: 2.588em; width: 0px;"></span></span><span style="clip: rect(0.805em, 1000em, 1.263em, -0.568em); left: 0em; position: absolute; top: -1.293em;"><span style="border-left: 1.698em solid; display: inline-block; height: 1.25px; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="display: inline-block; height: 1.073em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-29" style="font-family: "mathjax_main"; padding-left: 0.278em;">=</span><span class="mfrac" id="MathJax-Span-30" style="padding-left: 0.398em; padding-right: 0.12em;"><span style="display: inline-block; height: 0px; position: relative; width: 0.688em;"><span style="clip: rect(1.986em, 1000em, 3.03em, -0.485em); left: 50%; margin-left: -0.253em; position: absolute; top: -3.517em;"><span class="mn" id="MathJax-Span-31" style="font-family: "mathjax_main";">1</span><span style="display: inline-block; height: 2.841em; width: 0px;"></span></span><span style="clip: rect(1.957em, 1000em, 2.789em, -0.519em); left: 50%; margin-left: -0.284em; position: absolute; top: -1.902em;"><span class="mi" id="MathJax-Span-32" style="font-family: "mathjax_math"; font-style: italic;">κ</span><span style="display: inline-block; height: 2.588em; width: 0px;"></span></span><span style="clip: rect(0.805em, 1000em, 1.263em, -0.568em); left: 0em; position: absolute; top: -1.293em;"><span style="border-left: 0.688em solid; display: inline-block; height: 1.25px; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="display: inline-block; height: 1.073em; width: 0px;"></span></span></span></span><span class="mspace" id="MathJax-Span-33" style="display: inline-block; height: 0em; overflow: hidden; vertical-align: 0em; width: 0.278em;"></span><span class="mfrac" id="MathJax-Span-34" style="padding-left: 0.287em; padding-right: 0.12em;"><span style="display: inline-block; height: 0px; position: relative; width: 1.193em;"><span style="clip: rect(1.716em, 1000em, 2.778em, -0.542em); left: 50%; margin-left: -0.253em; position: absolute; top: -3.265em;"><span class="mi" id="MathJax-Span-35" style="font-family: "mathjax_math"; font-style: italic;">I<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.064em;"></span></span><span style="display: inline-block; height: 2.588em; width: 0px;"></span></span><span style="clip: rect(1.716em, 1000em, 2.778em, -0.533em); left: 50%; margin-left: -0.537em; position: absolute; top: -1.902em;"><span class="mi" id="MathJax-Span-36" style="font-family: "mathjax_math"; font-style: italic;">M<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.081em;"></span></span><span style="display: inline-block; height: 2.588em; width: 0px;"></span></span><span style="clip: rect(0.805em, 1000em, 1.263em, -0.568em); left: 0em; position: absolute; top: -1.293em;"><span style="border-left: 1.193em solid; display: inline-block; height: 1.25px; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="display: inline-block; height: 1.073em; width: 0px;"></span></span></span></span></span><span style="display: inline-block; height: 2.841em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 2.638em; overflow: hidden; vertical-align: -0.918em; width: 0px;"></span></span></nobr></span></div>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com3tag:blogger.com,1999:blog-3393033712226955105.post-27656590198776242342013-09-13T11:48:00.002-07:002013-09-13T11:48:36.687-07:00Answer for Macromanmacroman, I’m with you up to here:<br /> “It is these reserves that the banks can then use to lend out money or do with it whatever they please.”<br /> 1. If you’re talking about banks lending reserves to each other (which I’m pretty sure you’re not) then this is correct. Since reserves are defined as base money HELD BY THE BANKS, you can see how this is true. Yes banks loan each other base money:<br /> “MB: The total of all physical currency plus Federal Reserve Deposits (special deposits that only banks can have at the Fed). MB = Coins + US Notes + Federal Reserve Notes + Federal Reserve Deposits.”<br /> 2. If you’re talking about something else, this is not true. About the closest thing you could say that IS true is that a cash advance is a loan of base money in the form of “physical currency.”<br /> “Because the federal reserve does not have to have the MONEY on hand to buy the bond, but rather can use a made-up reserve, it is the equivalent of printing money.”<br /> Check this out:<br /> <a href="http://brown-blog-5.blogspot.com/2013/08/banking-example-41-quantitative-easing.html" rel="nofollow">http://brown-blog-5.blogspot.com/2013/08/banking-example-41-quantitative-easing.html</a><br /> Notice how reserves flow out of the Fed, and assets flow in, in equal proportion.<br /> As for the rest of your email, check this out:<br /> <a href="http://brown-blog-5.blogspot.com/2013/08/banking-example-11-all-possible-balance.html" rel="nofollow">http://brown-blog-5.blogspot.com/2013/08/banking-example-11-all-possible-balance.html</a><br /> Especially the balance sheets at the bottom: “Public (simplified)” and “more simpflified.” Especially this bit:<br /> public’s stock of money = L + B + F = bank deposits + cash<br /> It’s the “F” part you’re worried about. But the thing to keep in mind though is that this does NOT affect the public’s equity!<br /> public’s equity = T<br /> QE changes the composition of the public’s stock of money, but has NO effect on the public’s equity.Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-39339124361921699422013-09-06T09:36:00.002-07:002014-04-16T00:21:12.762-07:00TrashBelow is a test reply comment to <a href="http://monetaryrealism.com/market-monetarism-monetary-base-overdrive/#comment-111329" target="_blank">Fed Up</a> and <a href="http://monetaryrealism.com/market-monetarism-monetary-base-overdrive/#comment-111335" target="_blank">winterspeak</a> in JKH's post on Market Monetarism. My original posted comment is <a href="http://monetaryrealism.com/market-monetarism-monetary-base-overdrive/#comment-111365" target="_blank">here</a>, but as of this writing it's "awaiting moderation" (I'm sure because there's more than one link in it), but it still let me grab a link to it, so it'll be interesting to see if people can see the original even though it's awaiting moderation.<br />---------------------------------------------------------------------------------------------------------------------------- <br /><div class="separator" style="clear: both; text-align: center;"></div><br /> Fed Up & winterspeak,<br /> “Tom Brown, does this sound familiar?” — Fed Up<br /> Yes, this sounds very familiar, which is why I posted <a href="http://banking-discussion.blogspot.com/2014/03/toms-epsilon-example.html" rel="nofollow">a link</a> to my post “Nick vs Scott” on this subject <a href="http://monetaryrealism.com/market-monetarism-monetary-base-overdrive/#comment-111228" rel="nofollow">above</a>. And Nick’s response <a href="http://monetaryrealism.com/market-monetarism-monetary-base-overdrive/#comment-111253" rel="nofollow">above</a> again highlights a difference with Scott. Let’s review: Scott Sumner, in <a href="http://www.themoneyillusion.com/?p=23314" rel="nofollow">this post</a> explaining the hot potato effect (HPE), used as an extreme example under which the HPE still applied a “cashless economy” (his case 7):<br /><br /><blockquote>7. Now let’s assume a cashless economy where the MOA is 100% reserves. Still no change; reserves are still a hot potato.</blockquote>Using Scott’s hypothetical case 7 a basis, I asked Scott and Mark Sadowski the <a href="http://www.themoneyillusion.com/?p=26355#comment-323558" rel="nofollow">following question:</a><br /><br /><blockquote>OK, let’s start with your own example #7 from this post:<br /><a href="http://www.themoneyillusion.com/?p=23314" rel="nofollow">http://www.themoneyillusion.com/?p=23314</a>“7. Now let’s assume a cashless economy where the MOA is 100% reserves.”<br /> You’ve clearly identified the MOA there: reserves. Banking doesn’t matter, so why not assume a single commercial bank? And my other assumptions: no taxes, gov spending, foreign trade, etc.<br /> So if initially the CB buys $X in assets, this gives us an initial $X in reserves, which you’ve identified as MOA.<br />Since we have an MOA, we will reach a steady state price level, P, right?<br /> Now what if the CB sells 1-epsilon of its assets? The new eventual price level should be:<br /> new steady state price level = P*(epsilon*X/X) = P*epsilon<br /> So as epsilon approaches zero, the new steady state price level should approach zero too??</blockquote>At which point I added<br /><br /><blockquote><a href="http://www.themoneyillusion.com/?p=26355#comment-323565" rel="nofollow">Scott, of course the reserve requirement = 0% too.</a></blockquote>Scott’s <a href="http://www.themoneyillusion.com/?p=26355#comment-323611" rel="nofollow">response</a> was:<br /><br /><blockquote>Tom, Yes, as the level of reserves go to zero, so does the price level.</blockquote>Mark Sadowski agrees with Scott, although he complains about the realism of my (actually Scott’s!) hypothetical cashless society:<br /><br /><blockquote><a href="http://www.themoneyillusion.com/?p=26355#comment-323706" rel="nofollow">Tom Brown,<br />I agree with Scott. However, any example that doesn’t include currency is excluding what has been the most important part of the monetary base historically. In short it is extremely unrealistic.</a></blockquote>This is quite different than what Nick writes <a href="http://monetaryrealism.com/market-monetarism-monetary-base-overdrive/#comment-111253" rel="nofollow">above</a>:<br /><br /><blockquote>If there were just one commercial bank, and if nobody used central bank currency, and if there were no legally required reserves, then that single commercial bank would not need to hold any reserves. That single commercial bank could ignore the central bank. The central bank would disappear.</blockquote>Nick wrote nearly the same thing when I first presented him with my version of Scott’s hypothetical, however <a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/03/one-general-theory-of-money-creation-to-rule-them-all.html?cid=6a00d83451688169e201a511860e56970c#comment-6a00d83451688169e201a511860e56970c" rel="nofollow">after showing him Scott’s response</a>, he wrote this:<br /><br /><blockquote><a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/03/one-general-theory-of-money-creation-to-rule-them-all.html?cid=6a00d83451688169e201a511867eb4970c#comment-6a00d83451688169e201a511867eb4970c" rel="nofollow">Tom: you really do need to distinguish between the *demand* for reserves going to zero and the *supply* of reserves going to zero. (And *both* supply and demand going to zero.) I read you one way, and Scott read you the other. It’s supply AND demand.</a></blockquote>He also later saw my <a href="http://4.bp.blogspot.com/--0MiGgUY0jU/UyuU6G2LYiI/AAAAAAAAAeA/4W54EyebkL4/s1600/EpsilonProblem03.png" rel="nofollow">notional chart</a> (animated version <a href="http://banking-discussion.blogspot.com/p/epsilon-animation.html" rel="nofollow">here</a>) of my interpretation of what he meant by this and wrote:<br /><br /><blockquote><a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/03/two-lm-curves.html?cid=6a00d83451688169e201a51188bb48970c#comment-6a00d83451688169e201a51188bb48970c" rel="nofollow">Tom: thanks. looks roughly right on a first glance.</a></blockquote>though to be fair, the <a href="http://4.bp.blogspot.com/-YXKxPL1EhrE/Uyhg9oxkERI/AAAAAAAAAcc/0Y2y-3_RFsc/s1600/TomsEpsilonProblem.png" rel="nofollow">version</a> he saw was slightly different, but not substantially so (embedded in the comments <a href="http://worthwhile.typepad.com/worthwhile_canadian_initi/2014/03/the-sense-in-which-the-stock-of-money-is-supply-determined/comments/page/1/#comments" rel="nofollow">here</a>). <br />Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com0tag:blogger.com,1999:blog-3393033712226955105.post-11949875198825132482013-09-03T11:10:00.001-07:002013-09-03T11:19:00.699-07:00Sumner's HPE Explanationhttp://www.themoneyillusion.com/?p=23314<br /><br />Geoff's comment: <br /><br />http://pragcap.com/the-banking-camp-vs-the-macroeconomics-camp/comment-page-1#comment-153314<br /><br /><div class="comment-content">"If somebody gives me, say, $500 in cash but my wallet is already full, then I’m going to do something else with it. I might spend the cash on real stuff or convert it to another kind of financial asset like a bond or stock. That’s the HPE in action, right?<br />But there is only one problem. The Fed can’t just give me $500 in cash. All they can do is buy an existing financial asset from me (aka an asset swap). <br />I know Dr. SS understands this. So what am I missing?<br />PS I agree with your post, Cullen. Sorry for going O/T <img alt=":)" class="wp-smiley" src="http://pragcap.com/wp-includes/images/smilies/icon_smile.gif" />"<br /><br />Geoff, I agree that's a problem. Just giving you the $500 is what the MMists call a "Helicopter Drop."<br /><br />But what Scott's saying in his gold analogy, the difference between cases 3. and 4. is that gold is the MOA in 4 and prices are "'sticky" (meaning they don't move instantaneously).<br /><br />Therefore in case 3, the price of gold drops in half instantly. That's still the HPE. In case 4 this happens more gradually, and what changes instantly are things like "interest rates."<br /><br />Make sense?<br /><br />BTW, to comment easily select "Name/URL" then you can put any URL you want in there, including www.google.com </div>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com2tag:blogger.com,1999:blog-3393033712226955105.post-31362449778786590532013-08-22T08:50:00.002-07:002013-08-23T10:26:17.865-07:00AuburnAuburn, you <a href="http://pragcap.com/banks-and-the-monetary-base-a-friendly-response-to-paul-krugman/comment-page-1#comment-152072">write:</a><br /><br />"Well, if over a 30 year period, the Govt issued no new bonds due to being in a sustained $1p.a. surplus, almost every bond would have matured in that 30 years. Every bond holder would have gotten their original deposit back (plus interest) and Congress would have never had to tax $16 T in surplus in order to get the bank money with which to redistribute around back to the bond holders.<br />This is a serious flaw in your rationale. If $16 trillion in bonds can be redeemed with only $30 in surplus funds over a 30 year period. Then deficit spending is adding new money to the system. Thanks for the back and forth Tom, I enjoyed it."<br /><br />Earlier you wrote:<br /><br />"There is no such thing as Congress appropriating funds from the TGA to pay back maturing T-bonds."<br /><br />Are you saying that Tsy can legally issue no new bonds because it's experiencing a $1 p.a. surplus? Are you saying that this is what the law dictates? You're saying this because to issue even one new bond puts them over the debt limit (even though another bond is just about to mature... thus putting them right back below the debt limit again)?<br /><br />But this can easily be solved by raising the debt limit just enough above the current debt to allow a small number of bonds to be sold (just enough to cover a new set of maturing bonds) so that the principal can be paid, thus exchanging the old bond as a liability on Tsy's balance sheet with a new bond liability.<br /><br />Or are you saying that legally NO new bonds can legally be issued in any circumstances when there's even a $1 p.a. surplus? Even if there's a small buffer between the current debt limit and the current debt?<br /><br />Update:<br /><br />From the bottom of this post:<br /><br /><a href="http://brown-blog-5.blogspot.com/2013/08/banking-example-11-all-possible-balance.html">http://brown-blog-5.blogspot.com/2013/08/banking-example-11-all-possible-balance.html</a><br /><br /><table border="1"><caption><b>Public (more simplified)</b></caption><tbody><tr><th style="text-align: center;">Assets</th><th style="text-align: center;">Liabilities</th></tr><tr><td>$(L+B+F) deposits</td><td>$L borrowing from banks </td></tr><tr><td>$(T-B-F) t-debt</td><td>-------------------------------</td></tr><tr><th style="text-align: center;">Total Assets</th><th style="text-align: center;">Total Liabilities</th></tr><tr><td>$(T+L)</td><td>$L</td></tr><tr><th style="text-align: center;">Negative Equity</th><th style="text-align: center;">Equity</th></tr><tr><td>-----------------------</td><td>$T</td></tr></tbody></table><br /><br />Update #2: (O/T):<br /><br /><i><span style="font-size: small;">Below is a PREVIEW of a coming post (perhaps just this one redone). In it I'm proposing to wrap both intra-governmental and foreign up in one big new entity called "X-org" (I'm putting it here in case somebody has some feedback for me about my plans!):</span></i><br /><br /><span style="font-size: x-small;"><span style="font-size: small;">So what I'm proposing to do here is to create a new "X-org" balance sheet representing the aggregated effects of both the non-Tsy intra-governmental and the foreign sectors. This new balance sheet will thus incorporate Federal worker retirement funds, Social Security (SS), GSEs (Fannie, Freddie, and Fannie Mae), and all other such government agencies AS WELL AS all foreign governments, central banks, international organizations (both legal and criminal: e.g. the IMF and Mexican drug cartels), etc. The reason for this is:</span></span><br /><ol><li><span style="font-size: small;">To try to keep the number of balance sheets and variables from getting out of control</span></li><li><span style="font-size: small;">Aggregated together all such organizations have one super-set of common traits</span></li></ol><span style="font-size: small;">Looking at point 2 above in more detail, such an aggregate organization will be able to:</span><br /><ol><li><span style="font-size: small;">Hold US Tsy debt</span></li><li><span style="font-size: small;">Hold Fed deposits</span></li><li><span style="font-size: small;">Hold MBS </span></li><li><span style="font-size: small;">Hold cash (still assuming only reserve notes here: not coins or US notes)</span></li><li><span style="font-size: small;">Sell its own obligations: debt, currency, central-bank liabilities, bonds, whatever. </span></li></ol><span style="font-size: small;">Perhaps this is a bad idea. I guess I'll just jump right in and find out! The new variables required will be Tx = X-org held Tsy debt, Ux = unspent X-org held Fed deposits, Mx = X-org held MBS, Cx = X-org held cash, X = X-org generated obligations (central bank liabilities, bonds, notes etc). Now since X is meant to describe the total amount of this obligation/debt/note issued by X-org, now I'll unfortunately need more "X" variables to describe the amount of X held by each of the other players. I'll assume Tsy can't hold any, but the rest can. Thus Xf = central bank held X notes and Xb = bank held X notes. Thus X-Xf-Xb represents the public held X notes. Here's how the balance sheet would look for entity X-org:</span><br /><span style="font-size: small;"><br /></span><table border="1"><caption><b>X-org</b></caption><tbody><tr><th style="text-align: center;">Assets</th><th style="text-align: center;">Liabilities</th></tr><tr><td>$Ux CB deposit</td><td>$X debt</td></tr><tr><td>$Tx T-debt</td><td>-----------------------</td></tr><tr></tr><tr><td>$Mx MBS </td><td>-----------------------</td></tr><tr><td>$Cx cash </td><td>-----------------------</td></tr><tr><th style="text-align: center;">Total Assets</th><th style="text-align: center;">Total Liabilities</th></tr><tr><td>$(Ux+Tx+Mx+Cx)</td><td>$X</td></tr><tr><th style="text-align: center;">Negative Equity</th><th style="text-align: center;">Equity </th></tr><tr><td>---------------------</td><td>$(Ux+Tx+Mx+Cx-X)</td></tr></tbody></table><span style="font-size: x-small;"></span>Tom Brownhttp://www.blogger.com/profile/17654184190478330946noreply@blogger.com37