BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
acordes
Rhodochrosite | Level 12
For an sales incentive system I'd like to model a sigmoid function that repeats periodically and increases thereby by a step function.
Any idea?
An approximation is okay for me as I'm aware of the fact that the sigmoid input ranges from minus infinity to plus infinity and that the function is convergent towards 0 and 1.
1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

I guess you mean that it is a sigmoid on each periodic domain and overall it is a monotonic nondecreasing function.

 

The main thing you need to do is identify a base function and the domain of periodicity.  I have chosen the base function to be 

f(x) = (1 - cos(pi*x)) / 2  for x in [0, 1]

which is a monotonic function that has the range [0, 1].

You can then extend the base function by adding a step function to it.

 

One step function is s(x) = floor(x). 

 

/* The base function has domain [0, 1] and also range [0, 1].
   The base function is
   f(x) = (1 - cos(pi*x)) /2
*/
data PeriodicSigmoid;
   pi = constant('pi');
   do x = 1 to 6 by 0.01;
      z = x - floor(x);     /* z is always in [0,1] */
      y = floor(x) + (1 - cos(pi*z)) /2;  /* add step function to base function */
      output;
   end;
run;

proc sgplot data=PeriodicSigmoid;
   series x=x y=y;
   xaxis grid;
run;

 

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

I guess you mean that it is a sigmoid on each periodic domain and overall it is a monotonic nondecreasing function.

 

The main thing you need to do is identify a base function and the domain of periodicity.  I have chosen the base function to be 

f(x) = (1 - cos(pi*x)) / 2  for x in [0, 1]

which is a monotonic function that has the range [0, 1].

You can then extend the base function by adding a step function to it.

 

One step function is s(x) = floor(x). 

 

/* The base function has domain [0, 1] and also range [0, 1].
   The base function is
   f(x) = (1 - cos(pi*x)) /2
*/
data PeriodicSigmoid;
   pi = constant('pi');
   do x = 1 to 6 by 0.01;
      z = x - floor(x);     /* z is always in [0,1] */
      y = floor(x) + (1 - cos(pi*z)) /2;  /* add step function to base function */
      output;
   end;
run;

proc sgplot data=PeriodicSigmoid;
   series x=x y=y;
   xaxis grid;
run;

 

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
  • 1 reply
  • 544 views
  • 0 likes
  • 2 in conversation