Source code for snowdrop.src.preprocessor.f_rhs
from numba import njit
[docs]
@njit
def f_rhs(x, p, exog=[0], order=0, ind=None):
### This code was generated by Python.
### Monetary policy model example
# First order derivatives are employed in most of the models to compute Jacobian.
# Higher order derivatives are used in nonlinear rational expectations models.
from scipy.special import lambertw as LambertW
from snowdrop.src.preprocessor.functions import Heaviside,Max,Min,Abs,DiracDelta
from snowdrop.src.preprocessor.condition import IfThenElse,IfThen,Derivative,Subs,Positive,Negative,myzif
import numpy as np
from numpy import exp, sin, cos, tan, sqrt, sign, log
# Initialize variables
_xi_1 = 0
_xi_2 = 0
_xi_3 = 0
PDOT__p1_ = x[0]
PDOT__ = x[4]
RR__ = x[5]
RS__ = x[6]
Y__ = x[7]
PDOT__m1_ = x[8]
RR__m1_ = x[9]
Y__m1_ = x[11]
ey__ = x[12]
err__ = x[13]
ers__ = x[14]
epdot__ = x[15]
# Set parameters
g = p[0]
p_pdot1 = p[1]
p_pdot2 = p[2]
p_pdot3 = p[3]
p_rs1 = p[4]
p_y1 = p[5]
p_y2 = p[6]
p_y3 = p[7]
# Set exogenous variables
exo__ = exog[0]
# Function:
function = np.zeros(4)
function[0] = epdot__ + PDOT__m1_*(1 - p_pdot1) + PDOT__p1_*p_pdot1 + p_pdot3*(-g + g**2/(-Y__m1_ + g)) + (-g + g**2/(-Y__ + g))*p_pdot2
function[1] = RS__ + err__ - PDOT__m1_*(1 - p_pdot1) - PDOT__p1_*p_pdot1
function[2] = Y__ + ers__ + exo__ + p_rs1*PDOT__
function[3] = ey__ + p_y1*Y__m1_ - p_y2*RR__ - p_y3*RR__m1_
if order == 0:
return function