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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 381 views
  • 0 likes
  • 2 in conversation