Evaluate 2 logistic functions for the best x to minimize OR.

  • Thread starter Adel Makram
  • Start date
  • Tags
    Functions
In summary: F= (k2/k1) e-1/4 k1rIt would be nice to see the graph of the OR.In summary, the conversation discusses the conditions used to define the problem of finding the best odd ratio between two logistic functions. The functions are translated on the x-axis and a transformation is made to eliminate the tails of the function. The aim of the study is to determine the critical x where the odd ratio is minimized. After calculations, it was found that the critical x is equal to -∝, which goes against the initial intuition that it should be equal to 1/2r. However, further analysis is needed when the scale parameters of the two functions are not equal.
  • #1
Adel Makram
635
15
Here are conditions I use to define my problem:
1) I use cumulative distribution of 2 logistic functions g1(x) and g2(x) with g2 is translated to the right of the g1(x) on x-axis.
2) I make a transformation to eliminate both tails of the function which will not have a significant contribution to the result, so my transformation is:

f(x) = g(x) - g(α) / g(1-α) - g(α).
where g(α) can be chosen to be equal to 0.05 and g(1-α)= 0.95.

3) g2(x) is translated with amount r to the right side of g1(x).

The aim of the study is to determine the best odd ratio (OR) between g1(x)/1-g1(x) and g2(x)/1-g2(x). In other words, I am looking for minimizing this ratio by taking the first derivatives and making it equal to zero and then calculate x.
to make the matter more simpler, I assumed that the scale parameters of both g1(x) and g2(x) are equal to each other.

surprisingly, after calculation I got x=-∝ which minimizing the ratio against the intuition that x should equal to 1/2 r. Please look at the attached diagram where the area with pink shade represents the interval where x should lie. On both boundaries of this area, OR will be ∝ and OR should come to a minimum at the required x. I made an initial transformation y=e-x and n=yk where k is the scale parameter which I put it to be the same in 2 functions. So I got n=0 (trivial solution) which means y=0 only at x=-∝. So, how come the calculation came opposite to the right intuition that x should = 1/2 r.[/SUB][/SUB][/SUB][/SUB][/SUB][/SUB][/SUB][/SUB]
 

Attachments

  • logistic dist..png
    logistic dist..png
    14.3 KB · Views: 445
Last edited:
Physics news on Phys.org
  • #2
The functions get very close to 0 and 1 exponentially, I'm not surprised to see their ratio be optimized "at infinity".
 
  • #3
mfb said:
The functions get very close to 0 and 1 exponentially, I'm not surprised to see their ratio be optimized "at infinity".
This is correct for the original function g(x) but not for the transformed function f(x). Because f(x) is exactly equal to 0 at x= α and f(x) is exactly equal to 1 at x=-α,,, {sorry for the typing mistake in the original post, the transformation should be f(x) = g(x) - g(α) / g(-α) - g(α)}. where α corresponds to the value of x where the function has the value of 0.05 and -α corresponds to te value of x where the function has 0.95
Now at the interval x∈{r-α , α} the odd ratio defined as f2(x)/1-f2(x) / f1(x)/1-f1(x) approach infinity at both boundaries, namely, at x= α and x= r-α. But converge to a minimum at x=xc which I call it critical x. And my project is to find xc which I found it equals to -∝ which means there is something wrong in my calculation.
 
Last edited:
  • #4
Then your ratio gets even more extreme until it gets undefined - and you'll have to consider at least 5 different ranges individually. Did you do that?

It would help to see what you did in more detail. And what exactly do you want to find, and why?
 
  • #5
mfb said:
Then your ratio gets even more extreme until it gets undefined - and you'll have to consider at least 5 different ranges individually. Did you do that?

It would help to see what you did in more detail. And what exactly do you want to find, and why?
Thank you for your help, hereby I attach a word document explaining my calculation with 2 graphs.
 

Attachments

  • Logistic function.docx
    55.1 KB · Views: 259
  • #6
All those substitutions make the analysis messy, especially as I don't see a system in them.

How can v=ek2 appear as factor anywhere? k2 is always together with either x or r.

