BookmarkSubscribeRSS Feed
csetzkorn
Lapis Lazuli | Level 10

I am trying to fit a logistic price demand curve like so:

 

ods select none;
proc nlmixed data=TrainingData;	
	bounds L > 100, Sd1 > 0, Parameter1 > 0, k > 0, var2 >= 0;
	parms  L = 101, Sd1 = 0.5, Intercept = 1.0, Parameter1 = 0.001, k = 2, pa1=18, b1 =0; 

	Parameter1 = pa1 + b1;
	Y = L / -k * exp(Intercept + Parameter1 * Price);
	model Demand ~ normal(Y, Sd1);
	random b1 ~ normal(0, var2) subject = ProductId;
	ods output
	Parameters = Parameters
	FitStatistics = ModelFit
	;
run;
ods select all;

This code is just a starting point! I played around with some parameters in Excel and found some OK-ish ones, which I provided as starting parameters. Unfortunately, the algorithm does not change the provided parameters when I inspect dataset Parameters (created using Parameters = Parameters). I doubt I chose the optimal parameters - so I would expect the parameters in the dataset Parameters to be adjusted. Is there something wrong with the above, which prevents the parameters from being changed? Thanks!

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Unfortunately, the algorithm does not change the provided parameters when I inspect dataset Parameters.

 

I'm not really sure what you mean by this. I'm not sure what you mean when you say "I Inspect dataset parameters". Could you be much more specific?

 

It is possible the algorithm can't iterate from this starting position, and so the parameters don't change.

--
Paige Miller
csetzkorn
Lapis Lazuli | Level 10
Hi PaigeMiller,

Thanks for the reply. i adapted the original post. There is a dataset Parameters, created by Parameters = Parameters. I would expect the content to be different to the provided starting values. I do not receive an error message/warning, which tells me that 'the algorithm can't iterate from this starting position'.
PaigeMiller
Diamond | Level 26

Does the results show any iteration history, or number of iterations?

--
Paige Miller
csetzkorn
Lapis Lazuli | Level 10

The problem is this line:

 

Parameter = Parameters

 

I had to be changed to:

 

ParameterEstimates = Parameters

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1454 views
  • 0 likes
  • 2 in conversation