fix.family.link package:mgcv R Documentation _M_o_d_i_f_y _f_a_m_i_l_i_e_s _f_o_r _u_s_e _i_n _G_A_M _f_i_t_t_i_n_g _D_e_s_c_r_i_p_t_i_o_n: Generalized Additive Model fitting by `outer' iteration, requires extra derivatives of the variance and link functions to be added to family objects. The functions add what is needed. _U_s_a_g_e: fix.family.link(fam) fix.family.var(fam) fix.family.ls(fam) _A_r_g_u_m_e_n_t_s: fam: A 'family'. _D_e_t_a_i_l_s: Outer iteration GAM estimation requires derivatives of the GCV, UBRE/gAIC, GACV, REML or ML score, which are obtained by finding the derivatives of the model coefficients w.r.t. the log smoothing parameters, using the implicit function theorem. The expressions for the derivatives require the second and third derivatives of the link w.r.t. the mean (and the 4th derivatives if Fisher scoring is not used). Also required are the first and second derivatives of the variance function w.r.t. the mean (plus the third derivative if Fisher scoring is not used). Finally REML or ML estimation of smoothing parameters requires the log saturated likelihood and its first two derivatives w.r.t. the scale parameter. These functions add functions evaluating these quantities to a family. If the family already has functions 'dvar', 'd2var', 'd3var', 'd2link', 'd3link', 'd4link' and for RE/ML 'ls', then these functions simply return the family unmodified: this allows non-standard links to be used with 'gam' when using outer iteration (performance iteration operates with unmodified families). Note that if you only need Fisher scoring then 'd4link' and 'd3var' can be dummy, as they are ignored. similalry 'ls' is only needed for RE/ML. The 'dvar' function is a function of a mean vector, 'mu', and returns a vector of corresponding first derivatives of the family variance function. The 'd2link' function is also a function of a vector of mean values, 'mu': it returns a vector of second derivatives of the link, evaluated at 'mu'. Higher derivatives are defined similarly. If modifying your own family, note that you can often get away with supplying only a 'dvar' and 'd2var', function if your family only requires links that occur in one of the standard families. _V_a_l_u_e: A family object with extra component functions 'dvar', 'd2var', 'd2link', 'd3link', 'd4link' and 'ls'. _A_u_t_h_o_r(_s): Simon N. Wood simon.wood@r-project.org _S_e_e _A_l_s_o: 'gam.fit3'