calculate_imputation
is a helper function that is used in the impute
function.
Depending on the type of missingness and method, it samples values from a normal distribution
that can be used for the imputation. Note: The input intensities should be log2 transformed.
a numeric value specifying the minimal intensity value of the precursor/peptide.
Is only required if method = "ludovic"
and missingness = "MNAR"
.
a numeric value specifying a noise value for the precursor/peptide. Is only
required if method = "noise"
and missingness = "MNAR"
.
a numeric value specifying the mean intensity value of the condition with missing
values for a given precursor/peptide. Is only required if missingness = "MAR"
.
a numeric value specifying the mean of the standard deviation of all conditions for a given precursor/peptide.
a character value specifying the missingness type of the data determines
how values for imputation are sampled. This can be "MAR"
or "MNAR"
.
a character value specifying the method to be used for imputation. For
method = "ludovic"
, MNAR missingness is sampled around a value that is three lower
(log2) than the lowest intensity value recorded for the precursor/peptide. For
method = "noise"
, MNAR missingness is sampled around the noise value for the
precursor/peptide.
a logical value, if FALSE a check is performed to validate that input values are log2 transformed. If input values are > 40 the test is failed and an error is returned.
A value sampled from a normal distribution with the input parameters. Method specifics are applied to input parameters prior to sampling.