notExp                 package:mgcv                 R Documentation

_F_u_n_c_t_i_o_n_s _f_o_r _b_e_t_t_e_r-_t_h_a_n-_l_o_g _p_o_s_i_t_i_v_e _p_a_r_a_m_e_t_e_r_i_z_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     It is common practice in statistical optimization to use
     log-parameterizations when a  parameter ought to be positive. i.e.
     if an optimization parameter 'a' should be non-negative then  we
     use 'a=exp(b)' and optimize with respect to the unconstrained
     parameter 'b'. This often works  well, but it does imply a rather
     limited working range for 'b': using 8 byte doubles, for example, 
     if 'b''s magnitude gets much above 700 then 'a' overflows or
     underflows. This can cause  problems for numerical optimization
     methods. 

     'notExp' is a monotonic function for mapping the real line into
     the positive real line with much less extreme underflow and
     overflow behaviour than 'exp'. It is a piece-wise function, but is
     continuous  to second derivative: see the source code for the
     exact definition, and the example below to see what it  looks
     like.

     'notLog' is the inverse function of 'notExp'.

     The major use of these functions is to provide more robust 'pdMat'
     classes for 'lme' for use by 'gamm'.

_U_s_a_g_e:

     notExp(x)

     notLog(x)

_A_r_g_u_m_e_n_t_s:

       x: Argument array of real numbers ('notExp') or positive real
          numbers ('notLog').

_V_a_l_u_e:

     An array of function values evaluated at the supplied argument
     values.

_A_u_t_h_o_r(_s):

     Simon N. Wood simon.wood@r-project.org

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.stats.gla.ac.uk/~simon/>

_S_e_e _A_l_s_o:

     'pdTens', 'pdIdnot',  'gamm'

_E_x_a_m_p_l_e_s:

     ## Illustrate the notExp function: 
     ## less steep than exp, but still monotonic.
     x <- -100:100/10
     op <- par(mfrow=c(2,2))
     plot(x,notExp(x),type="l")
     lines(x,exp(x),col=2)
     plot(x,log(notExp(x)),type="l")
     lines(x,log(exp(x)),col=2) # redundancy intended
     x <- x/4
     plot(x,notExp(x),type="l")
     lines(x,exp(x),col=2)
     plot(x,log(notExp(x)),type="l")
     lines(x,log(exp(x)),col=2) # redundancy intended
     par(op)
     range(notLog(notExp(x))-x) # show that inverse works!

