tfp.math.trapz
Stay organized with collections
Save and categorize content based on your preferences.
Integrate y(x) on the specified axis using the trapezoidal rule.
tfp.math.trapz(
y, x=None, dx=None, axis=-1, name=None
)
Computes ∫ y(x) dx ≈ Σ [0.5 (yk + y{k+1}) * (x_{k+1} - x_k)]
Args |
y
|
Float Tensor of values to integrate.
|
x
|
Optional, Float Tensor of points corresponding to the y values. The
shape of x should match that of y. If x is None, the sample points are
assumed to be evenly spaced dx apart.
|
dx
|
Scalar float Tensor . The spacing between sample points when x is None.
If neither x nor dx is provided then the default is dx = 1.
|
axis
|
Scalar integer Tensor . The axis along which to integrate.
|
name
|
Python str name prefixed to ops created by this function.
Default value: None , uses name='trapz'.
|
Returns |
Float Tensor integral approximated by trapezoidal rule.
Has the shape of y but with the dimension associated with axis removed.
|
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."],[],[]]