Statistical programming, matrix languages, and more

IML code problem

Reply
New Contributor
Posts: 2

IML code problem

 We are students from Taiwan.While practicing SAS, we met some problems on coding IML.

We could not figure out the solution.

The attachment is our code.

The system keeps showing ERROR,but we don't know why.

And we couldn't fix it.

Hope any hero can find the mistake in our coding , and give us some hint. We look forward to receive reply.

Grand Advisor
Posts: 9,335

Re: IML code problem

It looks like you are doing Maximize Likelihood Estimate.

But your code is not completed and you don't give us a sample data to test your code yet ?

And what is your ERROR information ?

Grand Advisor
Posts: 9,335

Re: IML code problem

Check Rick's blog , might give you some clue how to do MLE .

 

http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml.html

New Contributor
Posts: 2

Re: IML code problem

We have already read this website. And referred the code to write our code.  

We guess the attachment code we writed main problem appears in the following part.

 

print Param[c={"R0" "B" "lambda" "simga"} label=""] LogLik;

p = param[1,];
print p;
f = LogLik(p);
print f;
print Param[c={"R0" "B" "lambda" "simga"} label=""] LogLik;

 

In addition, we don't use date to test .

We just use sas to run and revise our code.

We want to make sure our code is correct first.

If possible, wish you could give us more direction to revise our code again.

 

Grand Advisor
Posts: 9,335

Re: IML code problem

As I said before, Your code is not completed. It is hard to say something without any data to test.

And you event don't post the ERROR information.

 

Here I found a problem :

1)you have 4 parameter, but you only initiate 2 (p=......)?

2)in your function X have 4 columns, But you only read 2 columns. That is not right.

Grand Advisor
Posts: 9,335

Re: IML code problem

Your CON Matrix is not completed. 

Should look like :

 

con = { 0 0 0 0, 
        . . . .};
Post a Question
Discussion Stats
  • 5 replies
  • 397 views
  • 0 likes
  • 2 in conversation