tfp.math.owens_t
Stay organized with collections
Save and categorize content based on your preferences.
Computes Owen's T function of h
and a
element-wise.
tfp.math.owens_t(
h, a, name=None
)
Used in the notebooks
Owen's T function is defined as the combined probability of the event X > h
and 0 < Y < a * X
, where X
and Y
are independent standard normal
random variables.
In integral form this is defined as 1 / (2 * pi)
times the integral of
exp(-0.5 * h ** 2 * (1 + x ** 2)) / (1 + x ** 2)
from 0
to a
.
h
and a
can be any real number
The Owen's T implementation below is based on
([Patefield and Tandy, 2000][1]).
The Owen's T function has several notable properties which
we list here for convenience. ([Owen, 1980][2], page 414)
- P2.1
T( h, 0) = 0
- P2.2
T( 0, a) = arctan(a) / (2 pi)
- P2.3
T( h, 1) = Phi(h) (1 - Phi(h)) / 2
- P2.4
T( h, inf) = (1 - Phi(|h|)) / 2
- P2.5
T(-h, a) = T(h, a)
- P2.6
T( h,-a) = -T(h, a)
- P2.7
T( h, a) + T(a h, 1 / a) = Phi(h)/2 + Phi(ah)/2 - Phi(h) Phi(ah) - [a<0]/2
- P2.8
T( h, a) = arctan(a)/(2 pi) - 1/(2 pi) int_0^h int_0^{ax}
exp(-(x2 + y2)/2) dy dx`
- P2.9
T( h, a) = arctan(a)/(2 pi) - int_0**h phi(x) Phi(a x) dx + Phi(h)/2 - 1/4
[a<0]
uses Iverson bracket notation, i.e., [a<0] = {1 if a<0 and 0 otherwise
.
Let us also define P2.10 as:
- P2.10
T(inf, a) = 0
Proof
Note that result #10,010.6 ([Owen, 1980][2], pg 403) states that:
int_0^inf phi(x) Phi(a+bx) dx = Phi(a/rho)/2 + T(a/rho,b) where rho = sqrt(1+b**2).
Using a=0
, this result is:
int_0^inf phi(x) Phi(bx) dx = 1/4 + T(0,b) = 1/4 + arctan(b) / (2 pi)
Combining this with P2.9 implies
T(inf, a)
= arctan(a)/(2 pi) - [ 1/4 + arctan(a) / (2 pi)] + Phi(inf)/2 - 1/4
= -1/4 + 1/2 -1/4 = 0.
QED
Args |
h
|
A float Tensor defined as in P({X > h, 0 < Y < a X}) . Must be
broadcastable with a .
|
a
|
A float Tensor defined as in P({X > h, 0 < Y < a X}) . Must be
broadcastable with h .
|
name
|
A name for the operation (optional).
|
Returns |
owens_t
|
A Tensor with the same type as h and a ,
|
References
[1]: Patefield, Mike, and D. A. V. I. D. Tandy. "Fast and accurate calculation
of Owen’s T function." Journal of Statistical Software 5.5 (2000): 1-25.
http://www.jstatsoft.org/v05/i05/paper
[2]: Owen, Donald Bruce. "A table of normal integrals: A table."
Communications in Statistics-Simulation and Computation 9.4 (1980):
389-419.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[],null,["# tfp.math.owens_t\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/math/special.py#L2589-L2659) |\n\nComputes Owen's T function of `h` and `a` element-wise. \n\n tfp.math.owens_t(\n h, a, name=None\n )\n\n### Used in the notebooks\n\n| Used in the tutorials |\n|----------------------------------------------------------------------------------------------------------------------|\n| - [TFP Release Notes notebook (0.13.0)](https://www.tensorflow.org/probability/examples/TFP_Release_Notebook_0_13_0) |\n\nOwen's T function is defined as the combined probability of the event `X \u003e h`\nand `0 \u003c Y \u003c a * X`, where `X` and `Y` are independent standard normal\nrandom variables.\n\nIn integral form this is defined as `1 / (2 * pi)` times the integral of\n`exp(-0.5 * h ** 2 * (1 + x ** 2)) / (1 + x ** 2)` from `0` to `a`.\n`h` and `a` can be any real number\n\nThe Owen's T implementation below is based on\n(\\[Patefield and Tandy, 2000\\]\\[1\\]).\n\nThe Owen's T function has several notable properties which\nwe list here for convenience. (\\[Owen, 1980\\]\\[2\\], page 414)\n\n- P2.1 `T( h, 0) = 0`\n- P2.2 `T( 0, a) = arctan(a) / (2 pi)`\n- P2.3 `T( h, 1) = Phi(h) (1 - Phi(h)) / 2`\n- P2.4 `T( h, inf) = (1 - Phi(|h|)) / 2`\n- P2.5 `T(-h, a) = T(h, a)`\n- P2.6 `T( h,-a) = -T(h, a)`\n- P2.7 `T( h, a) + T(a h, 1 / a) = Phi(h)/2 + Phi(ah)/2 - Phi(h) Phi(ah) - [a\u003c0]/2`\n- P2.8 `T( h, a) = arctan(a)/(2 pi) - 1/(2 pi) int_0^h int_0^{ax}` exp(-(x**2 + y**2)/2) dy dx\\`\n- P2.9 `T( h, a) = arctan(a)/(2 pi) - int_0**h phi(x) Phi(a x) dx + Phi(h)/2 - 1/4`\n\n`[a\u003c0]` uses Iverson bracket notation, i.e., `[a\u003c0] = {1 if a\u003c0 and 0 otherwise`.\n\nLet us also define P2.10 as:\n\n- P2.10 `T(inf, a) = 0`\n- Proof\n\n Note that result #10,010.6 (\\[Owen, 1980\\]\\[2\\], pg 403) states that:\n `int_0^inf phi(x) Phi(a+bx) dx = Phi(a/rho)/2 + T(a/rho,b) where rho = sqrt(1+b**2).`\n Using `a=0`, this result is:\n `int_0^inf phi(x) Phi(bx) dx = 1/4 + T(0,b) = 1/4 + arctan(b) / (2 pi)`\n Combining this with P2.9 implies \n\n T(inf, a)\n = arctan(a)/(2 pi) - [ 1/4 + arctan(a) / (2 pi)] + Phi(inf)/2 - 1/4\n = -1/4 + 1/2 -1/4 = 0.\n\n QED\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------|---------------------------------------------------------------------------------------------|\n| `h` | A `float` `Tensor` defined as in `P({X \u003e h, 0 \u003c Y \u003c a X})`. Must be broadcastable with `a`. |\n| `a` | A `float` `Tensor` defined as in `P({X \u003e h, 0 \u003c Y \u003c a X})`. Must be broadcastable with `h`. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|-----------|-----------------------------------------------|\n| `owens_t` | A `Tensor` with the same type as `h` and `a`, |\n\n\u003cbr /\u003e\n\n#### References\n\n\\[1\\]: Patefield, Mike, and D. A. V. I. D. Tandy. \"Fast and accurate calculation\nof Owen's T function.\" Journal of Statistical Software 5.5 (2000): 1-25.\n\u003chttp://www.jstatsoft.org/v05/i05/paper\u003e\n\\[2\\]: Owen, Donald Bruce. \"A table of normal integrals: A table.\"\nCommunications in Statistics-Simulation and Computation 9.4 (1980):\n389-419."]]