Description Usage Arguments Value Author(s) See Also
View source: R/srcImpulseDE2_fitImpulse.R
[Model fitting function hierarchy: 3 out of 4] This tertiary fitting wrapper calls the optimisation wrappers for the individual fitting operations to be performed on the observations of this gene. Structure of this function:
Fit impulse model
Initialise impulse model parameters (peak and valley)
Fit impulse model (peak initialisation)
Fit impulse model (valley initialisation)
Select best impulse model fit from initialisations,
Fit constant model (if constant model is to be fit).
1 2 | fitConstImpulseGene(vecCounts, scaDisp, vecSizeFactors, vecTimepointsUnique,
vecidxTimepoint, lsvecidxBatch, boolFitConst, MAXIT = 1000)
|
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). |
vecTimepointsUnique |
(numeric vector length number of unique timepoints) Vector of unique time coordinates observed in this condition. |
vecidxTimepoint |
(numeric vector length number of samples) Index of the time coordinates of each sample (reference is vecTimepointsUnique). |
lsvecidxBatch |
(idx list length number of confounding variables) List of vectors. One vector per confounding variable. Each vector has one entry per sample with the index of the batch ID within the given confounding variable of the given sample. Reference is the list of unique batch ids for each confounding variable. |
boolFitConst |
(bool) Whether to fit a constant model. |
MAXIT |
(scalar) [Default 1000] Maximum number of BFGS iterations for model fitting with optim. |
(list length 2) Impulse and constant model fit to gene observations.
lsImpulseFit (list) List of impulse fit parameters and results.
vecImpulseParam (numeric vector length 6) {beta, h0, h1, h2, t1, t2} Maximum likelihood estimators of impulse model parameters.
vecImpulseValue (numeric vector length number of time points) Values of impulse 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 on impulse model.
lsConstFit (list) List of constant fit parameters and results.
scaMu (scalar) Maximum likelihood estimator of negative binomial mean parameter.
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 on constant model.
David Sebastian Fischer
Called by fitConstImpulseGene to fit constant and impulse model to samples of one condition and one gene. Calls impulse parameter initialisation function estimateImpulseParam and optimisation wrappers fitImpulseModel and fitConstModel.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.