turn on suggestions

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

Showing results for

Find a Community

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-09-2018 08:16 AM

Hi!

I've found a model that I want to recreate for my masters thesis but the procedure is very imprecise. Essentially what I want is to find the implied probability (p) that is needed for a model to produce a certain outcome (A). In other words i want to send in some p

p = a*x + b*y where a and b are known.

So the optimization would roughly be:

1. Chose x and y

2. Calculate p and insert into the model

3. Compare result with desired outcome A

The authors just state that they use a grid search (something which i'm not familiar with) to achieve this and nothing more.

My main question is: is it possible to optimize a model like this when I'm treating the model itself as a "black box". Since the model is fairly complicated i think that if it is not possible I would try to "manually" produce code that tries a number of combinations of x and y and find the best fitted pair... although i'd prefer if there was a more elegant and simple way to achieve this.

I'm using SAS/IML.

Accepted Solutions

Solution

03-15-2018
05:06 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to jan_t_lagen

03-09-2018 09:50 AM

Yes, you can do this. Optimization methods don't care how the objective function is computed, and IML will compute numerical derivatives for you for any Newton-type optimizations.

Two issues that you might encounter:

1. In your example, p is the probability that depends on a and b. You will need to set constraints on a and b so that 0< p <1.

2. You don't seem to have any randomness (for example, a regression model with "noise"), but if the objective function is stochastic then the optimization algorithm will get close to the optimal value but then will "bounce around" because of the random terms.solution.)

Some articles for you to read:

Maximum likelihood estimation in SAS/IML

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to jan_t_lagen

03-09-2018 09:18 AM

You want P be maximize or minimize or a constant value.
All these could be done vi

Solution

03-15-2018
05:06 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to jan_t_lagen

03-09-2018 09:50 AM

Yes, you can do this. Optimization methods don't care how the objective function is computed, and IML will compute numerical derivatives for you for any Newton-type optimizations.

Two issues that you might encounter:

1. In your example, p is the probability that depends on a and b. You will need to set constraints on a and b so that 0< p <1.

2. You don't seem to have any randomness (for example, a regression model with "noise"), but if the objective function is stochastic then the optimization algorithm will get close to the optimal value but then will "bounce around" because of the random terms.solution.)

Some articles for you to read:

Maximum likelihood estimation in SAS/IML

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

03-19-2018 09:53 AM

Quick follow up question: is there a way to specify the number of iterations using "nlpnra"? I couldn't find any examples of it on the SAS forums.

It's not of great importance for me to get a perfect optimization so i would like to so how good it gets after a few step. further as there are some randomness in my objective function i fear this might make it hard to find a "perfect optimal solution"

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to jan_t_lagen

03-26-2018 04:40 PM

Yes. By default, NLPNRA iterates as many as 200 times, but you can set the first element of the termination criteria vector to a smaller value, such as 25. (tc[1]=25)