starting values for grid search in a MLE

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

newbee
Posts: 5
Joined: Wed Jul 07, 2010 12:28 am

starting values for grid search in a MLE

Postby newbee » Tue Jul 13, 2010 2:22 am

Dear moderators,
I need your help in performing a grid search by going through different starting values for the parameters, performing a ML estimation and recording the output. So far I managed to write a program performing one ML estimation for given starting values of the parameter and store the output I need.
It looks like this:

logl ll1
param c(1) 0.1 c(2) 0.5
ll1.append @logl logll1
ll1.append value1=0.5*(0.5)^c(1)-ce1^c(1)
ll1.append value2=-0.5*(0.5)^c(2)+(-ce2)^c(2)
ll1.append q1=exp(value1)/(1+exp(value1))
ll1.append q2=exp(value2)/(1+exp(value2))
ll1.append logll1=y1*log(q1)+y2*log(q2)+(1-y1)*(1-log(q1))+(1-y2)*(1-log(q2))
ll1.ml(showstart)
matrix coef=ll1.@coefs
matrix logl=ll1.@logl

Now I am facing the problem that in the program line defining the starting values of the parameters (param c(1) 0.1 c(2) 0.5) I cannot write anything else but a number. With this limitation I cannot perform a grid search. Any ideas how to solve this problem?

Thank you in advance for your help!

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: starting values for grid search in a MLE

Postby EViews Glenn » Tue Jul 13, 2010 9:16 am

You don't have to define the param values using a param statement inside of the logl.

Simply modify the values of the corresponding elements of the C vector just before estimating the logl.

newbee
Posts: 5
Joined: Wed Jul 07, 2010 12:28 am

Re: starting values for grid search in a MLE

Postby newbee » Tue Jul 13, 2010 12:28 pm

How can I tell EViews to perform the replacement automatically, i.e. by using a grid of values (e.g. for example by using 20 points from 0 to 3 for each of the parameters)?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests