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 

