Description Usage Arguments Value Details Author(s) See Also Examples
View source: R/infer_profiles_gibbs.R
General purpose functions for inferring latent profiles for different observation models using Gibbs sampling. Currently implemented observation models are: 'bernoulli' and 'binomial' and the auxiliary variable approach is used.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
X |
The input data, either a |
model |
Observation model name as character string. It can be either 'bernoulli' or 'binomial'. |
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. |
w |
A vector of initial parameters (i.e. coefficients of the basis functions). If NULL, it will be initialized inside the function. |
mu_0 |
The prior mean hyperparameter vector for w. |
cov_0 |
The prior covariance hyperparameter matrix for w. |
gibbs_nsim |
Total number of simulations for the Gibbs sampler. |
gibbs_burn_in |
Burn in period of the Gibbs sampler. |
store_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 - 1. |
... |
Additional parameters. |
An object of class infer_profiles_gibbs_
"obs_model" with the
following elements:
W
: An Nx(M+1) matrix with the
posterior mean of the parameters w. 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).
W_sd
: An Nx(M+1) matrix with the posterior
standard deviation (sd) of the parameters W.
basis
: The
basis object.
nll_feat
: NLL fit feature.
rmse_feat
: RMSE fit feature.
coverage_feat
: CpG
coverage feature.
W_draws
: Optional, draws of the Gibbs
sampler.
The modelling and mathematical details for inferring profiles using Gibbs sampling are explained here: http://rpubs.com/cakapourani/ . More specifically:
For Binomial observation model check: http://rpubs.com/cakapourani/bayesian-bpr-model
For Bernoulli observation model check: http://rpubs.com/cakapourani/bayesian-bpr-model
C.A.Kapourani C.A.Kapourani@ed.ac.uk
create_basis
, infer_profiles_mle
,
infer_profiles_vb
, create_region_object
1 2 3 4 5 6 | # Example of inferring parameters for synthetic data using 3 RBFs
basis <- create_rbf_object(M=3)
out <- infer_profiles_gibbs(X = binomial_data, model = "binomial",
basis = basis, is_parallel = FALSE, gibbs_nsim = 10, gibbs_burn_in = 5)
#-------------------------------------
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.