Video Of Day

Breaking News

Calculating An Initial Steady Dry Soil Inwards Sfc_Models

One typical draw inward SFC modelling is examining the termination of a policy change. We assume that a model starts inward a steady dry reason at k=0, the policy alter hits at some afterwards time, in addition to nosotros so examine the solution. This yields to a greater extent than plausible scenarios than starting amongst stock variables equal to zero. However, the difficulty amongst this draw is that nosotros remove to develop the initial weather condition of the variables to equal the initial steady state.

This article is an unedited excerpt from my manuscript on stock-flow consistent (SFC) modelling inward Python. It describes how the sfc_models framework determines an initial steady dry reason for a model. For readers who are unfamiliar amongst the notion of the steady dry reason inside the context of SFC models, I bring this primer on the concepts of steady dry reason in addition to equilibrium.

Determining the initial steady dry reason is peculiarly hard if at that spot are multiple types of fiscal assets inside the model. All remove to live on develop at levels that correspond property allotment functions, in addition to nosotros must ensure that all residuum sheets balance. (At present, the framework does non endeavour to forcefulness residuum sheets into balance; unbalanced initial weather condition termination inward the creation of “ghost property balances” that are implied but non explicitly held inside the model.)

The EquationSolver shape has the capacity to solve for an initial steady dry reason (if it exists). By setting ParameterSolveInitialSteadyState to True, the solver volition starts a novel simulation, starting at k=-200 (by default), in addition to so simulating from that signal until k=0. The solver volition so restart from k=0 from that steady dry reason value normally. (The starting fourth dimension is develop past times ParameterInitialSteadyStateMaxTime, which has a default of 200.)

Importantly, if this alternative is chosen, the initial weather condition are applied to the starting dry reason inward negative time; the values at k=0 are but the calculated steady dry reason values. By default, all fiscal stock variables commencement at zero, in addition to so residuum sheets balance. Therefore, the resulting steady dry reason (if it exists) volition obey accounting rules. (If the user hardcodes an initial condition, it is upward to the user to validate that accounting consistency holds.) It is non possible to solve for a steady dry reason in addition to so specify unlike initial weather condition for k=0. That is, y'all would non live on able to apply a stupor to the steady dry reason until k=1.

It would live on to a greater extent than elegant to solve for the steady dry reason explicitly (as is done inward the text Monetary Economics by Godley in addition to Lavoie). In principle, it looks straightforward: nosotros but leave of absence the equations unchanged, except for lag conditions: inward a steady state, x[k-1] = x[k]. That is, nosotros supersede lag relationships amongst an equality. However, when this was tested for uncomplicated models, at that spot was no convergence to a solution. It is a hereafter query projection to re-examine this, in addition to run into whether it is possible to solve for the steady dry reason inward this fashion.

The framework currently supports the notion of a constant steady state: (almost) all variables are assumed to converge to constant values. (Exceptions are discussed below.) Presumably, nosotros remove exogenous variables to live on constant equally well. As a result, nosotros exercise the value of exogenous variables at k=0 for all negative times. This technique volition non piece of employment for variables that are viewed equally “exogenous” from the signal of sentiment of economics, but are non explicitly defined equally such. For example, nosotros mightiness intend of authorities consumption equally exogenous, in addition to nosotros desire to run into what happens if it increases linearly. If nosotros specify spending equally a business office (for example, G = xx * k) authorities spending volition live on calculated equally such during negative time. As a result, nosotros would non hold off a steady dry reason solution to exist. However, if nosotros define G equally an exogenous variable, equal to a Python listing ([0.0, 20.0, 40.0, …]), the authorities spending volition live on held apartment at 0 for all negative time. If y'all desire to avoid using a list, y'all could define the variable to live on equal to a custom business office (Section 7.3). You but remove to ensure that the custom business office returns a constant value for negative fourth dimension values.

In this case, nosotros could use:

def gov_spending(k):
    """
    Government spending business office that respects negative time.
    """
    if k < 0:
        # We are inward the initial steady dry reason calculation
        supply 0.0
    else:
        supply 20.0*k

The calculated fourth dimension serial are associated amongst the ‘steadystate_0’ log, which is output to the “_steadystate.txt” log when RegisterStandardLogs (Section 3.3) is called. These serial volition remove to live on examined to run into which ones produce non achieve steady dry reason if the framework throws an mistake when trying to calculate the steady state.

The framework but looks at the terminal values, to run into whether they are (roughly) constant. The touchstone may live on changed inward the future; it soon but looks at the terminal 2 value, in addition to checks whether the percent alter is less than ParameterInitialSteadyStateErrorToler (default is straight off 1e-4). The exception is when the terminal value is pocket-sized inward absolute damage (hardcoded threshold of 1e-4). In this case, the algorithm but validates that the previous value has a similarly depression absolute value. This needs to live on done, equally serial that are to a greater extent than or less zippo tin bring quite large percent changes when solved numerically.

However, some variables are expected to change, fifty-fifty inward a steady state. The most obvious representative existence the custom fourth dimension axis t. (Within sfc_models, at that spot are 2 variables associated amongst the fourth dimension axis; the discrete fourth dimension k which ever matches the iteration measurement number, in addition to the custom fourth dimension axis which tin live on a business office of k. This allows us to define a fourth dimension axis that goes upward past times 0.25 increments to correspond quarterly data, spell notwithstanding having access to the electrical current fourth dimension step.) The parameter ParameterInitialSteadyStateExcludedVariables is a parameter that is a listing of variables to exclude (by default, but 't'). (The fourth dimension axis k is ever excluded.) The user tin add together to a greater extent than variables to exclude inward enterprise to maintain to solving inward positive time.

H5N1 planned extension volition live on to permit a “steady state” where variables are growing at a steady rate. Unfortunately, the growth charge per unit of measurement of variables depends upon the variables’ classification. For example, nominal variables volition grow at a nominal growth rate, existent variables at a existent growth rate, in addition to cost variables the charge per unit of measurement of inflation. Meanwhile, parameters volition notwithstanding live on constants, amongst a nominal growth charge per unit of measurement of zero. The complexity of determining whether the solution is a legitimate steady dry reason explains why this implementation has been pushed back.

(c) Brian Romanchuk 2017

No comments