Description Usage Arguments Value Details Author(s) See Also Examples
View source: R/infer_profiles_mle.R
General purpose functions for inferring latent profiles for
different observation models using maximum likelihood estimation (MLE).
Current observation models are: 'bernoulli', 'binomial', 'beta' or
'gaussian'. For most models we cannot obtain an analytically tractable
solution, hence an optimization procedure is used. The
optim
package is used for performing optimization.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
X |
The input data, either a |
model |
Observation model name as character string. It can be either 'bernoulli', 'binomial', 'beta' or 'gaussian'. |
basis |
A 'basis' object. E.g. see |
H |
Optional, design matrix of the input data X. If NULL, H will be computed inside the function. |
lambda |
The complexity penalty coefficient for ridge regression. |
w |
A vector of initial parameters (i.e. coefficients of the basis functions). |
beta_dispersion |
Dispersion parameter, only used for Beta distribution and will be the same for all observations. |
opt_method |
The optimization method to be used. See
|
opt_itnmax |
Optional argument giving the maximum number of iterations
for the corresponding method. See |
is_parallel |
Logical, indicating if code should be run in parallel. |
no_cores |
Number of cores to be used, default is max_no_cores - 1. |
... |
Additional parameters. |
An object of class infer_profiles_mle_
"obs_model" with the
following elements:
W
: An Nx(M+1) matrix with the
optimized parameter values. Each row of the matrix corresponds to each
element of the list X; if X is a matrix, then N = 1. The columns are of the
same length as the parameter vector w (i.e. number of basis functions).
basis
: The basis object.
nll_feat
: NLL fit
feature.
rmse_feat
: RMSE fit feature.
coverage_feat
: CpG coverage feature.
The beta regression model is based on alternative parameterization of the beta density in terms of the mean and dispersion parameter: https://cran.r-project.org/web/packages/betareg/ . For modelling details for Binomial/Bernoulli observation model check the paper for BPRMeth: https://academic.oup.com/bioinformatics/article/32/17/i405/2450762 .
C.A.Kapourani C.A.Kapourani@ed.ac.uk
create_basis
, infer_profiles_vb
,
infer_profiles_gibbs
, create_region_object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Example of optimizing parameters for synthetic data using 3 RBFs
basis <- create_rbf_object(M=3)
out <- infer_profiles_mle(X = binomial_data, model = "binomial",
basis = basis, is_parallel = FALSE, opt_itnmax = 10)
#-------------------------------------
basis <- create_rbf_object(M=3)
out <- infer_profiles_mle(X = beta_data, model = "beta",
basis = basis, is_parallel = FALSE, opt_itnmax = 10)
#-------------------------------------
basis <- create_rbf_object(M=3)
out <- infer_profiles_mle(X = gaussian_data[[1]], model = "gaussian",
basis = basis, is_parallel = FALSE, opt_itnmax = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.