model_param: model_param

View source: R/model_param.R

model_paramR Documentation

model_param

Description

This function returns model parameters based on the best fit distribution as selected by distr_fit and models fitted by fit_models

Usage

model_param(fit.model, gof.res, model = NULL)

Arguments

fit.model

A list of models fitted by 'glm' from fit_models.

gof.res

A list of selected model distributions for genes select_model.

model

A specific model to fit (1:P, 2:NB, 3:ZIP, 4:ZINB, NULL:All)

Value

A list of model parameters estimated. Estimated model parameters include mean (for all 4 models), theta (over-dispersion parameter for NB & ZINB models), pi (zero-inflation parameter for ZIP & ZINB models).

Examples


data(scData)

# apply the model_param function to extract the parameters of the best fit
# model obtained by running the select_model function

library(BiocParallel)
scData_models <- fit_models(counts=scData$counts, cexpr=scData$covariates, lib.size=scData$lib_size,
BPPARAM=bpparam())
scData_bicvals <- model_bic(scData_models)
scData_least.bic <- lbic_model(scData_bicvals, scData$counts)
scData_gof <- gof_model(scData_least.bic, cexpr=scData$covariates, lib.size=scData$lib_size,
BPPARAM=bpparam())
scData_fit <- select_model(scData_gof)

scData_params <- model_param(scData_models, scData_fit, model=NULL)

Malindrie/scShapes documentation built on Nov. 21, 2022, 8:58 a.m.