Developer documentation
Version 3.0.3-105-gd3941f44
Statistics

Classes

class  MR::Math::Stats::GLM::TestFixedHomoscedastic
 
class  MR::Math::Stats::GLM::TestFixedHeteroscedastic
 
class  MR::Math::Stats::GLM::TestVariableHomoscedastic
 
class  MR::Math::Stats::GLM::TestVariableHeteroscedastic
 
class  MR::Math::Stats::SubjectDataImportBase
 
class  MR::Stats::Cluster::ClusterSize
 

Functions

matrix_type MR::Math::Stats::GLM::solve_betas (const matrix_type &measurements, const matrix_type &design)
 
vector_type MR::Math::Stats::GLM::abs_effect_size (const matrix_type &measurements, const matrix_type &design, const Hypothesis &hypothesis)
 
matrix_type MR::Math::Stats::GLM::abs_effect_size (const matrix_type &measurements, const matrix_type &design, const vector< Hypothesis > &hypotheses)
 
matrix_type MR::Math::Stats::GLM::stdev (const matrix_type &measurements, const matrix_type &design)
 
matrix_type MR::Math::Stats::GLM::stdev (const matrix_type &measurements, const matrix_type &design, const index_array_type &variance_groups)
 
vector_type MR::Math::Stats::GLM::std_effect_size (const matrix_type &measurements, const matrix_type &design, const Hypothesis &hypothesis)
 
matrix_type MR::Math::Stats::GLM::std_effect_size (const matrix_type &measurements, const matrix_type &design, const vector< Hypothesis > &hypotheses)
 
void MR::Math::Stats::GLM::all_stats (const matrix_type &measurements, const matrix_type &design, const vector< Hypothesis > &hypotheses, const index_array_type &variance_groups, matrix_type &betas, matrix_type &abs_effect_size, matrix_type &std_effect_size, matrix_type &stdev)
 
void MR::Math::Stats::GLM::all_stats (const matrix_type &measurements, const matrix_type &design, const vector< CohortDataImport > &extra_columns, const vector< Hypothesis > &hypotheses, const index_array_type &variance_groups, vector_type &cond, matrix_type &betas, matrix_type &abs_effect_size, matrix_type &std_effect_size, matrix_type &stdev)
 
void MR::Math::Stats::GLM::TestVariableHomoscedastic::get_mask (const size_t ie, BitSet &, const matrix_type &extra_columns) const
 
void MR::Math::Stats::GLM::TestVariableHomoscedastic::apply_mask (const BitSet &mask, matrix_type::ConstColXpr data, const matrix_type &shuffling_matrix, const matrix_type &extra_column_data, matrix_type &Mfull_masked, matrix_type &shuffling_matrix_masked, vector_type &y_masked) const
 
void MR::Math::Stats::GLM::TestVariableHeteroscedastic::apply_mask_VG (const BitSet &mask, index_array_type &VG_masked, index_array_type &VG_counts) const
 

Variables

const matrix_typeMR::Math::Stats::GLM::TestBase::y
 
const matrix_type MR::Math::Stats::GLM::TestBase::M
 
const vector< Hypothesis > & MR::Math::Stats::GLM::TestBase::c
 
std::shared_ptr< Math::ZstatisticMR::Math::Stats::GLM::TestBase::stat2z
 
vector< Hypothesis::Partition > MR::Math::Stats::GLM::TestFixedHomoscedastic::partitions
 
const matrix_type MR::Math::Stats::GLM::TestFixedHomoscedastic::pinvM
 
const matrix_type MR::Math::Stats::GLM::TestFixedHomoscedastic::Rm
 
vector< matrix_typeMR::Math::Stats::GLM::TestFixedHomoscedastic::XtX
 
vector< default_typeMR::Math::Stats::GLM::TestFixedHomoscedastic::one_over_dof
 
const index_array_typeMR::Math::Stats::GLM::TestFixedHeteroscedastic::VG
 
const size_t MR::Math::Stats::GLM::TestFixedHeteroscedastic::num_vgs
 
vector< size_t > MR::Math::Stats::GLM::TestFixedHeteroscedastic::inputs_per_vg
 
vector_type MR::Math::Stats::GLM::TestFixedHeteroscedastic::Rnn_sums
 
vector_type MR::Math::Stats::GLM::TestFixedHeteroscedastic::inv_Rnn_sums
 
vector_type MR::Math::Stats::GLM::TestFixedHeteroscedastic::gamma_weights
 
const vector< CohortDataImport > & MR::Math::Stats::GLM::TestVariableHomoscedastic::importers
 
