1#ifndef SCRAN_VARIANCES_FIT_VARIANCE_TREND_H
2#define SCRAN_VARIANCES_FIT_VARIANCE_TREND_H
79template<
typename Float_>
119template<
typename Float_>
127 return x *
x *
x *
x;
132 for (
size_t i = 0;
i <
n; ++
i) {
145 throw std::runtime_error(
"not enough observations above the minimum mean");
154 if (
options.use_minimum_width) {
178 for (
size_t i =
n;
i > 0; --
i) {
188 for (
size_t i = 0;
i <
n; ++
i) {
202template<
typename Float_>
237template<
typename Float_>
void compute(size_t num_points, const Data_ *x, const PrecomputedWindows< Data_ > &windows, const Data_ *y, Data_ *fitted, Data_ *robust_weights, const Options< Data_ > &opt)
Variance modelling for single-cell expression data.
Definition choose_highly_variable_genes.hpp:14
std::vector< Index_ > choose_highly_variable_genes_index(Index_ n, const Stat_ *statistic, const ChooseHighlyVariableGenesOptions &options)
Definition choose_highly_variable_genes.hpp:256
void fit_variance_trend(size_t n, const Float_ *mean, const Float_ *variance, Float_ *fitted, Float_ *residuals, FitVarianceTrendWorkspace< Float_ > &workspace, const FitVarianceTrendOptions &options)
Definition fit_variance_trend.hpp:120
Options for fit_variance_trend().
Definition fit_variance_trend.hpp:19
int num_threads
Definition fit_variance_trend.hpp:71
double minimum_width
Definition fit_variance_trend.hpp:58
bool use_minimum_width
Definition fit_variance_trend.hpp:51
double span
Definition fit_variance_trend.hpp:43
bool transform
Definition fit_variance_trend.hpp:37
int minimum_window_count
Definition fit_variance_trend.hpp:65
bool mean_filter
Definition fit_variance_trend.hpp:31
double minimum_mean
Definition fit_variance_trend.hpp:25
Results of fit_variance_trend().
Definition fit_variance_trend.hpp:203
std::vector< Float_ > residuals
Definition fit_variance_trend.hpp:222
std::vector< Float_ > fitted
Definition fit_variance_trend.hpp:217
Workspace for fit_variance_trend().
Definition fit_variance_trend.hpp:80