PTBmu.gen              package:accuracy              R Documentation

_g_e_n_e_r_a_t_o_r _f_u_n_c_t_i_o_n_s _f_o_r _m_u_l_t_i_p_l_e _r_o_u_n_d_s _o_f _n_o_i_s_e

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

     These functions generate a function that will apply multiple
     rounds of noise. These are helper functions for 'perturb', and
     generate functions of the form of 'PTBn'. They are used to select
     the type and magnitude of noise applied to each vector in the data
     frame, when running the perturbation sensitivity analysis. Use
     them only  if they are substantively justified - you can also
     supply custom functions for use with this perturbation framework.

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

             PTBmu.gen(reps=1)                       # return a perturbation function that
             PTBmn.gen(reps=1)                       # applies multiple rounds of noise

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

    reps: number of rounds of noise to apply 

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

     Used to generate functions for use in 'perturb'

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

     Returns a function of the form 'PTBn' or  'PTBi', with the
     modification that _reps_  rounds of noise are applied for each
     perturbation.

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

     Micah Altman Micah_Altman@harvard.edu <URL:
     http://www.hmdc.harvard.edu/micah_altman/>

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

     Altman, M., J. Gill and M. P. McDonald.  2003.  _Numerical Issues
     in Statistical Computing for the Social Scientist_.  John Wiley &
     Sons. <URL: http://www.hmdc.harvard.edu/numerical_issues/>

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

     'perturb', 'PTBi'

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

             x=1:1000
             f1=PTBmu.gen(); # should be roughly equivalent to PTBu() 
             x.u = f1(x,size=1)
             mean(x-x.u)  #should be small
             f2=PTBmu.gen(reps=100); # multiple disturbances tend to cancel eachother out
             x.u2 = f2(x,size=1)
             mean(x-x.u2)  #should be smaller 

