tunePed             package:MasterBayes             R Documentation

_t_u_n_e_P_e_d _O_b_j_e_c_t

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

     An object containing scaling constants for the tuning parameters
     used in the Metropolis-Hastings updates.  The tuning parameters
     should be set so that the Metropolis-Hastings acceptance rates lie
     between 0.2 and 0.5.  Initial tuning parameters for beta and the
     unsampled population size are obtained from the large sample
     variance-covariances of the Maximum Likelihood estimates.

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

     tunePed(E1 = NULL, E2 = NULL, beta = NULL, USdam = NULL, 
        USsire = NULL,...)

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

      E1: vector of scaling parameters for the allelic dropout rates

      E2: vector of scaling parameters for the stochastic error rates

    beta: vector which is multiplied by 'sqrt(10)' to get scaling
          parameters for beta

   USdam: vector which is multiplied by '10' to get scaling parameters
          for the number of unsampled females

  USsire: vector which is multiplied by '10' to get scaling parameters
          for the number of unsampled males

     ...: further arguments to be passed

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

     The proposal distribution for all parameters is the multivariate
     normal, the variances of which are the large sample  variance
     covariances of the Maximum Likelihood estimates multiplied by the
     scaling constants.  For all parameters except 'beta', the
     covariance matrix for the proposal distribution has all
     off-diagonal elements set to zero.  These parameters must be
     positive and so the proposal distribution is reflected at zero. A
     diagonal covariance matrices ensures that the proposal
     distribution remains symetric.  For beta the covariances are not
     constrained at zero, and so the matrices are multiplied by the
     scaling constants in a way that preserves the correlational
     structure.  The tuning parameters for the error rates are the
     scaling constants multiplied by 3e-5.

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

     list containing the arguments passed

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

     Jarrod Hadfield j.hadfield@sheffield.ac.uk

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

     'MCMCped'

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

     data(WarblerG)
     A<-extractA(WarblerG)

     ped<-matrix(NA, 100,3)
     ped[,1]<-1:100

     G<-simgenotypes(A, ped=ped, E1=0.1, E2=0.001, no_dup=2)
     GdP<-GdataPed(G=G$Gobs, id=G$id)

     model1<-MCMCped(GdP=GdP, nitt=1500, thin=1, burnin=500)

     # The proposal distribution is to conservative for E1
     # and the update is accepted about 70% of the time

     plot(model1$E1)
     autocorr(model1$E1)

     # Succesive samples from the posterior distribution are 
     # strongly autocorrelated.  Should of course run the chain
     # for longer with a larger thinning interval, but a greater
     # tuning parameter helps (now 3e-4, rather than 3e-5):

     model2<-MCMCped(GdP=GdP, tP=tunePed(E1=10), nitt=1500, 
       thin=1, burnin=500)

     plot(model2$E1)
     autocorr(model2$E1)

