Can these equations be solved analytically?

  • Context: Undergrad 
  • Thread starter Thread starter lavoisier
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the analytical solvability of two equations related to Bayesian probability. Participants explore whether these equations can be solved analytically or if numerical methods are the only viable approach. The focus includes theoretical considerations and practical implications of solving these equations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant initially believes that both equations cannot be solved analytically for x and P(a), citing the complexity of the functions involved.
  • Another participant asserts that a numerical solution is possible and shares their experience of solving the equations numerically for a specific dataset.
  • There is a correction regarding the formulation of the equations, specifically the presence of a square root of 2 in the definition of Φ, which was identified as an error.
  • Some participants express a desire for an analytical solution, noting that without it, they would need to implement iterative methods for different datasets.
  • One participant provides R code as a potential numerical solution method, indicating that numerical approaches can be implemented effectively.

Areas of Agreement / Disagreement

Participants generally agree that a numerical solution is possible, but there is no consensus on the existence of an analytical solution. Some participants maintain that an analytical solution is unlikely, while others express a desire for it.

Contextual Notes

The discussion highlights the complexity of the equations and the potential need for iterative numerical methods, particularly when dealing with varying datasets. There are unresolved aspects regarding the implications of the equations and the necessity of analytical solutions.

Who May Find This Useful

This discussion may be useful for individuals interested in Bayesian probability, numerical methods for solving equations, and those seeking insights into the challenges of analytical versus numerical solutions in statistical contexts.

lavoisier
Messages
177
Reaction score
24
Hi everyone,
I am studying a problem related to Bayesian probability, and I came across two equations, which as far as I can tell can only be solved numerically, but as I'm no expert I would like to hear your opinion, please.

The first one is:

P(a) \cdot \left[ 1 - \Phi \left( \frac {x - \mu_a} { \sqrt 2 \cdot \sigma_a} \right) \right] = (1 - P(a) ) \cdot \Phi \left( \frac {x-\mu_b} { \sqrt 2 \cdot \sigma_b} \right)

where:

\Phi (y) = \frac {1} {\sqrt {2 \pi}} \cdot \int_{- \inf}^y {e^{-t^2 / 2}} \, dt = \frac 1 2 \cdot \left[ 1 + {erf} \left( \frac {y} {\sqrt 2} \right) \right]

P(a) is a probability, thus a real (?) number between 0 and 1, and I need to solve for x.

Initially I had no doubt that this could not be solved analytically for x. But then as I was reading something about statistical power, in an example they showed how you can invert Φ using a 'probit' function, so I wondered if it's possible after all. I would have thought the inversion required Φ to be 'isolated', and this didn't seem possible here. But I'd be glad to be proven wrong!

The second one is:

N \cdot P(a) = \sum_{i=1}^N {\frac {P(a) \cdot A_i} {P(a) \cdot A_i + [1-P(a)] \cdot B_i} }

where P(a) is as above, N is a positive integer and:

A_i = 1 - \Phi \left( \frac {x_i - \mu_a} { \sqrt 2 \cdot \sigma_a} \right)

B_i = \Phi \left( \frac {x_i - \mu_b} { \sqrt 2 \cdot \sigma_b} \right)

and I need to solve for P(a).

If I understand correctly, Φ has the property:

\Phi (-x) = 1 - \Phi (x)

but I don't see if/how that helps me in this case.

Any idea?
Thanks
L
 
Physics news on Phys.org
It doesn't seem that a numerical analytic solution is possible. And if it is possible, it's likely not really important anyway.
 
Last edited:
micromass said:
It doesn't seem that a numerical solution is possible. And if it is possible, it's likely not really important anyway.
Unless I am much mistaken, a numerical solution is possible, and in fact I did solve both equations numerically for a given dataset of xi's with N ≈ 115000.
I solved the second one (Excel solver, minimisation of (rhs-lhs)2 ), and with the resulting value of P(a) (≈ 0.33%) I solved the first one (x ≈ 65).

My question was whether they were analytically solvable.

Not important, I guess you mean as in 'not a type of problem that is generally encountered in this branch of statistics', as opposed to 'who cares about this' :biggrin:
If so, I suppose I'd better review the chain of reasoning that led me to these equations.

PS: just spotted an error in my Tex. The square root of 2 shouldn't be there, it's already in the definition of Φ. Correct version:

P(a) \cdot \left[ 1 - \Phi \left( \frac {x - \mu_a} {\sigma_a} \right) \right] = (1 - P(a) ) \cdot \Phi \left( \frac {x-\mu_b} { \sigma_b} \right)

A_i = 1 - \Phi \left( \frac {x_i - \mu_a} { \sigma_a} \right)

B_i = \Phi \left( \frac {x_i - \mu_b} { \sigma_b} \right)
 
Of course a numerical solution is possible. I made a typo in my post. It doesn't seem an analytic solution is possible. And it's not important anyway, since all we care is a numerical solution.
 
OK, I understand, thanks.

I would have cared for an analytical solution, because while it's true that I do want the numbers in the end, without a closed form I'll have to write an iteration to solve the problem for each new dataset I get.
In the past someone else in these forums (@mfb) taught me that I could do an iteration (e.g. Newton) in Excel by just writing out the steps line by line, which worked very well. I'll see if I can do it in this case; much more complicated.
 
Use the following R code:

Code:
PA <- 0.5
mu_a <- 2
mu_b <- 3
sigma_a <- 1
sigma_b <- 2

f <- function(x) {
  PA*(1 - pnorm((x-mu_a)/sigma_a)) - (1-PA)*pnorm((x-mu_b)/sigma_b)
}

uniroot(f,c(-100,100))
 
Great, thanks!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K