Turn on suggestions

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 03-09-2018 08:16 AM
(776 views)

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

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

4 REPLIES 4

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

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

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

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

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.