I am trying to write code to solve problem 5 chapter 16 of Greene's Econometric Analysis 6th edition. I have a single sample has the weibull distribution. Gauss keeps telling me that my alpha and beta are unidentified.
However, I'm not sure what I am doing wrong. I have the solution to the problem but I want to run the code to see if I get the correct result. Here is my code:
load data[20,1] =C:\Users\Assma\Desktop\GAUSS\HW3Data.txt; x=data[.,1]; //initializing global variables beta>0; alpha>0; n=rows(data); proc f(x); local fcn; fcn=n*ln(alpha)+n*ln(beta)+(beta-1)*sumc(ln(x))-alpha*sumc(x^beta); retp( -sumc(fcn) ); endp;
1 Answer
0
Are you meaning to assign alpha and beta to be equal to zero? If so, you need to change these two lines:
//initializing global variables beta > 0; alpha > 0;
to use the equals sign like this:
//initializing global variables beta = 0; alpha = 0;
Making this change will remove the error you are reporting.
The code as you originally had i.e (beta > 0;) is evaluating whether beta is greater than zero. It will return a 1 if beta is greater than zero or a 0 if not. However, in this case since they were not assigned, it will just give the "Undefined symbol" error.
Your Answer
1 Answer
Are you meaning to assign alpha and beta to be equal to zero? If so, you need to change these two lines:
//initializing global variables beta > 0; alpha > 0;
to use the equals sign like this:
//initializing global variables beta = 0; alpha = 0;
Making this change will remove the error you are reporting.
The code as you originally had i.e (beta > 0;) is evaluating whether beta is greater than zero. It will return a 1 if beta is greater than zero or a 0 if not. However, in this case since they were not assigned, it will just give the "Undefined symbol" error.