How can I implement an s-curve function in excel?
-
How can I implement an s-curve function in excel? I have some programming experience, but my maths is crap. I want a generic function to use to to effect a smooth transition between two numbers. Asigmoid funtion seem useful. I have read throught these pages : http://en.wikipedia.org/wiki/Sigmoid_function http://www.computing.dcu.ie/~humphrys/Notes/Neural/sigmoid.html But my poor math skills stop me from implementing it. I do not understand how to transfer the equations I see in to code, or excel. Much of the problem is I can't properly read and understand the notation used in math functions. I did ask in an IRC math channel, but several people laughed. If someone could show me how to implement the sigmoid function in excel, it would help me learn. Thanks
-
Answer:
I set up two columns, seems to work: A B 1 -6 | =1/(1+EXP(-A2)) 2 -5 | =1/(1+EXP(-A3)) ... (Fill down)
matholio at Ask.Metafilter.Com Visit the source
Other answers
Oops, let's try that again A B 1 -6 =1/(1+EXP(-A1)) 2 -5 (fill down) 3 -4 4 -3 5 -2 6 -1 7 0 8 1
0xFCAF
Depending on what you need to use it for, I would suggest a hermite curve interpolation instead of using the sigmoid (although that would work too). I guess you do it in Excel something like A4+(-2*C4*C4*C4+3*C4*C4)*(B4-A4) Where A4 has a, B4 has b, and C4 has t. Then you would be interpolating smoothly from a to b as t went from 0 to 1. The thing you have to watch out for with the sigmoid is that it doesn't go from 0 to 1, so it could be harder to work with.
demiurge
There is a http://www.xlxtrfun.com/XlXtrFun/XlXtrFun.htm that does this nicely. It's free, give it a try.
Eringatang
You can see the curve of the cubic equation that my earlier formula is using (-2t^3 + 3t^2) http://fooplot.com/index.php?&type0=0&type1=0&type2=0&type3=0&type4=0&y0=-2*x*x*x%20%2B%203*x*x&y1=&y2=&y3=&y4=&r0=&r1=&r2=&r3=&r4=&px0=&px1=&px2=&px3=&px4=&py0=&py1=&py2=&py3=&py4=&smin0=0&smin1=0&smin2=0&smin3=0&smin4=0&smax0=2pi&smax1=2pi&smax2=2pi&smax3=2pi&smax4=2pi&thetamin0=0&thetamin1=0&thetamin2=0&thetamin3=0&thetamin4=0&thetamax0=2pi&thetamax1=2pi&thetamax2=2pi&thetamax3=2pi&thetamax4=2pi&ipw=1&ixmin=0&ixmax=1&iymin=0&iymax=1&igx=0.1&igy=0.1&igl=1&igs=0&iax=1&ila=1&xmin=0&xmax=1&ymin=0&ymax=1. What do you need the smoothing for?
demiurge
Open the macro editor (Alt-F11), insert a new module, add paste the following code: Function sigmoid(t) sigmoid = 1 / (1 + Exp(-t)) End Function Now you can use your new function in your excelsheet, like so: =sigmoid(10) I use this trick all the time, if in-cell formulas get too complex. Good luck!
Psychnic
Related Q & A:
- How can I implement an atomic incr and decr on top of an eventually consistent key-value store?Best solution by Stack Overflow
- How can I implement idle timeout in android?Best solution by Stack Overflow
- How can I implement a multilayer social network in R?Best solution by Computational Science
- How can I find someone's Yahoo email address?Best solution by Yahoo! Answers
- How can I find someone's name if I have their address in the US?Best solution by searchenginez.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.