RtreemixStats-class         package:Rtreemix         R Documentation

_C_l_a_s_s "_R_t_r_e_e_m_i_x_S_t_a_t_s"

_D_e_s_c_r_i_p_t_i_o_n:

     The 'RtreemixStats' class contains the (weighted, log) likelihoods
     for a given dataset (specified by the parent class) derived from
     the probability distribution induced by an underlying mutagenetic
     trees mixture model.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("RtreemixStats",
     Data, Model, LogLikelihoods, WLikelihoods)'. The class
     'RtreemixStats' extends the 'RtreemixData' class and specifies
     (log, weighted) likelihoods for these data derived from a given
     'RtreemixModel'. The number of the genetic events in the patterns
     from the given dataset ('Data') has to be equal to the number of
     genetic events in the branchings from the mixture model given by
     the slot 'Model'. When having the weighted likelihoods, one can
     easily derive the responsibilities of the model components in
     'Model' for generating the patterns in the specified dataset
     ('Data').

     The 'Data' is an 'RtreemixData' object that specifies the patterns
     for which the likelihoods are calculated.

     The 'Model' is an 'RtreemixModel' object that specifies the
     mutagenetic trees mixture model used for deriving the likelihoods
     of the given data. 

     The 'LogLikelihoods' is a numeric 'vector' that contains the
     log-likelihoods of the patterns in 'Data'. Its length equals the
     sample size, i.e. the number of patients in 'Data'.

     The 'WLikelihoods' is a numeric 'matrix' that specifies the
     weighted likelihoods of each pattern in the given dataset 'Data'.
     The number of columns in 'WLikelihoods' equals the number of tree
     components in 'Model' and the number of rows equals the number of
     patients in 'Data'.

_S_l_o_t_s:


     '_M_o_d_e_l': Object of class '"RtreemixModel"'.

     '_L_o_g_L_i_k_e_l_i_h_o_o_d_s': Object of class '"numeric"'. The length of
          'LogLikelihoods' must be equal to the number of patients of
          the dataset specified with the parent '"RtreemixData"' class.

     '_W_L_i_k_e_l_i_h_o_o_d_s': Object of class '"matrix"'. The number of rows
          must be equal to the sample size of the dataset specified
          with the parent '"RtreemixData"' class. The number of columns
          must be identical with the number of tree components in the
          mixture model 'Model'.

_E_x_t_e_n_d_s:

     Class '"RtreemixData"', directly.

_M_e_t_h_o_d_s:


     _L_o_g_L_i_k_e_l_i_h_o_o_d_s 'signature(object = "RtreemixStats")': A method for
          obtaining the log-likelihoods of the patterns in the dataset
          specified with the parent '"RtreemixData"' class.

     _M_o_d_e_l 'signature(object = "RtreemixStats")': A method for
          obtaining the mutagenetic trees mixture model used for
          deriving the likelihoods.

     _W_L_i_k_e_l_i_h_o_o_d_s 'signature(object = "RtreemixStats")': A method for
          obtaining the weighted likelihoods of the patterns in the
          dataset specified with the parent '"RtreemixData"' class.

     _g_e_t_D_a_t_a 'signature(object = "RtreemixStats")': A method for
          obtaining the dataset specified with the parent
          '"RtreemixData"' class.

     _g_e_t_R_e_s_p 'signature(object = "RtreemixStats")': A method for
          computing the matrix of responsibilities for the trees to
          generate each of the samples in the parent dataset from their
          weighted likelihoods 'WLikelihoods'.

_A_u_t_h_o_r(_s):

     Jasmina Bogojeska

_R_e_f_e_r_e_n_c_e_s:

     Learning multiple evolutionary pathways from cross-sectional data,
     N. Beerenwinkel et al.

_S_e_e _A_l_s_o:

     'RtreemixData-class', 'RtreemixModel-class', 'fit-methods',
     'likelihoods-methods'

_E_x_a_m_p_l_e_s:

     ## Generate a random RtreemixModel object with 3 components and 9 genetic events.
     mod <- generate(K = 3, no.events = 9, noise.tree = TRUE, prob = c(0.2, 0.8))
     show(mod)

     ## Draw a data sample from the model mod.
     data <- sim(model = mod, no.draws = 400)

     ## Create an RtreemixStats object.
     mod.stat <- likelihoods(model = mod, data = data)
     show(mod.stat)

     ## See the slots from the RtreemixStats object.
     Model(mod.stat)
     LogLikelihoods(mod.stat)
     WLikelihoods(mod.stat)
     ## See data.
     getData(mod.stat)
     ## Calculate the responsibilities from the weighted likelihoods.
     getResp(mod.stat)

