pub struct ShapeMetrics {
pub skewness: Decimal,
pub kurtosis: Decimal,
pub peaks: Vec<Point2D>,
pub valleys: Vec<Point2D>,
pub inflection_points: Vec<Point2D>,
}Expand description
Represents shape-related analysis metrics for a given curve.
§Overview
The ShapeMetrics structure encapsulates shape-related properties and critical
points describing a curve’s geometrical behavior. It’s primarily used for
mathematical and statistical analysis of curves representing data distributions
or mathematical functions.
§Fields
-
skewness- A measure of distribution asymmetry. Positive values indicate right tailing while negative values indicate left tailing. -
kurtosis- A measure of the “tailedness” or presence of outliers in the distribution. Higher values indicate heavier tails and more outliers compared to a normal distribution. -
peaks- Collection of points representing local or global maxima along the curve, stored asPoint2Dcoordinates. -
valleys- Collection of points representing local or global minima along the curve, stored asPoint2Dcoordinates. -
inflection_points- Points where the curve changes concavity (transitioning from concave up to concave down or vice versa), stored asPoint2Dcoordinates.
§Applications
This structure is commonly used in:
- Financial analysis to identify trend reversals or extreme price levels
- Statistical distribution analysis to characterize data shape properties
- Mathematical modeling to identify critical points in curve functions
- Visualization and interpretation of complex curve behaviors
§Relationship with Other Structures
ShapeMetrics is typically part of the larger AnalysisResult structure
that provides comprehensive curve analysis. It uses Point2D to represent
all positional data with high-precision Decimal values.
Fields§
§skewness: DecimalDescribes the asymmetry of the curve’s distribution. A positive value indicates a right tail (right-skewed distribution), while a negative value indicates a left tail (left-skewed distribution). A value close to zero suggests symmetry.
kurtosis: DecimalIndicates the “tailedness” or presence of outliers in the curve’s distribution. Higher values correspond to heavier tails and more outliers compared to a normal distribution. Standard normal distribution has kurtosis of 3.0. Often expressed as excess kurtosis (kurtosis - 3).
peaks: Vec<Point2D>Collection of Point2D instances representing local or global maxima (peaks)
along the curve. These points have higher y-values than their immediate
neighboring points.
valleys: Vec<Point2D>Collection of Point2D instances representing local or global minima (valleys)
along the curve. These points have lower y-values than their immediate
neighboring points.
inflection_points: Vec<Point2D>Points where the curve changes concavity, transitioning from concave up to concave down (or vice versa). At these points, the second derivative equals zero while changing sign.
Trait Implementations§
Source§impl Clone for ShapeMetrics
impl Clone for ShapeMetrics
Source§impl ComposeSchema for ShapeMetrics
impl ComposeSchema for ShapeMetrics
Source§impl Debug for ShapeMetrics
impl Debug for ShapeMetrics
Source§impl Display for ShapeMetrics
impl Display for ShapeMetrics
Source§impl Serialize for ShapeMetrics
impl Serialize for ShapeMetrics
Auto Trait Implementations§
impl Freeze for ShapeMetrics
impl RefUnwindSafe for ShapeMetrics
impl Send for ShapeMetrics
impl Sync for ShapeMetrics
impl Unpin for ShapeMetrics
impl UnsafeUnpin for ShapeMetrics
impl UnwindSafe for ShapeMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.