iBAG_results | R Documentation |
R6 class to store and manage the iBAG results. This does not contain a copy of the iBAG_data object.
constructor
iBAG_results$new()
new()
constructor
iBAG_results$new( X = matrix(0, 1, 1), Y = c(0), SS = list(c(0), c(0), c(0)), beta_mean = c(0), beta_incl_prob = c(0), DEBUG = FALSE, validate = TRUE, ... )
X
(NULL): the total X matrix generated by the mech model
Y
(NULL): the vector of outcomes that goes into the clinical model
SS
(list(NULL,NULL)): a list of vectors representing the Sum of Squares Error from the mechanistic model.
beta_mean
(NULL): a vector of posterior means for the coefficients from the clinical model.
beta_incl_prob
(NULL): a vector of posterior inclusion probabilities for the beta coefficients.
DEBUG
(FALSE): initialize object in DEBUG model.
validate
(TRUE): validate the data coming in from the constructor (or any of the setters)
...
: ...
This constructs a class containing all the results from the iBAG object. Some additional details:
SS:
The list size is always >2. The 1st element is the SST, the last element is the SSO, the middle elements correspond to the sum of squares from the datasets.
validate:
minimum data required to validate is X,Y,SS (all produced by mechmodel)
if this data is not provided will issue warning & set validate to FALSE
n_data is derived from length(SS)-2
n_patients is derived as the nrow(X)
check that ncol(X)%n_data == 0
if not throw error
if true: n_genes = ncol(X)%/%n_data
check that length(Y) == n_patients
if not throw error
for each item in SS
check that length(item) == n_genes
if not throw error
if beta_mean & beta_incl_prob are included
check that their length == ncol(X)
if not throw error
This does not check that the data is in a numeric form! (Check that yourself) get.X
get.X()
returns X matrix
iBAG_results$get.X()
matrix that should be n_patients rows and n_genes*n_data columns get.Y
get.Y()
returns Y vector
iBAG_results$get.Y()
vector that is n_patients long get.SS
get.SS()
returns the Sum of Squares mech model results, either all or some of them
iBAG_results$get.SS(index = NULL)
index
(NULL) can be NULL, integer, or string. If NULL returns list, otherwise returns the vector at index
a vector or a list of vectors get.beta_mean
get.beta_mean()
returns the vector of posterior beta means
iBAG_results$get.beta_mean()
a vector of posterior beta means get.beta_incl_prob
get.beta_incl_prob()
returns a vector of posterior beta inclusion probabilities
iBAG_results$get.beta_incl_prob()
a vector of posterior beta inclusion probabilities get.n_patients
get.n_patients()
returns the number of patients
iBAG_results$get.n_patients()
integer of number of patients get.genes
get.n_genes()
returns the number of genes
iBAG_results$get.n_genes()
integer of number of genes get.n_data
get.n_data()
returns the number of upstream datasets
iBAG_results$get.n_data()
integer of number of upstream datasets
clone()
The objects of this class are cloneable with this method.
iBAG_results$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.