Description Details Public fields Methods
R6 class to implement the BaNE model
Bane class
indep
independent variable names
dep
list of variables dependencies
mu
independent variable priors
lm
dependent variable priors
n
Number of independent nodes
m
Number of dependent nodes
k
Number of total nodes
N
Rows of data
data
Data frame containing phenotype data
all_conds
Character vector of all condtion names
param_names
Names of all model parameters
J
Total number of parameters
M
Structure of the parameter matrix
M_
A helper object
q_
A helper object
mu_pr
The mean vector for the multivariate normal prior
Sig_inv
The precision matrix for the multivariate normal prior
LD_Data
Data formatted as a list for LaplacesDemon
ld
Output from LaplacesDemon, the posterior sampler
intialize()
Intialize the R6 object
Bane$intialize()
A new 'Bane object'
create_model()
Create a new BaNE model
Bane$create_model(indep, dep, mu, lm, data)
indep
A character vector of independent variable names.
dep
A named list of dependent variables with their dependencies. List names are the dependent variable names and list elements are the corresponding vector of dependency names.
mu
Prior proportions for independent variables.
lm
Prior baseline proportions for dependent variables.
data
A dataframe whose columns are referenced by dep and indep
Updates the object with side effects
params_to_mat()
Helper function to structure parameters as a matrix
Bane$params_to_mat(p)
p
Vector of model parameters
A matrix of size (k+1) x k
LLX()
Log likelihood
Bane$LLX(p, data)
p
Vector of model parameters
data
A data matrix
The log likelihood value of 'p' given 'data'
LPR()
Log prior
Bane$LPR(p)
p
Vector of model parameters
The log prior evaluated at 'p'
LD_Model()
Log posterior
Bane$LD_Model(p, data)
p
Vector of model parameters
data
A data matrix
A posterior evalutions in LaplacesDemon format
run_chain()
Run the HMC sampler
Bane$run_chain(Iterations = 2000, Status = 100, Thinning = 5, eps = 0.1, L = 3)
Iterations
passed to 'LaplacesDemon'
Status
passed to 'LaplacesDemon'
Thinning
passed to 'LaplacesDemon'
eps
passed to 'LaplacesDemon'
L
passed to 'LaplacesDemon'
A LaplacesDemon object contain sampler info and posterior draws
maximum_likelihood()
Mode/ maximum likelihood
Bane$maximum_likelihood()
Output from the 'optim' function maximizng the likelihood function
post_subs()
Posterior sampled subcohort proportions
Bane$post_subs()
A list with subcohort, corresponding proportion draws, and a plot
plot_topology()
Plot the phenotype topology
Bane$plot_topology()
A ggplot with phenotype topology
print()
Print details about the object
Bane$print()
Side effects – printing
clone()
The objects of this class are cloneable with this method.
Bane$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.