Skip to main content

Ordination

Struct Ordination 

Source
pub struct Ordination {
    pub sample_ids: Vec<String>,
    pub species_ids: Vec<String>,
    pub constraint_ids: Vec<String>,
    pub eigvals: Vec<f64>,
    pub proportion_explained: Vec<f64>,
    pub sample_scores: Vec<f64>,
    pub species_scores: Vec<f64>,
    pub biplot_scores: Vec<f64>,
    pub biplot_axes: usize,
    pub sample_constraints: Vec<f64>,
}
Expand description

Result of a Redundancy Analysis. Eigenvalues, proportion explained, and the site/species scores plus biplot and site-constraint scores follow skbio.stats.ordination.rda. The first n_constrained axes are canonical (constrained by the explanatory variables); the rest are the unconstrained PCA of the residuals.

Fields§

§sample_ids: Vec<String>§species_ids: Vec<String>§constraint_ids: Vec<String>§eigvals: Vec<f64>§proportion_explained: Vec<f64>§sample_scores: Vec<f64>

Row-major n_samples × n_axes.

§species_scores: Vec<f64>

Row-major n_species × n_axes.

§biplot_scores: Vec<f64>

Biplot scores follow the left singular vectors of the fitted values, so they span only the constrained axes: row-major n_constraints × biplot_axes.

§biplot_axes: usize§sample_constraints: Vec<f64>

Row-major n_samples × n_axes.

Implementations§

Source§

impl Ordination

Source

pub fn compute( response: &Matrix, constraints: &Matrix, scaling: u8, scale_y: bool, ) -> Result<Ordination>

RDA per Legendre & Legendre 1998 §11.1: regress centred y on centred x (SVD least squares), SVD the fitted values for the canonical axes, SVD the residuals for the unconstrained axes, then apply scaling 1 or 2.

§Errors

Errors when the two tables disagree on sample count or when x has more columns than rows (an under-determined regression), matching skbio.

Source

pub fn write_tsv<W: Write>(&self, out: W) -> Result<()>

Write the ordination as a flat TSV with # eigenvalues, # samples, # species, # biplot, and # site_constraints blocks, axes RDA1...

§Errors

Propagates write errors.

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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,