calibrate                package:VGAM                R Documentation

_M_o_d_e_l _C_a_l_i_b_r_a_t_i_o_n_s

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

     'calibrate' is a generic function used to produce calibrations
     from various model fitting functions.  The function invokes
     particular `methods' which depend on the `class' of the first
     argument.

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

     calibrate(object, ...)

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

  object: An object for which a calibration is desired. 

     ...: Additional arguments affecting the calibration produced.
          Usually the most important argument in '...' is 'newdata'
          which, for 'calibrate', contains new _response_ data, *Y*,
          say. 

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

     Given a regression model with explanatory variables *X* and
     response *Y*, calibration involves estimating *X* from *Y* using
     the regression model. It can be loosely thought of as the opposite
     of 'predict' (which takes an *X* and returns a *Y*.)

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

     In general, given a new response *Y*, the explanatory variables
     *X* are returned. However, for constrained ordination models such
     as CQO and CAO models, it is usually not possible to return *X*,
     so the latent variables are returned instead (they are linear
     combinations of the *X*). See the specific 'calibrate' methods
     functions to see what they return.

_N_o_t_e:

     This function was not called 'predictx' because of the inability
     of constrained ordination models to return *X*; they can only
     return the latent variable values (site scores) instead.

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

     T. W. Yee

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

     'predict', 'calibrate.qrrvglm'.

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

     data(hspider)
     hspider[,1:6] = scale(hspider[,1:6]) # Standardized environmental vars
     set.seed(123)
     p1 = cao(cbind(Pardlugu, Pardmont, Pardnigr, Pardpull, Zoraspin) ~
              WaterCon + BareSand + FallTwig + 
              CoveMoss + CoveHerb + ReflLux,
              family = poissonff, data = hspider, Rank = 1,
              df1.nl = c(Zoraspin=2, 1.9),
              Bestof = 3, Crow1positive = TRUE)

     siteNos = 1:2  # Calibrate these sites
     cp1 = calibrate(p1, new=data.frame(p1@y[siteNos,]), trace=TRUE)

     ## Not run: 
     # Graphically compare the actual site scores with their calibrated values
     persp(p1, main="Solid=actual, dashed=calibrated site scores",
           label=TRUE, col="blue", las=1)
     abline(v=lv(p1)[siteNos], lty=1, col=1:length(siteNos)) # actual site scores
     abline(v=cp1, lty=2, col=1:length(siteNos)) # calibrated values
     ## End(Not run)

