Finite sum

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Finite sum

Postby ewoudq » Tue Feb 09, 2010 3:37 pm

Hi everyone

I would like to enter a finite sum in a dynare .mod file, but I don't now the syntax. I've enclosed the formula I want to use. Can anyone help me?

Thanks in advance

Ewoud
Attachments
Formule eindige som.pdf
Formula I want to use
(286.5 KiB) Downloaded 250 times
ewoudq
 
Posts: 4
Joined: Tue Feb 09, 2010 3:22 pm

Re: Finite sum

Postby AssiaEzzeroug » Wed Feb 10, 2010 7:57 am

Hi,

u can use the dynare macro language for that, try the following syntax

Code: Select all
//at the beginning of the mod-file
@# define k = 1 
@# define K = NumberofLags

//inside the block model
...=1/H*(
@#for k in 1: K
       + omega_@{k}*(p(@{-k})-px(@{-k}))^2
@#endfor
)
;


Hope this helps,

Best
AssiaEzzeroug
 
Posts: 83
Joined: Tue Nov 24, 2009 3:48 pm

Re: Finite sum

Postby ewoudq » Fri Feb 19, 2010 7:55 pm

Thank you!

The model works now, but only partially because not all variables have the expected values.
For instance "etax" en "etaf" take on the value zero for all time periods, while they should alway sum up to one. Can someone help me with this? Any suggestions?

With Regards
Attachments
heuristics.mod
(1.02 KiB) Downloaded 170 times
ewoudq
 
Posts: 4
Joined: Tue Feb 09, 2010 3:22 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests