calc_condition_number: Calculation of the condition number

View source: R/deconvolution_algorithms.R

calc_condition_numberR Documentation

Calculation of the condition number

Description

A problem with a low condition number is said to be well-conditioned, while a problem with a high condition number is said to be ill-conditioned. An ill-conditioned problem is one where, for a small change in the inputs (the independent variables) there is a large change in the answer or dependent variable.

Usage

calc_condition_number(signature_matrix)

Arguments

signature_matrix

A signature matrix created with the build_model method

Value

The condition number

Examples

data("single_cell_data_1")
data("cell_type_annotations_1")
data("batch_ids_1")
data("bulk")

single_cell_data <- single_cell_data_1[1:2000, 1:500]
cell_type_annotations <- cell_type_annotations_1[1:500]
batch_ids <- batch_ids_1[1:500]
bulk <- bulk[1:2000, ]

signature_matrix_momf <- build_model(
  single_cell_data, cell_type_annotations, "momf",
  bulk_gene_expression = bulk
)
cond_num <- calc_condition_number(signature_matrix_momf)
cond_num

PelzKo/immunedeconv2 documentation built on Feb. 12, 2025, 4:16 p.m.