const bool MR::Math::Stats::GLM::TestVariableHomoscedastic::nans_in_data
 
const bool MR::Math::Stats::GLM::TestVariableHomoscedastic::nans_in_columns
 
const index_array_typeMR::Math::Stats::GLM::TestVariableHeteroscedastic::VG
 
const size_t MR::Math::Stats::GLM::TestVariableHeteroscedastic::num_vgs
 
vector_type MR::Math::Stats::GLM::TestVariableHeteroscedastic::gamma_weights
 

Detailed Description

Function Documentation

◆ abs_effect_size() [1/2]

vector_type MR::Math::Stats::GLM::abs_effect_size ( const matrix_type measurements,
const matrix_type design,
const Hypothesis hypothesis 
)

Compute the effect of interest

Parameters
measurementsa matrix storing the measured data across subjects in each column
designthe design matrix
hypothesisa Hypothesis class instance defining the effect of interest
Returns
the matrix containing the output absolute effect sizes (one column of element effect sizes per contrast)

◆ abs_effect_size() [2/2]

matrix_type MR::Math::Stats::GLM::abs_effect_size ( const matrix_type measurements,
const matrix_type design,
const vector< Hypothesis > &  hypotheses 
)

◆ all_stats() [1/2]

void MR::Math::Stats::GLM::all_stats ( const matrix_type measurements,
const matrix_type design,
const vector< CohortDataImport > &  extra_columns,
const vector< Hypothesis > &  hypotheses,
const index_array_type variance_groups,
vector_type cond,
matrix_type betas,
matrix_type abs_effect_size,
matrix_type std_effect_size,
matrix_type stdev 
)

Compute all GLM-related statistics This function can be used when the design matrix varies between elements, due to importing external data for each element from external files

Parameters
measurementsa matrix storing the measured data for each subject in a column
designthe fixed portion of the design matrix
extra_columnsthe variable columns of the design matrix
hypothesesa vector of Hypothesis class instances defining the effects of interest
betasthe matrix containing the output GLM betas
abs_effect_sizethe matrix containing the output effect
std_effect_sizethe matrix containing the output standardised effect size
stdevthe matrix containing the output standard deviation

◆ all_stats() [2/2]

void MR::Math::Stats::GLM::all_stats ( const matrix_type measurements,
const matrix_type design,
const vector< Hypothesis > &  hypotheses,
const index_array_type variance_groups,
matrix_type betas,
matrix_type abs_effect_size,
matrix_type std_effect_size,
matrix_type stdev 
)

Compute all GLM-related statistics This function can be used when the design matrix remains fixed for all elements to be tested.

Parameters
measurementsa matrix storing the measured data for each subject in a column
designthe design matrix
hypothesesa vector of Hypothesis class instances defining the effects of interest
betasthe matrix containing the output GLM betas
abs_effect_sizethe matrix containing the output effect
std_effect_sizethe matrix containing the output standardised effect size
stdevthe matrix containing the output standard deviation

◆ apply_mask()

void MR::Math::Stats::GLM::TestVariableHomoscedastic::apply_mask ( const BitSet mask,
matrix_type::ConstColXpr  data,
const matrix_type shuffling_matrix,
const matrix_type extra_column_data,
matrix_type Mfull_masked,
matrix_type shuffling_matrix_masked,
vector_type y_masked 
) const
protected

◆ apply_mask_VG()

void MR::Math::Stats::GLM::TestVariableHeteroscedastic::apply_mask_VG ( const BitSet mask,
index_array_type VG_masked,
index_array_type VG_counts 
) const
protected

◆ get_mask()

void MR::Math::Stats::GLM::TestVariableHomoscedastic::get_mask ( const size_t  ie,
BitSet ,
const matrix_type extra_columns 
) const
protected

◆ solve_betas()

matrix_type MR::Math::Stats::GLM::solve_betas ( const matrix_type measurements,
const matrix_type design 
)

Compute a matrix of the beta coefficients

Parameters
measurementsa matrix storing the measured data across subjects in each column
designthe design matrix
Returns
the matrix containing the output GLM betas (one column of factor betas per element)

◆ std_effect_size() [1/2]

vector_type MR::Math::Stats::GLM::std_effect_size ( const matrix_type measurements,
const matrix_type design,
const Hypothesis hypothesis 
)

Compute cohen's d, the standardised effect size between two means

Parameters
measurementsa matrix storing the measured data across subjects in each column
designthe design matrix
hypothesisa Hypothesis class instance defining the effect of interest
Returns
the matrix containing the output standardised effect sizes (one column of element effect sizes per contrast)

