fit-methods             package:Rtreemix             R Documentation

_M_e_t_h_o_d _f_o_r _f_i_t_t_i_n_g _m_u_t_a_g_e_n_e_t_i_c _t_r_e_e_s _m_i_x_t_u_r_e _m_o_d_e_l _t_o _a _g_i_v_e_n _d_a_t_a_s_e_t

_D_e_s_c_r_i_p_t_i_o_n:

     Function for fitting a mutagenetic trees mixture model to a given
     dataset 'data'. The dataset and the number of trees 'K' have to be
     specified. The function estimates K-oncogenetic trees mixture
     model from the specified data by using an EM-like learning
     algorithm. The first tree component of the model has a star
     topology and is referred to as the noise component.

_U_s_a_g_e:

     ## S4 method for signature 'RtreemixData, numeric':
     fit(data, K, ...)

_A_r_g_u_m_e_n_t_s:

    data: An 'RtreemixData' object giving the dataset used for learning
          the trees mixture model.

       K: An 'integer' larger than 0 specifying the number of
          branchings in the mixture model.

     ...: 'no.start.sol' is an 'integer' larger than 0 specifying the
          number of starting solutions for the k-means algorithm. The
          default value is 100. 'eps' is a 'numeric' giving the minimum
          conditional probability to include edge. The default value is
          0.01. 'weighing' is a 'logical' specifying whether to use
          special weights log(Pr(v)) for the edges (root, v). The
          default value is 'FALSE'. 'equal.edgeweights' is a 'logical'
          specifying whether to use equal edge weights in the noise
          component. The default value is 'TRUE'. 'seed' is a positive
          'integer' specifying the random generator seed. The default
          value is (-1) and then the time is used as a random
          generator. 'noise' is a 'logical' indicating the presence of
          a noise (star) component in the fitted mixture model. It is
          mostly relevant for models with a single tree component,
          since it is assumed that mixture models with at least two
          components always have the noise as a first component. 

_D_e_t_a_i_l_s:

     When K = 1 and noise = FALSE a single mutagenetic tree is fit to
     the data. When K = 1 and noise = TRUE a star mutagenetic tree is
     fit to the data. If K > 1 the first mutagenetic tree is always the
     star, i.e. the case K > 1 and noise = FALSE is not possible.

_V_a_l_u_e:

     The method returns an 'RtreemixModel' object that represents the
     K-trees mixture model learned from the given dataset.

_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', 'generate-methods',
     'bootstrap-methods', 'confIntGPS-methods'

_E_x_a_m_p_l_e_s:

     ## Create an RtreemixData object from a randomly generated RtreemixModel object.
     rand.mod <- generate(K = 3, no.events = 9, noise.tree = TRUE, prob = c(0.2, 0.8))
     data <- sim(model = rand.mod, no.draws = 300)
     show(data)

     ## Create an RtreemixModel object by fitting model to the given data.
     mod <- fit(data = data, K = 3, equal.edgeweights = TRUE, noise = TRUE)
     show(mod)
     ## See the number of tree components in the mixture model.
     numTrees(mod)
     ## See the weights of the branchings from the fitted mixture model.
     Weights(mod)
     ## See a specific tree component k.
     getTree(object = mod, k = 2)

