SAS Optimization, and SAS Simulation Studio

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

- Subscribe to 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Wednesday

Dear Friends,

We are estimating a non-linear model that has the following form:

w_ret = (1 - rho*(sigma_T/sigma_F))*w_uepp + ((sigma_T*sqrt(1 - (rho**2)))/sigma_Z)*w_tq + c1*w_mret + c2*w_mcap + c3*w_bm + c4* w_agro + c5*w_op_prof

The model has 8 parameters: sigma_T, sigma_Z, rho, c1, c2, c3, c4, and c5.

A ninth parameter sigma_F is set to equal a constant 1.

There are 7 variables: w_uepp, w_tq, w_mret, w_mcap, w_bm, w_agro, w_op_prof

sigma_T and sigma_Z are variances and hence constrained to be strictly positive. Rho is a correlation and hence constrained

to lie between -1 and +1.

We set up the program as a least squares minimization problem. The code is below and the input file is provided as an attachment. It has 100 observations.

We use the nlp solver under proc optmodel and the sas code is below. Under NLP, we have included the multistart option, bndrange = 50, and an arbitrary and constant seed. Also, we have provided initial values for the 8 parameters.

Our challenge is that each time we run the program, we get different values for the parameter estimates, sometimes wildly different. This is despite not changing anything in the code. Interestingly, the value of the objective function at the minimum remains the same for each run.

We seek your kind help in answering the following questions:

1. How can we ensure that we get the same parameters for each run?

2. Does SAS use our initial values in some manner? How do these values interact with the multistart option?

3. What are some things we can do to ensure a global minimum? Because we get different estimates in each run, it feels like we are hitting a local minimum.

4. Is there a way in SAS to generate values of the objective function for a combination of parameters, so that I can graph a 3D plot and thus provide a better set of starting values?

5. In some cases, one of our parameters, rho, has an estimate of 1, which is a corner solution. How can we calculate standard errors in this case.

Thanks so much for your help! I had posted this yesterday and it got deleted somehow. Hence I am posting it again.

Site and O/S informations are as follows:

Site: 70055201 Release: 9.04.01M4P110916 System: LIN X64 Linux

best,

Srini

options ls = 132 ps = 2000 nodate nocenter; data fiireg; infile 'sample.prn'; input ccode $ & 1-10 w_uepp w_tq w_ret w_bm w_mret w_op_prof w_agro w_mcap; proc sort; by ccode; data fiireg; set fiireg; by ccode; proc means; proc optmodel; set alldata; num w_ret{alldata}; num w_uepp{alldata}; num w_tq{alldata}; num w_mret{alldata}; num w_mcap{alldata}; num w_bm{alldata}; num w_agro{alldata}; num w_op_prof{alldata}; num mycov{i in 1.._nvar_, j in 1..i}; number sigma_F = 1; read data fiireg into alldata = [_n_] w_ret w_uepp w_tq w_mret w_mcap w_bm w_agro w_op_prof; var sigma_T init 0.92, sigma_Z init 0.001, rho init 0.1, c1 init 0.8, c2 init 0.3, c3 init 0.05, c4 init 0.05, c5 init 0.05; impvar Err{i in alldata} = w_ret[i] - (1 - rho*(sigma_T/sigma_F))*w_uepp[i] - ((sigma_T*sqrt(1 - (rho**2)))/sigma_Z)*w_tq[i] - c1*w_mret[i] - c2*w_mcap[i] - c3*w_bm[i] - c4* w_agro[i] - c5*w_op_prof[i]; min f = sum{i in alldata} Err[i]^2; con a: rho >= -1; con b: sigma_T >= 0; con c: sigma_Z >= 0; con d: rho <= 1; solve with nlp / tech = ip multistart = (bndrange = 50) msnumstarts = 100 covest = (cov = 5 covout = mycov) seed = 9730696; print mycov; print sigma_T sigma_Z rho c1 c2 c3 c4 c5;

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

Posted in reply to srinirangan123

Thursday

I want to add to my coauthor Srini's question above. From https://support.sas.com/resources/papers/proceedings13/158-2013.pdf we find

**"RECURSION The uniform sampling, starting-point selection, local optimization, and sample-point update steps are repeated in sequence until either no sampled points are selected or the maximum number of local optimizations (specified via the MSMAXSTARTS= parameter) has been completed. At termination the algorithm reports the best local minimum that it has found."**

1. Does this mean that any set of initial values given is over-ridden by SAS when we invoke the switch "ms."

2. This note above refers to "msMAXstarts" while Srini has used "msNUMstarts." Does that make any difference, or explain anything?

3. If starting values are generated by SAS on its own, with the uniform random number generator, and if subsequent starting points depend on initial (randomly selected) starting points, it leads to the **scary instability of the same data, code, and machine, leading to different estimates on subsequent runs.** Is there some way of overcoming this?

4. Must we just keep increasing the value of the parameter in msnumstarts or msmaxstarts till successive runs yield the same answer? This is not a previously solved problem, so there is no easy way to tell a priori if msnumstarts or msmaxstarts = 100 or 1000 is large enough.

5. Is there some way to **make SAS take a list of starting points we give it**, and use those in PROC OPTMODEL? Our reading is that whatever init values are specified are simply ignored. If they are used, and they don't change from one run to the next, getting different estimates each time is a huge drawback. Please help. Thank you.