Obsidian | Level 7

## beta sigmoid function for growth modelling

Dear,

I am trying to fit a beta-sigmoid function (cfr https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4244967/pdf/mcg029.pdf) as follows:

``````title 'beta-sigmoid';
proc nlin data=&lib..duration method=gauss;
parms wmax 500 tm 100 te 360;                         /* initial guess */
model LL= wmax*(1+((te-elapsedhours)/(te-tm)))*((elapsedhours/te)**(te/(te-tm))) ;
output out=ModelOut2 predicted=Pred lclm=Lower95 uclm=Upper95;
by potnumber;
run;``````

This model has the constraint that LL=wmax when t > te. t is here elapsedhours. Now I get a negative estimate for tm. How can I add this constraint?

Thanks,

Veronique

1 ACCEPTED SOLUTION

Accepted Solutions
Obsidian | Level 7

## Re: beta sigmoid function for growth modelling

my code is:

``````title 'beta-sigmoid';
proc nlin data=&lib..duration method=gauss;
parms LLmax 500 tm 100 te 360;                         /* initial guess */
if elapsedHours > te then value = LLmax;
else if elapsedhours=0 then value=0;
else value = LLmax*(1+((te-elapsedhours)/(te-tm)))*((elapsedhours/te)**(te/(te-tm))) ;
model LL= value ;
output out=ModelOut4 predicted=Pred lclm=Lower95 uclm=Upper95;
by potnumber;
run;``````

I still find negative values for tm. I do not see an error in my formula but maybe I am overlooking it.

6 REPLIES 6
Opal | Level 21

## Re: beta sigmoid function for growth modelling

Try

``````  if elapsedHours > te then value = wmax;
else value = wmax*(1+((te-elapsedhours)/(te-tm)))*((elapsedhours/te)**(te/(te-tm))) ;
model LL= value ;``````
PG
Obsidian | Level 7

## Re: beta sigmoid function for growth modelling

I believe the constraint refers to the estimated value of te. I already chose the starting value of te such that it is larger than t (elapsedhours). I tried the suggestion but now it failed completely.

Opal | Level 21

## Re: beta sigmoid function for growth modelling

Please show the SAS code you tried and the resulting log.

PG
Obsidian | Level 7

## Re: beta sigmoid function for growth modelling

Dear PG,

I added an extra constraint. My code is now:

NOTE: DER.LLmax not initialized or missing. It will be computed automatically.
NOTE: DER.tm not initialized or missing. It will be computed automatically.
NOTE: DER.te not initialized or missing. It will be computed automatically.
NOTE: PROC NLIN grid search time was 0: 0: 0.
NOTE: Convergence criterion met.
NOTE: The above message was for the following BY group:
potNumber=129

and the log:

NOTE: DER.LLmax not initialized or missing. It will be computed automatically.
NOTE: DER.tm not initialized or missing. It will be computed automatically.
NOTE: DER.te not initialized or missing. It will be computed automatically.
NOTE: PROC NLIN grid search time was 0: 0: 0.
NOTE: Convergence criterion met.
NOTE: The above message was for the following BY group:
potNumber=129

Obsidian | Level 7

## Re: beta sigmoid function for growth modelling

my code is:

``````title 'beta-sigmoid';
proc nlin data=&lib..duration method=gauss;
parms LLmax 500 tm 100 te 360;                         /* initial guess */
if elapsedHours > te then value = LLmax;
else if elapsedhours=0 then value=0;
else value = LLmax*(1+((te-elapsedhours)/(te-tm)))*((elapsedhours/te)**(te/(te-tm))) ;
model LL= value ;
output out=ModelOut4 predicted=Pred lclm=Lower95 uclm=Upper95;
by potnumber;
run;``````

I still find negative values for tm. I do not see an error in my formula but maybe I am overlooking it.

Obsidian | Level 7

## Re: beta sigmoid function for growth modelling

The problem was that I chose the wrong startvalue. This final code works and gives me the expected solution. Thanks PG!

Discussion stats
• 6 replies
• 1233 views
• 0 likes
• 2 in conversation