modeldiff module
Created on Tue Oct 22 22:47:37 2013
Developement Module - only for the adventeous
This module handels symbolic differentiation of models
calculates the values of all the partial differentialkoifficients and creates matrices for each lag
@author: Ib Hansen
- modeldiff.findallvar(model, v)[source]
Finds all endogenous variables which is on the right side of = in the expresion for variable v lagged variables are included
- modeldiff.findendocur(model, v)[source]
Finds all endegenoujs variables which is on the right side of = in the expresion for variable v lagged variables are not included
- modeldiff.modeldiff(model, silent=False, onlyendocur=False, endovar=None, maxdif=9999999999999999, forcenum=False)[source]
Differentiate all relations with respect to all variable The result is placed in a dictory in the model instanse: model.diffendocur
- modeldiff.vardiff(model, var='*')[source]
Displays espressions for differential koifficients for a variable if var ends with * all matchning variables are displayes
- modeldiff.invdiff(model, var)[source]
Displays espressions for differential koifficients for a variable if var ends with * all matchning variables are displayes
- modeldiff.fouteval(model, databank)[source]
takes a dict of derivatives for a model and makes a function which returns a function which evaluates the derivatives in a period. The derivatives is both returned from the function and places in
:model.difvalue
- modeldiff.calculate_diffvalue(model, bank, per)[source]
calculates the numeric value of derivatives. the values are returnes and also places in model.diffvalue
- modeldiff.calculate_delta(databank)[source]
calculates the standard deviation of the change in all variable in a databank returns a panda series
- modeldiff.calculate_impact(model, bank)[source]
Calculate the impact of every variable in equation on the result based on the standard deviation and differential coefficient
- modeldiff.calculate_mat(model, lag=0)[source]
calcultae matrix of derivative values. very slow should be reworked
- modeldiff.calculate_allmat(model, df, per, show=False)[source]
Calculate and return a dictionary with a matrix of derivative values for each lag
- modeldiff.calculate_matold(model, lag=0, endo=True)[source]
calcultae matrix of derivative values. endo deteriins if it is with respect to endogeneous og exogeneous variables
- modeldiff.modelnet_dict(d, model, lag)[source]
creates a network where weight is determined by a 3d dict of impacts d: 3 d dictinorary
- modeldiff.pagerank(g)[source]
ranks the equations in a model according to the pagerank algoritme returns order in pagerank