       Re: Rookie questions about solving for small numbers

• To: mathgroup at smc.vnet.net
• Subject: [mg131071] Re: Rookie questions about solving for small numbers
• From: Ray Koopman <koopman at sfu.ca>
• Date: Sun, 9 Jun 2013 04:31:09 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-outx@smc.vnet.net
• Delivered-to: mathgroup-newsendx@smc.vnet.net

```Writing s instead of sigma, and letting e denote the probability
that is variously specified as 10^-5 or 10^-20, we have

Pr[x + f*(x^2 - s^2) > 1] = e,

where x is Normal with mean 0 and standard deviation s. Rewrite that as

Pr[z + f*s*(z^2 - 1) > 1/s] = e, where z is standard normal.

If f = 0 then we have Pr[z > 1/s] = e.

Plot log e as a function of log s to identify approximate solutions,
then use FindRoot.

f = 0, e = 10^-5  gives s -> .234473
f = 0, e = 10^-20 gives s -> .107964

If f > 0 then  z + f*s*(z^2 - 1) = 1/s  has two real roots, say z1 < z2.
The coefficient of z is > 0, so we want Pr[z < z1] + Pr[z > z2].
Again do a log-log plot, then use FindRoot.

f = .5, e = 10^-5  gives s -> .173683
f = .5, e = 10^-20 gives s -> .0792307

If -1/4 < f < 0 then the roots are real for all s > 0.
The coefficient of z^2 is < 0, so we want Pr[z1 < z < z2].

f = -.125, e = 10^-5  gives s -> .271650
f = -.125, e = 10^-20 gives s -> .126184

If f < -1/4 then the roots are real only for s > sqrt[-1-4f]/(-2f).
f = -1/2 requires s > 1.

f = -1/2, e = 10^-5, WorkingPrecision->30 gives s ->
1.000000000213493355543893763569933088415336334927`30.

f = -1/2, e = 10^-20, WorkingPrecision->60 gives s -> 1.0000000000000000000000000000000000000002134933555514410720359161572336783883`60.

In general, s -> smin as e -> 0 with f < -1/4.
How much precision do you need? Would an approximation suffice?

----- Samuel Mark Young <sy81 at sussex.ac.uk> wrote:
> Yes that's correct. The code I've included does this fine for positive values of f, but can't handle negative values very well. I also run into problems when I want to solve for Pr[x + f*(x^2 - sigma^2) > 1] = 10^-20 instead.
>
> Sam
> ________________________________________
> From: Ray Koopman [koopman at sfu.ca]
> Sent: 07 June 2013 04:19
> To: mathgroup at smc.vnet.net
> Subject: Re: Rookie questions about solving for small numbers
>
> It's still not clear exactly what you want. Is this it?
>
> X is a random variable whose distribution is normal with mean 0
> and standard deviation sigma. Given a constant f, solve for sigma
> such that Pr[x + f*(x^2 - sigma^2) > 1] = 10^-5.

```

• Prev by Date: Re: mma.el -- emacs mode for writing mathematica package files
• Next by Date: Re: visualizing a maximum in the intersection between two surfaces
• Previous by thread: Re: Rookie questions about solving for small numbers
• Next by thread: Re: Rookie questions about solving for small numbers