simulateData              package:ccems              R Documentation

_S_i_m_u_l_a_t_e _D_a_t_a

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

     This function generates expected values of responses at the total
     concentrations  of the dataframe 'g$d'   or at points specified in
     'predict' if 'predict' is not 'NULL'.

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

      simulateData(g, init = FALSE, predict = NULL, typeYP = NULL) 

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

       g: A specific model/hypothesis created by 'mkModel'. 

    init: This is 'TRUE' only in first calls to this function by the
          parameter estimate optimization algorithm.  When 'TRUE' the
          initial AIC value is set. 

 predict: A dataframe of total concentrations of the reactants  at
          which response predictions are desired.  

  typeYP: The type of output data desired for the predictions.  Options
          are "m" and "v" for average mass and reaction velocity,
          respectively.  

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

     This function is the workhorse core of the nonlinear least squares
      algorithm, so its speed is  critical which is why it uses
     compiled C code when 'g$TCC = TRUE'.  In addition to model
     fitting, this function can also be used to predict  system
     response surfaces over grids of physiologically relevant total
     concentrations of the reactants.  It is assumed that the model
     used to formulate predictions is based on data, and that the
     output type of the predictions is the same as the output type used
     to build the model.

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

     The input model object augmented to include the following fields
     if 'predict' is 'NULL'. 

    echk: A matrix that checks the TCC solver and 'g$fback'. Matrix
          column names  that end in Q should match their sans-Q
          counterparts. 

     eSS: The expected steady state concentrations of species
          (complexes and free reactants).  For each row of the data
          dataframe there is a row in this matrix. Its contents are the
          TCC solver solution (free reactant  expected concentrations)
          and the result of applying  'g$fback' to them to create
          expected complex concentrations.  

     res: The residuals of the fit.

   nData: The number of data points (i.e. rows) in the data dataframe
          'g$d'.

     SSE: The initial and final sum of squared errors (i.e. residual
          sum of squares).

     AIC: The initial and final Akaike Information Criterion values,
          corrected for small samples. S ince nonlinear least squares
          is used   'AIC = N*log(SSE/N)+2*P + 2*P*(P+1)/(N-P-1) +
          N*log(2*pi) + N ' where  'N = nData' and 'P' is the  number
          of estimated parameters (including the variance).

 predict: The input argument 'predict' with an additional  expected
          system response column named "EY".

_N_o_t_e:

     The function 'fitModel' augments the input model object by the
     same six fields above because  it calls this function iteratively. 

     Measurements are often made at total concentrations that are
     substantially  higher than physiological values due to 
     signal-to-noise limitations. Thus, predictions in physiologically
     relevant  (and thus important) regions tend to be weak. 

     This work was supported by the National Cancer Institute
     (K25CA104791).

_A_u_t_h_o_r(_s):

     Tom Radivoyevitch (txr24@case.edu)

_R_e_f_e_r_e_n_c_e_s:

     Radivoyevitch, T. (2008) Equilibrium model selection: dTTP induced
     R1 dimerization.  _BMC Systems Biology_ *2*, 15.

_S_e_e _A_l_s_o:

     The experimental design example 'expDesign' in the 'docs'
     directory.

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

     library(ccems)
     topology <- list(  
             heads=c("R1t0","R2t0"),  
             sites=list(       
                     s=list(                     # s-site    thread #
                             m=c("R1t1"),        # monomer      1
                             d=c("R2t1","R2t2")  # dimer        2
                     )
             )
     ) 
     g <- mkg(topology,TCC=TRUE) 
     d=subset(RNR,(year==2001)&(fg==1)&(t>0)&(G==0),select=c(R,t,m,year))
     names(d)[1:2] <-c("RT","tT") 
     mdl=mkModel(g,"IIIJ",d,Kjparams=c(R2t0=Inf, R1t1=Inf,R2t1=Inf, R2t2=1),pparams=c(p=1))
     fmdl <- fitModel(mdl)
     pt=c(.1,1:20)
     predict <- data.frame(RT = rep(7.6,length(pt)), tT = pt)
     df <- simulateData(fmdl,predict=predict,typeYP="m")$predict  
     plot(d$tT,d$m,type="p",  xlab="[dTTP] (uM)", ylab="Weight averaged R1 mass", 
          main="Scott et al. Biochemistry, 2001, Fig. 1 (DLS data)")
     lines(df$tT,df$EY) 

