Turn on suggestions

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

Showing results for

- Home
- /
- Programming
- /
- Developers
- /
- Proc nlin method

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 07-14-2016 10:05 AM
(1534 views)

Hey, when excuting proc nlin in SAS 9.3 and SAS enterprise guide 5.1 stored process using method Marquardt, I got two different iteration result. I am wondering was this really because my setting or ther is potential difference between this two platform for running proc nlin using Gauss or Marquardt methods?

Thank you!

Herbman

1 ACCEPTED SOLUTION

Accepted Solutions

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

One system is 64-bit Linux. The other is 32-bit Windows. These systems use different compilers, compiler optimization flags, possibly different linear algebra BLAS and vendor-supplied math libraries,.... and the list goes on. Numerically speaking, there is no reason to expect that these systems will give exactly the same answers to a complex optimization problem.

I don't follow what you are trying to accomplish statistically, but if you are using the results of a previous run to provide initial estimates for a subsequent run, then these little differences can add up.

Based on what you've told me and what I've inferred, I don't see any way to guarrantee that the results are exactly the same for both runs. Check the Iteration History to see how/when the optimizations diverge from each other.

6 REPLIES 6

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

Enterprise Guide 5.1 is just an interface that submists SAS programs to whatever SAS server it is connected to. Thus the real issue is what version of SAS id running the code (assuming that the data is the same).

You can submit the following SAS code and then view the Log to see the version of SAS that is running on the server:

```
%put SYSVLONG = &SYSVLONG;
```

You'll see something like

SYSVLONG = 9.03.01M2D082312

which is interpretted as SAS 9.3, maintenance 2.

Since you are getting different behavior, you will presumably find that you are comparing two different versions of SAS. Each version is SAS is compiled using potentially different compiler versions and compiler optimizations. It is not unusual to see slightly different results as the result of a statistical optimization problem (which PROC NLIN solves).

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

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

Well, if it's not the SAS version, then it must be the operating system or the bitness of the OS. Submit:

```
%put SYSSCP= &SYSSCP;
%put SYSSCPL = &SYSSCPL;
```

I'm guessing that you'll either see Windows vs Linux or 32-bit vs 64-bit.

The bigger issue is what to do about the problem. Look at the iteration history table to see why it is not converging. (If there is no iteration history, make sure that the NOITHIST option is not used.)

Some reasons why the convergence problems can occur are

1) The sample size of the data is small

2) The model does not fit the data

3) The initial guess for the parameters is not good

There's not a lot you can do about (1). (2) is a modeling problem. For (3) try using the optimal values for the program that converges as initial values on the PARMS statement in the program that does not converge. This should help the second program converge to the same optimal solution. You can also specify a grid of parameter values, if necessary.

If all this fails, look at the "Troubleshooting" section of the doc.

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

Hi Rick,

Thank you. Yes, I ran the two macro and the sas server information is:

SYSSCP= LIN X64

SYSSCPL = Linux

and my local sas is:

SYSSCP= WIN

SYSSCPL = W32_7PRO

and when the 5 parameter proc nlin code run (based on previous 4 parameter code):

proc nlin data=nlinready outest=est5 method=marquardt maxiter=**32000** maxsubit=**100**;

by byval;

parms / pdata=initialval5;

bounds c5>**0**;

model rlu=c1+(c2-c1)/(**1**+exp(-c3-c4*log(dose)-c5*dose));

_weight_=**1**/rlu****2**;

ods output parameterestimates=params5 anova=stats5 convergencestatus=converge5;

run;

quit;

I noticed the number of observation difference of output EST5 between the server and local sas. and output data params5 has 5 obs and 9 variables in local SAS and 6 obs and 10 variable and 10 variables as indicated by the uploaded files (original is server log and the revision is local sas log).

Any further suggestions to make them consistent?

Thank you very much!

Herbman

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

Now the real concern is the inconsistence between the server and local sas, as I replied below. Thank you!

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

One system is 64-bit Linux. The other is 32-bit Windows. These systems use different compilers, compiler optimization flags, possibly different linear algebra BLAS and vendor-supplied math libraries,.... and the list goes on. Numerically speaking, there is no reason to expect that these systems will give exactly the same answers to a complex optimization problem.

I don't follow what you are trying to accomplish statistically, but if you are using the results of a previous run to provide initial estimates for a subsequent run, then these little differences can add up.

Based on what you've told me and what I've inferred, I don't see any way to guarrantee that the results are exactly the same for both runs. Check the Iteration History to see how/when the optimizations diverge from each other.

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. **

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.