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 asPoint2D
coordinates. -
valleys
- Collection of points representing local or global minima along the curve, stored asPoint2D
coordinates. -
inflection_points
- Points where the curve changes concavity (transitioning from concave up to concave down or vice versa), stored asPoint2D
coordinates.
§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: Decimal
Describes 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: Decimal
Indicates 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§fn clone(&self) -> ShapeMetrics
fn clone(&self) -> ShapeMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for ShapeMetrics
impl RefUnwindSafe for ShapeMetrics
impl Send for ShapeMetrics
impl Sync for ShapeMetrics
impl Unpin 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> 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.