Collab --
In the attached worksheet, I am attempting to map uniform distribution onto a logistic function. While the logistic function appears smooth when plotted, it is imaginary for certain input values when inverted. In Mathcad, I can get around this by splining. However, this is not possible in my final application (I am using Mathcad for testing and debugging). My final application has no ability to handle imaginary numbers and simply throws an error when it encounters one. Furthermore, the only random numbers it generates are from a uniform distribution. Thus, the problem may be summarized as follows:
1. Fit function to measured data
2. Invert fitting function
3. Require real output from #2 for all inputs [0,1]
4. Map uniform distribution to #2 in target application
The problem here is step 3. So can anyone either: (a) tell me how to enforce #3 for the function given; or (b) suggest another function that obeys #3?
A final note -- this exercise is a pretty rough approximation. Thus, if the optimal solution involves discarding some results to enforce #3, I can live with that -- I just can't live with a solution that introduces a gross systematic bias in the numbers (i.e., eliminating all numbers between 0.5 and 1).
Thanks in advance.
Matt
Solved! Go to Solution.
Your fitted function doesn't extrapolate well. It gives some negative values for q, for example, even within the supplied data range. These cause problems when inverting with some u values. See attached for a possible alternative.
Note: This will invert down to zero (well 10^-10 or so!) if you insist on extrapolating. Just use 10^-10 instead of d0 in the definition of lo.
Alan
Alan -- thanks for having a look. This is indeed helpful, but I still don't have an equation that I can easily port into my end-user application. I appreciate the help.
Matt
Alan -- brilliant! Thanks so much for the help. Matt