Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restriction on the number of state variables #151

Open
iglikav opened this issue May 14, 2019 · 2 comments
Open

Restriction on the number of state variables #151

iglikav opened this issue May 14, 2019 · 2 comments

Comments

@iglikav
Copy link

iglikav commented May 14, 2019

I am using dolo to simulate a DSGE model. However, I cannot load any model with more than 5 state variables using the yaml_import command. No error messages are displayed, just the loading continues until the kernel dies. If any of the transition equations is dropped then the model is loaded with no problem. Is there a restriction on the number of state variables?
Please find below a small example model.
Thank you very much!

name: min

symbols:

   exogenous: [Y]
   controls: [C]
   states: [K, G, X, B, Tr, CG]
   parameters: [beta, delta, nu, r_B, sig_z,
               rho_X, rho_B, rho_Tr, rho_CG, 
               CGoY, KoY, BoY, TroY, XoY,
               REV, I, r]

equations:
     
    arbitrage:
        - 1-beta*C/C(1)*(1-delta)          | 0 <= C <= inf
        
    transition:
        - K = (1-delta)*K(-1) + I + r*K(-1) - C(-1)
        - G = (1-nu)*G(-1) + X(-1) 
        - X = rho_X*X(-1)+(1-rho_X)*XoY*Y(-1)
        - B = (1+r_B)*B(-1) - REV + X(-1) + CG(-1) + Tr(-1)
        - Tr = rho_Tr*Tr(-1)+(1-rho_Tr)*TroY*Y(-1)
        - CG=rho_CG*CG(-1)+(1-rho_CG)*CGoY*Y(-1)

calibration:

    # parameters
    beta : 0.99
    delta: 0.04
    nu: 0.03
    r_B: 0.005
    sig_z: 0.0
    
    rho_X: 0.5
    rho_Tr: 0.9
    rho_CG: 0.9
    
    CGoY: 0.11
    KoY: 3
    BoY: 0.2
    TroY: 0.14
    
    Y: 1
    
    REV: 0.16*Y
    I: 0.3*Y
    
    CG: CGoY*Y 
    K: KoY*Y 
    Tr: TroY*Y
    B: BoY*Y
    
    r: (1-beta*(1-delta))/beta
    C: (r-delta*K) + I
    X: REV - r_B*B - CG
    G: X/nu
    XoY: X  
    
exogenous: !Normal
    Sigma: [[sig_z^2]]

domain:
    K: [K*0.5, K*1.5]
    G: [G*0.5, G*1.5]
    X: [X*0.5, X*1.5]
    B: [B*0.5, B*1.5]
    Tr: [Tr*0.5, Tr*1.5]
    CG: [CG*0.5, CG*1.5]

options:
    grid: !Cartesian
        orders: [20,20,20,20,20,20]
@albop
Copy link
Member

albop commented May 14, 2019

Thank you @iglikav . There should not be a limit on the number of states when you import the model. Maybe the problem stems from the cartesian grid which has 20^6 points. This should not be a problem when it comes to construct it (you won't be able to solve the model on that grid but you can try perturbations). We'll investigate.

@albop albop assigned albop and unassigned albop May 14, 2019
@iglikav
Copy link
Author

iglikav commented May 15, 2019

I decreased the number of the points in the grid to 10^6 and my full-scale model was loaded and solved using the perfect foresight algorithm with no problem. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants