RBC model: simple vs advanced calibration using modularization and changing types

How to calibrate the parameters of the RBC model in a sophisticated way using Dynare’s preprocessing capabilities.

This video is part of a series of videos on the baseline Real Business Cycle model and its implementation in Dynare. In this video I show how to calibrate the model parameters in a sophisticated way using Dynare’s preprocessing capabilities. First, we cover some general ideas and tips how to calibrate the parameters of a DSGE model, focusing on the RBC model with leisure. Then I show how to accomplish this in Dynare either directly or, a more advanced way, by modularizing your mod file and changing the type of variables and parameters. Once you start working with large-scale models, this modularization technique will make your models much more tractable.

Video

Timestamps

General ideas and tips

Simple (but not powerful) implementation in Dynare in parameters block

Advanced (and powerful) implementation in Dynare using modularization, change_type, save_params_and_steady_state

Outro & References

Slides

Presentation

Codes

rbc_nonlinear_symdecls.inc

v ; m ; v ; p ; a o a a r y c k l a r w i m @ w @ d u u u f f r e r B D G P @ E E @ A R v c # l # e c c l k l e p a E E A S # T T # L H i _ e l p x s m T L M I i A A e P O f y n _ o a e A T M f C L n H A d l t A A d A S i i o e L i $ $ $ $ $ $ $ $ $ T v f c $ $ $ $ $ $ r $ $ $ $ O $ $ f $ $ { { { { { { { { { E _ a { { { { { { s { { { { G { { { { Y C K L A R W I M A y l U E U f f \ \ \ \ \ U \ \ \ \ } } } } } } } } C D _ _ _ _ _ _ v b d g p T e e a r $ $ $ $ $ $ $ $ } Y k v t t t t t a e e a s I t t l h $ _ a ^ ^ ^ ^ r t l m i L a a p o y r C U L K L e a t m } I ^ ^ h ^ i } _ } } } p } a a $ T C L a A a $ { $ $ $ s $ } } Y } } } } b t i $ $ $ $ $ $ l + l ! e 1 o ( ( ( ( = ( ( ( ( } n l l l l l l l l ( ( ( ( ( ( ( ( ( ^ ^ o o o o 1 o o o o l l l l l l l l l C A n n n n n n n n o o o o o o o o o } } g g g g g g g g n n n n n n n n n $ $ _ _ _ _ _ _ _ _ g g g g g g g g g n n n n n n n n _ _ _ _ _ _ _ _ _ a a a a a a a a n n n n n n n n n m m m m m m m m a a a a a a a a a ( e e e e e e e e m m m m m m m m m l = = = = = = = = e e e e e e e e e o ' ' ' ' ' ' ' ' = = = = = = = = = n D D C L R I O D ' ' ' ' ' ' ' ' ' g i e o a i n u i o c c l p i w i m _ s p n b s v t s u o a a r n a n a n c r s o k e p c t n p b o t g v r a o e u r r u o p s i o d e e e g m u c m A s t u u u t r u r ' s i e n i p D v e n t m a ' c e ) t n = t a t i e E t ' p l ) t s m a ' t i s r F l ) t ' i t e l P F i o u s r a F i ) v n r a o n t i i s a o i R t C o c n i o s t c n t a ' o d t U l n c i t ' y t ) s u o R t i ' h c o ) ' e t c r a i t ) i r ) ' s t ' t l y E t ' ) ' i ) e i l y ) ) v ' t W a i ) y e s o t i t f y W g i e h c C S i t i a h g ' t p o h ) y i c t ' t k ' ) a ' ) l ) ' )

rbc_nonlinear_modeqs.inc

m % @ @ @ % # # [ u [ w [ k [ y [ y [ m [ w [ r [ l @ w i k @ e o m # # # m f f n c n n n n n c n n n o # l v _ # n d a i # # # e # # # e a k l a a = a = a = a = a a = a = a g i _ _ y e d e r f u u u l u u u n r m = m m m m m = m m m ( f y y n ; l g c c l s c c l d g = = e e - e ( e c e a e e m e m e a d ; i L p e p i i = B = u = 1 = = * = 1 = c = c = ) S = = = i n O = = f n A ( ' E ' l ' - ' + ' k ' ; ' * ' * ' T f a G = = a L 1 i T l c D m p ( m l f c f t = E w i k l U = - = - l P - n A a u a E a i r - a a l a k o A * v ( T G P G P H A t * b c p L r v o 1 r b ; p ; t R D l - u I A G S A G S p A L e u o ; i T k ; d ) g o i a H Y y 1 t L M A I M A I r * P r c r t A e u ^ i r t l O y ; ) i I M M * M M * o y H t p a ) t c A n a A ; / l T A M ( A M ( d / A e * s l * t L a d l f * y i Y * A 1 * A 1 u k ) m ( u k c i P l e a l ; t c * - c * - c ( * p 1 p a ( l o H m d c o y = ^ c l ^ c l t - y o - p c - e n A c a e t g = ( ( ) ( ( ) s 1 / r D l c 1 a * o n m o ( o - + ^ - + ^ ) l a E y u ) r f l s d a r a f 1 1 1 ( E 1 ( o ; ; l L ' m i u ^ t ' n ( ) ) - T ) - f T ] u + n n ( s ] d p - c ; ^ 1 A ^ E o A l g c 1 ' ' r 1 o ( ) C ( T p p + a i ' t - ] ] o ) n - ; ) - A r t r t v ] i A d ) s 1 ; E L o i ( i ; o L u u ) T ) d m + o n P c + m ; A ; u a 1 n ' H t p C c l ) ' ] A i e t ) t i ) ] ) v p i ; i t ; ; i s o o y t a n n y ; ( ' a E ] n u d l e l r a ) b ' o ] r

