Skip to main content
12-Amethyst
January 5, 2012
Solved

Ensure Real Results?

  • January 5, 2012
  • 1 reply
  • 2498 views

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

Best answer by AlanStevens

Perhaps the attached is of more use.

Alan

1 reply

19-Tanzanite
January 7, 2012

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

12-Amethyst
January 9, 2012

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

19-Tanzanite
January 9, 2012

Perhaps the attached is of more use.

Alan