boxcox                 package:geoR                 R Documentation

_T_h_e _B_o_x-_C_o_x _T_r_a_n_s_f_o_r_m_e_d _N_o_r_m_a_l _D_i_s_t_r_i_b_u_t_i_o_n

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

     Functions related with the Box-Cox family of transformations.
     Density and random generation for the Box-Cox transformed normal
     distribution with mean equal to 'mean' and standard deviation
     equal to 'sd', _in the normal scale_.

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

     rboxcox(n, lambda, lambda2 = NULL, mean = 0, sd = 1)

     dboxcox(x, lambda, lambda2 = NULL, mean = 0, sd = 1)

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

  lambda: numerical value(s) for the transformation parameter lambda.  

 lambda2: logical or numerical value(s) of the additional
          transformation (see DETAILS below). Defaults to 'NULL'.  

       n: number of observations to be generated.  

       x: a vector of quantiles ('dboxcox') or an output of
          'boxcox.fit' ('print', 'plot', 'lines').  

    mean: a vector of mean values at the normal scale.  

      sd: a vector of standard deviations at the normal scale.  

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

     Denote Y the variable at the original scale and Y' the transformed
     variable. The Box-Cox transformation is defined by:


 Y' = log(Y) if lambda = 0 , Y' = ((Y ^ lambda) - 1)/lambda otherwise

     . 

     An additional shifting parameter lambda2 can be included in which
     case the transformation is given by: 


 Y' = log(Y + lambda2) if lambda = 0 , Y' = (((Y + lambda2) ^ lambda) - 1)/lambda otherwise

     .

     The function 'rboxcox' samples Y' from the normal distribution
     using the function 'rnorm' and backtransform the values according
     to the equations above to obtain values of Y. If necessary the
     back-transformation truncates the values such that Y' >= -1/lambda
     results in Y = 0 in the original scale. Increasing the value of
     the mean and/or reducing the variance might help to avoid
     truncation.

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

     The functions returns the following results: 

 rboxcox: a vector of random deviates.  

 dboxcox: a vector of densities.  

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

     Paulo Justiniano Ribeiro Jr. paulojus@leg.ufpr.br, 
      Peter J. Diggle p.diggle@lancaster.ac.uk.

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

     Box, G.E.P. and Cox, D.R.(1964) An analysis of transformations.
     JRSS B *26*:211-246.

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

     The parameter estimation function 'boxcox.fit', the function
     'boxcox' in the package 'MASS' and the function 'boxcox' in the
     package 'car'.

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

     ## Simulating data
     simul <- rboxcox(100, lambda=0.5, mean=10, sd=2)
     ##
     ## Comparing models with different lambdas,
     ## zero  means and unit variances
     curve(dboxcox(x, lambda=-1), 0, 8)
     for(lambda in seq(-.5, 1.5, by=0.5))
       curve(dboxcox(x, lambda), 0, 8, add = TRUE)

