gcubed.data.model_equations

class ModelEquations:
ModelEquations()

Dependency injection - no argument instantiation.

is_fully_configured: bool

Returns

True if the required properties have been configured and False otherwise.

The required properties are:

  • sym_data The summary of the SYM model.

Returns

The SymData object

Returns

The model configuration object

Returns

The equation map object

x1l: numpy.ndarray

Returns

The LHS vector for the state variables in the left-hand side of the model equations.

j1l: numpy.ndarray

Returns

The LHS vector for the costate variables in the left-hand side of the model equations.

zel: numpy.ndarray

Returns

The LHS vector for the expected endogenous variables in the left-hand side of the model equations.

z1l: numpy.ndarray

Returns

The LHS vector for the endogenous variables in the left-hand side of the model equations.

x1r: numpy.ndarray

Returns

The RHS vector for the state variables in the RHS-hand side of the model equations.

j1r: numpy.ndarray

Returns

The RHS vector for the costate variables in the RHS-hand side of the model equations.

zer: numpy.ndarray

Returns

The RHS vector for the expectedendogenous variables in the RHS-hand side of the model equations.

z1r: numpy.ndarray

Returns

The RHS vector for the endogenous variables on the RHS-hand side of the model equations.

yjr: numpy.ndarray

Returns

The RHS vector for the lagged costate variables on the RHS-hand side of the model equations.

yxr: numpy.ndarray

Returns

The RHS vector for the lagged state variables in the RHS-hand side of the model equations.

exo: numpy.ndarray

Returns

The RHS vector for the exogenous variables in the RHS-hand side of the model equations.

exz: numpy.ndarray

Returns

The RHS vector for the lagged expected exogenous variables on the RHS-hand side of the model equations.

par: numpy.ndarray

Returns

The vector for the model parameters.

equations

Returns

The model equation functions object

def set_vector_value(self, vector: str, sequence: int, value: float):

Objective

Set the value of an element to the specified value

Arguments

  • vector_name: The name of the vector to update
  • sequence_number: The index of the element to update
  • value: The value to set the element to
def get_vector_value(self, vector_name: str, sequence_number: int) -> float:

Objective

Get the value of an element in the specified vector.

Arguments

  • vector_name: The name of the vector to retrieve the value from
  • sequence_number: The index of the element to retrieve

Returns

The value of the element in the specified vector

def populate_parameters_to_evaluate_equations(self, parameters: gcubed.model_parameters.parameters.Parameters):

Objective

Populate the model parameters for the equations to be evaluated.

Arguments

  • parameters: The model parameters object.
def populate_vectors_to_evaluate_equation( self, lhs_variable_name: str, lhs_year: int, database: gcubed.data.linearisation_database.LinearisationDatabase):

Objective

Populate the vectors required to evaluate the equation for the specified variable.

Arguments

  • lhs_variable_name: The full name of the variable on the lefthand side of the equation.

  • lhs_year: The year determining which the variable values are to be populated. This is the year associated with the left-hand side variable.

  • database: The linearisation database used to source variable values from.

def rhs_year_adjustment(self, rhs_prefix: str, rhs_vector: str) -> int:

Overview

Determines the year offset of the RHS variable relative to the year for the LHS variable.

Arguments

  • rhs_vector: The RHS variable vector.

  • rhs_prefix: The RHS variable prefix.

Returns

The RHS variable year in as a YYYY format integer.

def evaluate_equation(self, lhs_variable_name: str) -> float:

Objective

Evaluate the equation for the specified variable, returning its value.

Arguments

  • lhs_variable_name: The full name of the variable.

Returns

The value of the variable after evaluating the equation.