iode.Equation
- class iode.Equation(endogenous: str, lec: str, method: EqMethod | str = EqMethod.LSQ, from_period: str | Period = None, to_period: str | Period = None, comment: str = '', instruments: str = '', block: str = '')[source]
An equation represents an equality mixing variables and scalars (coefficients) and is part of a model. Each equation is composed of the following elements:
the LEC form (the formula scripting language in IODE)
a free comment (title of the equation)
the method by which it was estimated (if applicable)
the possible estimation period
the names of equations estimated simultaneously (block)
the instruments used for the estimation
All these definition elements are present in each equation, but may be left empty if not applicable.
The name of an equation is that of its endogenous variable. An equation can never be renamed, but it can be deleted and redefined with a new name.
- Parameters:
- endogenous: str
Name of the endogenous variable. It must the same as the name of the present equation in the Equations database.
- lec: str
LEC expression of the equation.
- method: EqMethod or str, optional
Method used to estimate the coefficients of the equation. Defaults to LSQ.
- from_period: str or Period, optional
Starting period for the estimation. Defaults to the starting period of the sample associated with the IODE Variables database.
- to_period: str or Period, optional
Ending period for the estimation. Defaults to the ending period of the sample associated with the IODE Variables database.
- comment: str, optional
Defaults to empty.
- instruments: str, optional
Defaults to empty.
- block: str, optional
block of equations (to estimate) to which the equation belong. Defaults to empty.
- Attributes:
- endogenous: str
name of the endogenous variable. It must the same as the name of the present equation in the Equations database.
- lec: str
LEC expression of the equation.
- method: EqMethod
- estimation method. Possible values are:
LSQ
ZELLNER
INSTRUMENTAL
GLS
MAX_LIKELIHOOD
- sample: Sample
estimaton sample.
- comment: str
- instruments: str
estimation instruments.
- block: str
block of equations (to estimate) to which the equation belong.
- tests: dict(str, float)
tests values associated with the estimation of the equation.
- date: str
last time the equation has been estimated.
Methods
copy()Return a copy of the current Equation.
estimate([from_period, to_period, maxit, ...])Estimate the present equation.
estimate_step_wise([from_period, to_period, ...])Estimates an equation and searches for the best possible test values for all possible combinations of coefficients.
get_formated_date([format])Return the date of last estimation in a given format.
reset_tests()Resets the estimation tests of the current equation.
Split an equation into its left-hand side and its right-hand side.
from_cython_obj
Examples
>>> from iode import Equation, variables >>> variables.sample = "1960Y1:2015Y1" >>> eq_ACAF = Equation("ACAF", "(ACAF / VAF[-1]) := acaf1 + acaf2 * GOSF[-1] + acaf4 * (TIME=1995)") >>> eq_ACAF Equation(endogenous = 'ACAF', lec = '(ACAF / VAF[-1]) := acaf1 + acaf2 * GOSF[-1] + acaf4 * (TIME=1995)', method = 'LSQ', from_period = '1960Y1', to_period = '2015Y1')
- __init__(endogenous: str, lec: str, method: EqMethod | str = EqMethod.LSQ, from_period: str | Period = None, to_period: str | Period = None, comment: str = '', instruments: str = '', block: str = '') Self[source]
Methods
__init__(endogenous, lec[, method, ...])copy()Return a copy of the current Equation.
estimate([from_period, to_period, maxit, ...])Estimate the present equation.
estimate_step_wise([from_period, to_period, ...])Estimates an equation and searches for the best possible test values for all possible combinations of coefficients.
from_cython_obj(obj)get_formated_date([format])Return the date of last estimation in a given format.
reset_tests()Resets the estimation tests of the current equation.
Split an equation into its left-hand side and its right-hand side.
Attributes
Estimation block of equations to which the equation belongs.
Return the list of coefficients present in the current equation.
Equation comment.
dateDate of the last estimation.
Endogenous variable of the current equation.
Instrument(s) used for the estimation.
LEC expression of the current equation.
Estimation method.
Estimation sample of the current equation.
Estimation tests.
Return the list of variables present in the equation.