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 was originally to provide more
     robust 'pdMat' classes for 'lme' for use by 'gamm'. Currently the
     'notExp2' and 'notLog2' functions are used in their place, as a
     result of changes to the nlme optimization routines.

_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.maths.bath.ac.uk/~sw283/>

_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!