For symmetry, I think it would be easier to shift one equation by -r/2 and one by r/2.
 
  • #7
for f2(x), there is an exponential term e-k2(x-r) which=e-k2 x e k2 r = yk2 v = nv
(it was a typing mistake that I wrote v=ek2 it is suppose to be e k2 r ).
 
  • #8
Ah just a typo, okay.

I still think using the symmetry would make the analysis easier.
 
  • #9
mfb said:
Ah just a typo, okay.

I still think using the symmetry would make the analysis easier.

I followed your advice and I found that I was wrong in my calculation. Yes true I found that the final calculation of n reduced to n=√C/A which is equal to 1. This means that e-kx=1 which will be satisfied at x=0 as intuitively though.

Next step which is very important, is to calculate the critical x when k1≠k2. This would be more challenging.
 
  • #10
I went through a long calculation this time when k1≠k2. The final equation is in the form of polynomial of e-x.
It comes in this form; k1 A e-(2k2+k1)x + k2 B e-(2k1+k2)x + C (k1-k2) e-(k2+k1)2x + D K1 e-(k1)x + E k2 e-(k2)x=0

where A, B, C, D and E are coefficients of α, e1/2 K2 r and e-1/2 K1 r. K1 and k2 are (inverse of scale parameters of 2 logistic functions, f1(x) and f2(x), respectively, r is the distance between the 2 functions means.

So any general solution of this polynomial in x?
 
Last edited:
  • #11
The k-prefactors can get included into the A to E parameters.

Using ##y=e^{-k_1 x}## and ##f=\frac{k2}{k1}##, we get the following terms (all with prefactors):
y*y^(2f)
y^2*y^f
y^2*y^(2f)
y
y^f
Unless the prefactors match very nicely in some special way, I would be surprised by a general solution. Note that f=2 gives you powers 1, 2, 4, 5, 6, after dividing by y this is nearly a general polynomial of 5th order where no general closed solutions exist.
 
  • #12
But this is not going to match the OR (odd ratio) curve which it should have a minimum in the range {r-α, α}.
I expect the first derivatives of OR to have only one root at critical x, xc not five roots.
My formula for minimizing OR is ∂OR/∂x = (∂OR/∂n)(∂n/∂x) + (∂OR/∂m)(∂m/∂x)
where, n= e-k2x, m= e-k1x
∂n/∂x= -k2 n, ∂m/∂x= -k1 m.
This would reduce the equation I got in the post#10 into; A mn2 + B(1-k2/k1)mn + Cm + D(k2/k1) m2n + fF n=0
 

Attachments

  • OR.png
    OR.png
    2.1 KB · Views: 370
  • #13
Some of the roout would be an artifact of the calculation process and/or complex.

It could be interesting to calculate some numerical examples, there might be some easy function showing up, at least as approximation.
 

Related to Evaluate 2 logistic functions for the best x to minimize OR.

1. What is a logistic function?

A logistic function is a mathematical equation that describes a sigmoidal or S-shaped curve. It is commonly used to model growth or decline in areas such as biology, economics, and medicine.

2. How can logistic functions be used to minimize OR?

Logistic functions can be used to minimize OR by finding the value of x that corresponds to the lowest point on the curve. This value of x is known as the point of inflection and is where the function switches from increasing to decreasing or vice versa.

3. What is the best way to evaluate logistic functions?

The best way to evaluate logistic functions is to use a graphing calculator or software to plot the function and visually identify the point of inflection. Alternatively, the first and second derivatives of the function can be calculated and used to find the critical point.

4. How can logistic functions be applied in scientific research?

Logistic functions have many applications in scientific research. They can be used to model population growth, the spread of diseases, and the diffusion of innovations. They can also be used in statistical analysis to model binary outcomes or to fit data that follows a sigmoidal pattern.

5. Are there any limitations to using logistic functions?

While logistic functions are useful in many applications, they have some limitations. They assume a constant growth rate, which may not always be the case in real-world scenarios. They also require a large amount of data to accurately fit the curve and may not be suitable for smaller datasets.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
650
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
98
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
900
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
11
Views
2K
Replies
1
Views
970
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
960
Back
Top