Description Usage Arguments Value Author(s) See Also Examples
The function bpr_bayes
computes the posterior of the BPR
model using auxiliary variable approach. Since we cannot compute the
posterior analytically, a Gibbs sampling scheme is used.
1 2 3 4 5 6 7 8 9 10 11 12 13 | bpr_bayes(x, ...)
## S3 method for class 'list'
bpr_bayes(x, w_mle = NULL, basis = NULL,
fit_feature = NULL, cpg_dens_feat = FALSE, w_0_mean = NULL,
w_0_cov = NULL, gibbs_nsim = 20, gibbs_burn_in = 10,
keep_gibbs_draws = FALSE, is_parallel = TRUE, no_cores = NULL, ...)
## S3 method for class 'matrix'
bpr_bayes(x, w_mle = NULL, basis = NULL,
fit_feature = NULL, cpg_dens_feat = FALSE, w_0_mean = NULL,
w_0_cov = NULL, gibbs_nsim = 20, gibbs_burn_in = 10,
keep_gibbs_draws = FALSE, ...)
|
x |
The input object, either a |
... |
Additional parameters. |
w_mle |
A vector of parameters (i.e. coefficients of the basis functions) containing the MLE estimates. |
basis |
A 'basis' object. E.g. see |
fit_feature |
Return additional feature on how well the profile fits the methylation data. Either NULL for ignoring this feature or one of the following: 1) "RMSE" for returning the fit of the profile using the RMSE as measure of error or 2) "NLL" for returning the fit of the profile using the Negative Log Likelihood as measure of error. |
cpg_dens_feat |
Logical, whether to return an additional feature for the CpG density across the promoter region. |
w_0_mean |
The prior mean hyperparameter for w |
w_0_cov |
The prior covariance hyperparameter for w |
gibbs_nsim |
Optional argument giving the number of simulations of the Gibbs sampler. |
gibbs_burn_in |
Optional argument giving the burn in period of the Gibbs sampler. |
keep_gibbs_draws |
Logical indicating if we should keep the whole MCMC chain for further analysis. |
is_parallel |
Logical, indicating if code should be run in parallel. |
no_cores |
Number of cores to be used, default is max_no_cores - 2. |
Depending on the input object x
:
If x
is
a list
: An object containing the following elements:
W_opt
: An Nx(M+1) matrix with the optimized
parameter values. Each row of the matrix corresponds to each element of the
list x. The columns are of the same length as the parameter vector w (i.e.
number of basis functions).
Mus
: An N x M matrix with the
RBF centers if basis object is create_rbf_object
, otherwise
NULL.
basis
: The basis object.
w
: The
initial values of the parameters w.
If x
is a
matrix
: An object containing the following elements:
w_opt
: Optimized values for the coefficient vector
w. The length of the result is the same as the length of the vector w.
basis
: The basis object.
C.A.Kapourani C.A.Kapourani@ed.ac.uk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | data <- meth_data
out_opt <- bpr_bayes(x = data, is_parallel = FALSE)
ex_data <- meth_data
basis <- create_rbf_object(M=3)
out_opt <- bpr_bayes(x = ex_data, is_parallel = FALSE, basis = basis)
basis <- create_rbf_object(M=2)
w <- c(0.1, 0.1, 0.1)
w_0_mean <- rep(0, length(w))
w_0_cov <- diag(10, length(w))
data <- meth_data[[1]]
out_opt <- bpr_bayes(x = data, w_mle = w, w_0_mean = w_0_mean,
w_0_cov = w_0_cov, basis = basis)
basis <- create_rbf_object(M=0)
w <- c(0.1)
w_0_mean <- rep(0, length(w))
w_0_cov <- diag(10, length(w))
data <- meth_data[[1]]
out_opt <- bpr_bayes(x = data, w_mle = w, w_0_mean = w_0_mean,
w_0_cov = w_0_cov, basis = basis)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.