28 lines
963 B
C++
28 lines
963 B
C++
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "spectra_reml/types.hpp"
|
||
|
|
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
namespace spectra::reml {
|
||
|
|
|
||
|
|
struct FixedEffectHypothesis {
|
||
|
|
// Rows are restrictions and columns correspond to beta in design order.
|
||
|
|
ColMajorMatrix contrast;
|
||
|
|
// Empty means a zero right-hand side.
|
||
|
|
std::vector<double> rhs;
|
||
|
|
};
|
||
|
|
|
||
|
|
// Computes coefficient-wise tests and any supplied general linear hypotheses
|
||
|
|
// at an already fitted REML solution. Inputs must use the same (possibly GRM-
|
||
|
|
// rotated) coordinate system and phenotype scale as the supplied fit.
|
||
|
|
[[nodiscard]] FixedEffectInferenceResult infer_fixed_effects_spectral(
|
||
|
|
const std::vector<double>& y_star, const ColMajorMatrix& x_star,
|
||
|
|
const std::vector<double>& eigenvalues, const RemlResult& fit,
|
||
|
|
FixedEffectTestMethod method,
|
||
|
|
const std::vector<FixedEffectHypothesis>& hypotheses = {},
|
||
|
|
double rank_tolerance_relative = 1e-10,
|
||
|
|
double covariance_floor_relative = 1e-12);
|
||
|
|
|
||
|
|
} // namespace spectra::reml
|