rbc_nonlinear_steady1.mod

@ @ @ @ % % % A B D R G P E E s a m r K w I Y C l c y i k w i k e s s # # # # L E E H A S T T t c _ V _ _ v l v _ n t a d d i i E P T L O M I A A e = = L = _ L L = _ _ y d e v e e n n a H A T A M C L a = L = = = = y y ; a e f f c c s A A A d 1 1 = m = = G = d _ i i l l i y ; 1 / c = A C Y I K = = y p n n u u e = = = = = = = = _ ; B ( * a Y M _ _ V _ k ; a e e d d s s E m ( D * _ M L L _ L w i / r e e t 0 0 0 0 1 1 1 1 t T c 1 E ( L A * L * * y a L S . . . . ; ; ; ; a A * - L K l l * l l ; m O T " " M 3 9 0 9 t A A T _ - P ; ; l ; y s G E r r o 3 9 2 ; e + L L A L S ; y ; _ U A b b d ; ; 5 _ P P * ) I I ; a T D c c e ; m D H H K ^ V * n I Y _ _ l o E A A _ A _ C d L n n : d L * ) L L L _ _ I = o o e T a ; P ; L s T n n l l A a H ^ t Y 1 l l o ; r * A ( e i i g - ) K ; - a = n n 1 ^ _ 1 d e e u ; ( L ) y 0 a a t 1 * _ r r i / A w s _ _ l ( L / t s m i 1 P ( a y o t - H 1 t m d y A A + e d e L ; G ( e q % % % P A ' c s H M r l . A M b s i ) A c . n ) / _ i c ; P n n " S o c I n " * l C i _ n L e ^ a ( r - _ 1 s ) t * e w a ) d ; y 1 . t x t ' ) ;

rbc_nonlinear_steady2.mod

@ @ @ c c @ l s s s s s s s s # # # h h # o e e e e e e t a d d i a a i a t t t t t t e v e e n n n n d _ _ _ _ _ _ a e f f c g g c _ p p p p p p d _ i i l e e l p a a a a a a y p n n u _ _ u a r r r r r r ; a e e d t t d r a a a a a a r e y y e a m m m m m m a L S p p m _ _ _ _ _ _ m O T " e e " s v v v v v v s G E r ( ( r _ a a a a a a _ U A b p v b a l l l l l l a T D c a a c n u u u u u u n I Y _ r r _ d e e e e e e d L n a ) n _ ( ( ( ( ( ( _ I = o m o s ' ' ' ' ' ' s T n e P n t E E l w i k t Y 1 l t S l e T T ' l v _ e i e I i a A A , _ _ y a = n r n d C L 1 y y ' d e s A e y ' ' / ' ' , y 0 a ) L a _ , , 3 , , 1 _ r P r s 2 1 ) 0 0 0 s _ l H _ t ) . ; . . ) t s A m a ; 5 6 2 ; a y w o t ) 5 5 t m l D d e ; ) ) e d _ E e ( ; ; ( e y L q ' ' c T s r r l i A . b b s v i c c . _ B n _ _ i y E c n n n T " o o c k A n n " _ ; l l y i i ; n n e e a a r r _ _ s s t t e e a a d d y y 1 2 . . t t x x t t ' ' ) ) ; ;

rbc_nonlinear_final.mod

@ @ @ @ l s s v e s # # # # o t h a n t d d i i a e o r d o e e n n d a c ; c f f c c _ d k e h i i l l p y s p _ n n u u a ; ; s s e e d d r a i e e a m L S m = u O T " " s l G E r r _ 0 ( U A b b a . o T D c c n 0 r I Y _ _ d 0 d L n n _ 1 e I = o o s ; r T n n t = Y 0 l l e 1 i i a ) = n n d ; e e y 0 a a _ r r s _ _ t s m a y o t m d e d e ( e q ' c s r l . b s i c . n _ i c n n " o c n " l i n e a r _ s t e a d y 2 . t x t ' ) ;