notExp2                 package:mgcv                 R Documentation

_A_l_t_e_r_n_a_t_i_v_e _t_o _l_o_g _p_a_r_a_m_e_t_e_r_i_z_a_t_i_o_n _f_o_r _v_a_r_i_a_n_c_e _c_o_m_p_o_n_e_n_t_s

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

     'notLog2' and 'notExp2' are alternatives to 'log' and 'exp' or
     'notLog' and 'notExp' for re-parameterization of variance
     parameters. They are used by the 'pdTens' and 'pdIdnot' classes
     which in turn implement smooths for 'gamm'.

     The functions are typically used to ensure that smoothing
     parameters are positive, but the 'notExp2' is not monotonic:
     rather it cycles between `effective zero' and `effective infinity'
     as its argument changes. The 'notLog2' is the inverse function of
     the 'notExp2' only over an interval centered on zero.

     Parameterizations using these functions ensure that estimated
     smoothing parameters remain positive, but also help to ensure that
     the likelihood is never indefinite: once a working parameter
     pushes a smoothing parameter below `effetive zero' or above
     `effective infinity' the cyclic nature of the 'notExp2' causes the
     likelihood to decrease, where otherwise it might simply have
     flattened. 

     This parameterization is really just a numerical trick, in order
     to get 'lme' to fit 'gamm' models, without failing due to
     indefiniteness.  Note in particular that asymptotic results on the
     likelihood/REML criterion are  not invalidated by the trick,
     unless parameter estimates end up close to the effective zero or
     effective infinity: but if this is the case then the asymptotics
     would also have been invalid for a conventional monotonic
     parameterization.

     This reparameterization was made necessary by some modifications
     to the underlying optimization method in  'lme' introduced in nlme
     3.1-62. It is possible that future releases will return to the
     'notExp' parameterization.

     Note that you can reset `effective zero' and `effective infinity':
     see below.

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

     notExp2(x,d=.Options$mgcv.vc.logrange,b=1/d)

     notLog2(x,d=.Options$mgcv.vc.logrange,b=1/d)

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

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

       d: the range of 'notExp2' runs from 'exp(-d)' to 'exp(d)'. To
          change the range used by 'gamm' reset 'mgcv.vc.logrange'
          using 'options'.

       b: determines the period of the cycle of 'notExp2'.

_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 notExp2 function:
     x <- seq(-50,50,length=1000)
     op <- par(mfrow=c(2,2))
     plot(x,notExp2(x),type="l")
     lines(x,exp(x),col=2)
     plot(x,log(notExp2(x)),type="l")
     lines(x,log(exp(x)),col=2) # redundancy intended
     x <- x/4
     plot(x,notExp2(x),type="l")
     lines(x,exp(x),col=2)
     plot(x,log(notExp2(x)),type="l")
     lines(x,log(exp(x)),col=2) # redundancy intended
     par(op)

