Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 04-24-2013 07:14 AM
(2847 views)

Hi,

I am working on the Klein-Spady semiparametric estimator.

I am trying to use call NLPNRA to generate a maximum likelihood estimate. IML gives an ERROR message saying that I am taking log of zero. But I checked the arguments in all the log commands, none of them is zero.

Below is the program and the error message. Thanks for your help.

ERROR: (execution) Invalid argument to function.

operation : LOG at line 296 column 45

operands : _TEM1008

_TEM1008 1 row 1 col (numeric)

0

statement : ASSIGN at line 296 column 1

traceback : module LOGLIK at line 296 column 1

ERROR: NEWRAP Optimization cannot be completed.

ERROR: The function value of the objective function cannot be computed at the starting point.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I don't understand what you are doing well enough to diagnose what is going wrong, but from the error messages I assume that the LINK variable is getting out of the open interval (0,1). If you put in the line

link = choose( link<=0 | link>=1, ., link);

then the algorithm converge. Unless there is a theoretical reason why a quantity cannot be less than zero, it's a good programming practice to protect against taking log(negative_value).

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

What are the meanings of your three parameters (for example, location, scale, or shape parameters). Are any of your parameters constrained? If so, see Step 2 in the article.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

thank you,

it's just a binary model, the parameters are not constraint and the initial values come from the proc logistic.

the module computes the log likelihood so i don't understand the problem

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I don't understand what you are doing well enough to diagnose what is going wrong, but from the error messages I assume that the LINK variable is getting out of the open interval (0,1). If you put in the line

link = choose( link<=0 | link>=1, ., link);

then the algorithm converge. Unless there is a theoretical reason why a quantity cannot be less than zero, it's a good programming practice to protect against taking log(negative_value).

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

thanks for this advice, it's work fine

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.