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.diffout(model)[source]
modeldiff.diffprint(model, udfil='')[source]
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.rettet(ind)[source]
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_diffvalue_d3d(model)[source]

creates a 3D dictonary derivatives for each lag

modeldiff.calculate_mat(model, lag=0)[source]

calcultae matrix of derivative values. very slow should be reworked

modeldiff.calculate_endocurmat(model, df, per)[source]

for Newton solution find jacobi

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

modeldiff.display_diff(model, bank, var='')[source]
modeldiff.display_ip_old(model, ivar)[source]
modeldiff.display_all(model, df, per)[source]
modeldiff.display_ip(model, ivar)[source]
modeldiff.settozero(instring)[source]

sets subst() or Derivative() to zero in string the purpose is to get rid of derivatives of logical espressions

modeldiff.get_A(model, df, per)[source]
modeldiff.get_AINV(A)[source]
modeldiff.get_compagnion(model, df, per, show=False)[source]
modeldiff.get_eigen(model, df, per)[source]
modeldiff.eigplot0(w)[source]
modeldiff.eigplot(w, size=(3, 3))[source]
modeldiff.stabilitet(model, minnumber=8, maxnumber=8)[source]
modeldiff.tout(t)[source]
modeldiff.numdif(model, v, rhv, delta=0.005, silent=True)[source]