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

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Parms statement in nlmixed

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

05-04-2018 09:53 AM

I was using the Proc NLMIXED for estimating my model using poisson and negative binomial model. The results change drastically when using the parms statement and assigning initial values. On what basis do we define the initial parameters in the Parms statement? We run the model for the estimation of those coefficient so how do we initially guess the values?

Any help would be greatly appreciated.

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

Posted in reply to Unay13

05-04-2018 02:34 PM

Post your code. There are many ways:

- Sometimes we have domain knowledge or historical knowledge that helps us make an informed guess.
- Sometimes we can solve a closely-related linear system (which does not require an initial guess) and use the solution to the linear system as an initial guess for the nonlinear system.
- In low dimensions (three or fewer parameters) you can use graphical methods to make an initial guess
- You can use grid-based methods up to about 6 or 8 dimensions.
- You can use the method of percentiles or the method of moments to obtain an initial guess when you are fitting the parameters of a probability distribution.

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

Posted in reply to Rick_SAS

06-16-2018 02:45 PM

This is the code:

proc NLMIXED data = work.spf;

mu=beta_0 +(beta_1/((1+ beta_2*(maj)**(-beta_3))*(1+ beta_4*(min)**(-beta_5))));

NBLL = (lgamma(tot+(1/k)) - lgamma(tot+1) - lgamma(1/k)+ tot*log(k*mu) - (tot+(1/k))*log(1+k*mu));

model tot ~ general (NBLL);

run;

When I assigned mu as a different function with three parameters to be estimated the model converged. The first three solutions you provided are not applicable as I have less knowledge regarding what the parameters should be and there are 7 parameters. Also, I am not much familiar with the method of moments or grid based methods.

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

Posted in reply to Unay13

06-16-2018 03:03 PM

Please specify a PARMS statement. Without it, we have no way of knowing which symbols are parameters and which are parameters in the data. For example, I assume the betas are parameters. What about k, tot, min, and maj? Are there any notes or warnings in the SAS log? How many observations in the data set?

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

Posted in reply to Rick_SAS

06-16-2018 03:37 PM

Thank you for the response and I apologize for not being clear.

I have defined the PARMS statement below with the default values.

proc NLMIXED data = work.spf;

PARMS beta_0=1 beta_1=1 beta_2=1 beta_3=1 beta_4=1 beta_5=1 k=1;

mu=beta_0 +(beta_1/((1+ beta_2*(maj)**(-beta_3))*(1+ beta_4*(min)**(-beta_5))));

NBLL = (lgamma(tot+(1/k)) - lgamma(tot+1) - lgamma(1/k)+ tot*log(k*mu) - (tot+(1/k))*log(1+k*mu));

model tot ~ general (NBLL);

run;

The Betas and K are the parameters. There are 198 observation. tot is the dependent variable and maj and min are the independent variables.

Any help regarding the initial parameters would be highly appreciated.

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

Posted in reply to Unay13

a month ago - last edited 3 weeks ago

I'd try a grid of values, and also supply bounds for any parameters that I know are positive or otherwise constrained. Use domain knowledge to choose reasonable values for the parameter guesses. The example below indicates how to choose a grid of values. The numbers are just made up since I know nothing about your data or experiment.

PARMS beta_0=-1 0 1

beta_1=0.1 1 10 100

beta_2=-2 0 2

beta_3=10 100

beta_4=10 100

beta_5=1 2

k=1;

BOUNDS k > 0;

For more information about choosing a grid of values, see "Use a grid search to find initial parameter values for regression models in SAS"

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

Posted in reply to Rick_SAS

a month ago

Thank you for the help. I did try guessing the initial parameters based on other similar models. The model does converge but I get null values or blank spaces in parameter estimates standard error, t Value, confidence limit and P value. What could possibly be the reason for that? These are the notes and warning in Log:

NOTE: Convergence criterion (GCONV=1E-8) satisfied.

NOTE: At least one element of the gradient is greater than 1e-3.

NOTE: Moore-Penrose inverse is used in covariance matrix.

WARNING: The final Hessian matrix is full rank but has at least one

negative eigenvalue. Second-order optimality condition violated.

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

Posted in reply to Unay13

3 weeks ago

There are several reasons, but the two most likely are

1. The model does not fit the data.

2. You are using variables that are linearly dependent. For example, if you include a binary indicator variable for "Males" and also include an indicator variable for "Females," the two variables are not independent and the covariance matrix is singular.