BookmarkSubscribeRSS Feed
Joe_GM
Calcite | Level 5

Does anyone have experience with a SAS optimizer to support fitting of complex, multi-stage (several data steps and procs), non-linear function fitting? This would presumably be written in macro language. I'm on SAS 9.4.

7 REPLIES 7
PaigeMiller
Diamond | Level 26

@Joe_GM wrote:

Does anyone have experience with a SAS optimizer to support fitting of complex, multi-stage (several data steps and procs), non-linear function fitting? This would presumably be written in macro language. I'm on SAS 9.4.


When you say "a SAS optimizer", do you have a particular optimizer in mind, or particular optimization function in mind?

--
Paige Miller
Joe_GM
Calcite | Level 5

I am looking to adjust a set of input parameters to fit a set of outputs to closely match required values. I would expect this to be achieved by minimising e.g. a sum of squared differences. I would be looking to use this for a variety of different 'models'.

PaigeMiller
Diamond | Level 26

@Joe_GM wrote:

I am looking to adjust a set of input parameters to fit a set of outputs to closely match required values. I would expect this to be achieved by minimising e.g. a sum of squared differences. I would be looking to use this for a variety of different 'models'.


There are many procedures in SAS that minimize the sum of squared differences. Why do you need to build your own?

--
Paige Miller
Joe_GM
Calcite | Level 5

All the examples that I've seen express the model within a single procedure. My models involve several DATA and PROC steps. Can any of the SAS optimizers handle such a model?

PaigeMiller
Diamond | Level 26

Please be specific about what you are doing.

--
Paige Miller
Joe_GM
Calcite | Level 5

The input parameters are part of a correlation matrix which is fed into PROC COPULA:

 

proc copula;
    var randomfactor1 randomfactor2 randomfactor3 randomfactor4;
    define cop normal (corr = correlmatrix);
    simulate cop / ndraws = %eval(&numsims.*&numtimesteps.)
                   seed = &seed.
                   outuniform = simcopula
                   plots = (datatype=original); 
run;

 The output simulations are merged with a set of rates, using the random factors to calculate sets of rates over the numtimesteps for each of the numsims.

After several data steps and another merge an output correlation is calculated:

proc corr data=rates_forcorr out=rates_corr_mtx;
    var infYield&termyears. infYield1 realYield&termyears. realYield1;
run;

These output correlations are required to match desired values.

PaigeMiller
Diamond | Level 26

Well, at the start you asked if anyone has experience with this, and I have to admit I don't have experience with this type of analysis.

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 887 views
  • 0 likes
  • 2 in conversation