◆ std_effect_size() [2/2]

matrix_type MR::Math::Stats::GLM::std_effect_size ( const matrix_type measurements,
const matrix_type design,
const vector< Hypothesis > &  hypotheses 
)

◆ stdev() [1/2]

matrix_type MR::Math::Stats::GLM::stdev ( const matrix_type measurements,
const matrix_type design 
)

Compute the pooled standard deviation

Parameters
measurementsa matrix storing the measured data across subjects in each column
designthe design matrix
Returns
the vector containing the output standard deviation for each element

◆ stdev() [2/2]

matrix_type MR::Math::Stats::GLM::stdev ( const matrix_type measurements,
const matrix_type design,
const index_array_type variance_groups 
)

Compute the standard deviation of each variance group

Parameters
measurementsa matrix storing the measured data across subjects in each column
designthe design matrix
Returns
the vector containing the output standard deviation for each element

Variable Documentation

◆ c

const vector<Hypothesis>& MR::Math::Stats::GLM::TestBase::c
protected

Definition at line 254 of file glm.h.

◆ gamma_weights [1/2]

vector_type MR::Math::Stats::GLM::TestFixedHeteroscedastic::gamma_weights
protected

Definition at line 352 of file glm.h.

◆ gamma_weights [2/2]

vector_type MR::Math::Stats::GLM::TestVariableHeteroscedastic::gamma_weights
protected

Definition at line 456 of file glm.h.

◆ importers

const vector<CohortDataImport>& MR::Math::Stats::GLM::TestVariableHomoscedastic::importers
protected

Definition at line 396 of file glm.h.

◆ inputs_per_vg

vector<size_t> MR::Math::Stats::GLM::TestFixedHeteroscedastic::inputs_per_vg
protected

Definition at line 344 of file glm.h.

◆ inv_Rnn_sums

vector_type MR::Math::Stats::GLM::TestFixedHeteroscedastic::inv_Rnn_sums
protected

Definition at line 349 of file glm.h.

◆ M

const matrix_type MR::Math::Stats::GLM::TestBase::M
protected

Definition at line 253 of file glm.h.

◆ nans_in_columns

const bool MR::Math::Stats::GLM::TestVariableHomoscedastic::nans_in_columns
protected

Definition at line 397 of file glm.h.

◆ nans_in_data

const bool MR::Math::Stats::GLM::TestVariableHomoscedastic::nans_in_data
protected

Definition at line 397 of file glm.h.

◆ num_vgs [1/2]

const size_t MR::Math::Stats::GLM::TestFixedHeteroscedastic::num_vgs
protected

Definition at line 342 of file glm.h.

◆ num_vgs [2/2]

const size_t MR::Math::Stats::GLM::TestVariableHeteroscedastic::num_vgs
protected

Definition at line 455 of file glm.h.

◆ one_over_dof

vector<default_type> MR::Math::Stats::GLM::TestFixedHomoscedastic::one_over_dof
protected

Definition at line 298 of file glm.h.

◆ partitions

vector<Hypothesis::Partition> MR::Math::Stats::GLM::TestFixedHomoscedastic::partitions
protected

Definition at line 294 of file glm.h.

◆ pinvM

const matrix_type MR::Math::Stats::GLM::TestFixedHomoscedastic::pinvM
protected

Definition at line 295 of file glm.h.

◆ Rm

const matrix_type MR::Math::Stats::GLM::TestFixedHomoscedastic::Rm
protected

Definition at line 296 of file glm.h.

◆ Rnn_sums

vector_type MR::Math::Stats::GLM::TestFixedHeteroscedastic::Rnn_sums
protected

Definition at line 347 of file glm.h.

◆ stat2z

std::shared_ptr<Math::Zstatistic> MR::Math::Stats::GLM::TestBase::stat2z
protected

Definition at line 255 of file glm.h.

◆ VG [1/2]

const index_array_type& MR::Math::Stats::GLM::TestFixedHeteroscedastic::VG
protected

Definition at line 340 of file glm.h.

◆ VG [2/2]

const index_array_type& MR::Math::Stats::GLM::TestVariableHeteroscedastic::VG
protected

Definition at line 454 of file glm.h.

◆ XtX

vector<matrix_type> MR::Math::Stats::GLM::TestFixedHomoscedastic::XtX
protected

Definition at line 297 of file glm.h.

◆ y

const matrix_type& MR::Math::Stats::GLM::TestBase::y
protected

Definition at line 253 of file glm.h.