gaussianff               package:VGAM               R Documentation

_G_a_u_s_s_i_a_n (_n_o_r_m_a_l) _F_a_m_i_l_y _F_u_n_c_t_i_o_n

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

     Fits a generalized linear model to a response with Gaussian
     (normal) errors.  The dispersion parameter may be known or
     unknown.

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

     gaussianff(dispersion = 0, parallel = FALSE, zero = NULL)

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

parallel: A logical or formula. If a formula, the response of the
          formula should be a logical and the terms of the formula
          indicates whether or not those terms are parallel.

dispersion: Dispersion parameter. If 0 then it is estimated and the
          moment estimate is put in 'object@misc$dispersion'; it is
          assigned the value

      sum_{i=1}^n    (y_i -  eta_i)^T W_i (y_i - eta_i) / (nM-p)

          where p is the total number of parameters estimated (for
          RR-VGLMs the value used is the number of columns in the large
          X model matrix; this may not be correct). If the argument is
          assigned a positive quantity then it is assumed to be known
          with that value.

    zero: An integer-valued vector specifying which linear/additive
          predictors are modelled as intercepts only.  The values must
          be from the set {1,2,...,M} where M is the number of columns
          of the matrix response.

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

     This function is usually used in conjunction with 'vglm', else
     'vlm' is recommended instead.   The notation M is used to denote
     the number of linear/additive predictors. This function can handle
     any finite M, and the default is to use ordinary least squares. A
     vector linear/additive model can be fitted by minimizing

          sum_{i=1}^n    (y_i -  eta_i)^T W_i (y_i - eta_i)

     where y_i is a M-vector, eta_i is the vector of linear/additive
     predictors. The W_i is any positive-definite matrix, and the
     default is the order-M identity matrix. The W_i can be inputted
     using the 'weights' argument of 'vlm'/'vglm'/'vgam' etc., and the
     format is the _matrix-band_ format whereby it is a n * A matrix
     with the diagonals are passed first, followed by next the upper
     band, all the way to the (1,M) element. Here, A has maximum value
     of M(M+1)/2 and a minimum value of M. Usually the 'weights'
     argument of 'vlm'/'vglm'/'vgam'/'rrvglm' is just a vector, in
     which case each element is multiplied by a order-M identity
     matrix. If in doubt, type something like 'weights(object,
     type="working")' after the model has been fitted.

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

     An object of class '"vglmff"' (see 'vglmff-class'). The object is
     used by modelling functions such as 'vglm', 'rrvglm' and 'vgam'.

_N_o_t_e:

     This 'VGAM' family function is supposed to be similar to
     'gaussian' but is is not compatible with 'glm'. The '"ff"' in the
     name is added to avoid any masking problems.

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

     Thomas W. Yee

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

     McCullagh, P. and Nelder, J. A. (1989) _Generalized Linear
     Models_, 2nd ed. London: Chapman & Hall.

     Yee, T. W. and Wild, C. J. (1996) Vector generalized additive
     models. _Journal of the Royal Statistical Society, Series B,
     Methodological_, *58*, 481-493.

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

     'normal1', 'vlm', 'vglm', 'vgam', 'rrvglm'.

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

     d = data.frame(x = sort(runif(n <- 40)))
     d = transform(d, y1 = 1 + 2*x + rnorm(n, sd=0.1),
                      y2 = 3 + 4*x + rnorm(n, sd=0.1),
                      y3 = 7 + 4*x + rnorm(n, sd=0.1))
     fit = vglm(cbind(y1,y2) ~ x, gaussianff, data=d)
     coef(fit, matrix=TRUE)

     # For comparison:
     coef( lmfit <-  lm(y1 ~ x, data=d))
     coef(glmfit <- glm(y2 ~ x, data=d, gaussian))
     vcov(fit)
     vcov(lmfit)

     t(weights(fit, type="prior"))         # Unweighted observations
     weights(fit, type="working")[1:4,]    # Identity matrices

     # Reduced-rank VLM (rank-1)
     fit2 = rrvglm(cbind(y1,y2,y3) ~ x, gaussianff, data=d)
     Coef(fit2)

