Skip to main content

ProbPlot

Struct ProbPlot 

Source
pub struct ProbPlot { /* private fields */ }
Expand description

A normal probability plot (Q-Q plot against the standard normal).

Mirrors the reference ProbPlot for the default standard-normal distribution: the theoretical percentiles are the plotting positions (i - a) / (n + 1 - 2a) for i = 1..=n, the theoretical quantiles are the normal inverse-CDF of those percentiles, and the sample quantiles are simply the sorted data.

Implementations§

Source§

impl ProbPlot

Source

pub fn new(data: &[f64]) -> Self

Build a probability plot from data, using plotting-position parameter a = 0 (the reference default).

Source

pub fn with_a(data: &[f64], a: f64) -> Self

Build a probability plot with an explicit plotting-position parameter a.

Common choices: 0.0 (Weibull, the default), 0.375 (Blom), 0.5 (Hazen).

Source

pub fn nobs(&self) -> usize

Number of observations.

Source

pub fn theoretical_percentiles(&self) -> Array1<f64>

The theoretical plotting positions (percentiles in (0, 1)).

p_i = (i - a) / (n + 1 - 2a) for i = 1..=n.

Source

pub fn theoretical_quantiles(&self) -> Array1<f64>

The theoretical quantiles: the standard-normal inverse CDF of the plotting positions.

Source

pub fn sample_quantiles(&self) -> Array1<f64>

The sample quantiles: the sorted data.

Source

pub fn qqline_regression(&self) -> QqLine

The regression reference line (“r”): an ordinary least-squares fit of the sample quantiles on the theoretical quantiles (with intercept).

Source

pub fn qqline_standardized(&self) -> QqLine

The standardized reference line (“s”): slope = sample standard deviation (population, 1/n), intercept = sample mean.

Source

pub fn qqline_quartile(&self) -> QqLine

The quartile reference line (“q”): the line through the first and third quartiles of the sample versus the theoretical normal quartiles.

Source

pub fn qqplot(&self) -> Figure

Render the Q-Q plot to a Figure: a scatter of (theoretical, sample) quantiles overlaid with the regression reference line.

Trait Implementations§

Source§

impl Clone for ProbPlot

Source§

fn clone(&self) -> ProbPlot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProbPlot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.