fitSigmoidModel: Fit a sigmoidal model to data of a gene

View source: R/srcImpulseDE2_fitSigmoid.R

fitSigmoidModelR Documentation

Fit a sigmoidal model to data of a gene

Description

[Model fitting function hierarchy: 3 out of 3] This tertiary fitting wrapper performs sigmoidal model fitting: This function executes numerical optimisaiton and error-handling thereof.

Usage

fitSigmoidModel(vecSigmoidParamGuess, vecCounts, scaDisp, vecSizeFactors,
  lsvecidxBatch, vecTimepointsUnique, vecidxTimepoint, MAXIT = 1000,
  RELTOL = 10^(-8), trace = 0, REPORT = 10)

Arguments

vecSigmoidParamGuess

(numeric vector length 4) {beta, h0, h1, t} Up model initialisations of sigmoidal model parameters.

vecCounts

(numeric vector number of samples) Read count data.

scaDisp

(scalar) Gene-wise negative binomial dispersion hyper-parameter.

vecSizeFactors

(numeric vector number of samples) Model scaling factors for each sample which take sequencing depth into account (size factors).

lsvecidxBatch

(list length number of confounding variables) List of index vectors. One vector per confounding variable. Each vector has one entry per sample with the index batch within the given confounding variable of the given sample. Batches are enumerated from 1 to number of batches.

vecTimepointsUnique

(numeric vector length number of unique time points) Unique time points of set of time points of given samples.

vecidxTimepoint

(index vector length number of samples) Index of of time point assigned to each sample in vector vecTimepointsUnique.

MAXIT

(scalar) [Default 1000] Maximum number of BFGS iterations for model fitting with optim.

RELTOL

(scalar) [Default 10^(-8)] Maximum relative change in loglikelihood to reach convergence in numerical optimisation by BFGS in optim.

trace

(scalar) [Defaul 0] Reporting parameter of optim.

REPORT

(scalar) [Default 10] Reporting parameter of optim.

Value

(list) List of sigmoid fit parameters and results.

  • vecSigmoidParam (numeric vector length 4) {beta, h0, h1, t} Maximum likelihood estimators of sigmoidal model parameters.

  • vecSigmoidValue (numeric vector length number of time points) Values of sigmoid model fit at time points used for fit.

  • lsvecBatchFactors (list length number of confounders) List of vectors of scalar batch correction factors for each sample. These are also maximum likelihood estimators. NULL if no confounders given.

  • scaDispParam (scalar) Dispersion parameter estimate used in fitting (hyper-parameter).

  • scaLL (scalar) Loglikelihood of data under maximum likelihood estimator model.

  • scaConvergence (scalar) Convergence status of optim for sigmoid model.

Author(s)

David Sebastian Fischer

See Also

Called by fitSigmoidGene to fit sigmoidal model to samples of one condition and one gene. Calls sigmoidal model cost function evalLogLikSigmoid_comp within optim.


YosefLab/ImpulseDE2 documentation built on Sept. 17, 2022, 2:45 a.m.