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)

