minPenalty            package:smoothSurv            R Documentation

_M_i_n_i_m_i_z_e _t_h_e _p_e_n_a_l_t_y _t_e_r_m _u_n_d_e_r _t_h_e _t_w_o (_m_e_a_n _a_n_d _v_a_r_i_a_n_c_e)
_c_o_n_s_t_r_a_i_n_t_s

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

     This function minimizes 

                  0.5*sum[j=m+1][g] (Delta^m a[j])^2

     with respect to a[1],...,a[g] under the constraints

                      sum[j=1][g] c[j]mu[j] = 0

     and

              sum[j=1][g] c[j](mu[j]^2 + sigma0^2) = 1,

     where 

                c[j] = exp(a[j])/sum[l=1][g]exp(a[l])

     with one of a's fixed to zero.

     Note that the minimum is always zero. We are thus mainly
     interested in the point where the minimum is reached.

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

     minPenalty(knots = NULL, dist.range = c(-6, 6), by.knots = 0.3, sdspline = NULL,
         difforder = 3, init.c,
         maxiter = 200, rel.tolerance = 1e-10, toler.chol = 1e-15, toler.eigen = 1e-3,
         maxhalf = 10, debug = 0, info = TRUE)

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

   knots: A vector of knots mu[1], ..., mu[g]. 

dist.range: Approximate minimal and maximal knot. If not given by
          'knots' the knots are determined as 'c(seq(0, dist.range[2],
          by = by.knots), seq(0, dist.range[1], by = -by.knots))'. The
          sequence of knots is sorted and multiple entries are removed. 

by.knots: The distance between the two knots used when building a
          vector of knots if these are not given by 'knots'. 

sdspline: Standard deviation sigma0^2 of the basis G-spline (here it
          appeares only in the variance constraint). If not given it is
          determined as 2/3 times the maximal distance between the two
          knots. If  'sdspline' >= 1 it is changed to 0.9 to be able to
          satisfy the constraints. 

difforder: The order of the finite difference used in the penalty term. 

  init.c: Optional vector of the initial values for the G-spline
          coefficients c, all values must lie between 0 and 1 and must
          sum up to 1. 

 maxiter: Maximum number of Newton-Raphson iterations. 

rel.tolerance: (Relative) tolerance to declare the convergence. For
          this function, the convergence is declared if absolute value
          of the penalty is lower than 'rel.tolerance' and if both
          constraints are satisfied up to 'rel.tolerance'. 

toler.chol: Tolerance to declare Cholesky decomposition singular. 

toler.eigen: Tolerance to declare an eigen value of a matrix to be
          zero. 

 maxhalf: Maximum number of step-halving steps if updated estimate
          leads to a decrease of the objective function. 

   debug: If non-zero print debugging information. 

    info: If TRUE information concerning the iteration process is
          printed during the computation to the standard output. 

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

     A list with the components ``spline'', ``penalty'', ``warning'',
     ``fail''. 

  spline: A data frame with columns named ``Knot'', ``SD basis'', ``c
          coef.'' and ``a coef.'' which gives the optimal values of
          c[1],...,c[g] and  a[1],...,a[g] in the latter two columns.
          This data.frame can be further worked out using the function
          'eval.Gspline'.

 penalty: The value of the penalty term when declaring convergence.

 warning: Possible warnings concerning the convergence.

    fail: Failure indicator. It is zero if everything went OK.

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

     Arno&#353t Kom&#225rek komarek@karlin.mff.cuni.cz

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

     optimum <- minPenalty(knots=seq(-4.2, 4.2, by = 0.3), sdspline=0.2, difforder=3)
     where <- optimum$spline
     print(where)
     show <- eval.Gspline(where, seq(-4.2, 4.2, by=0.05))
     plot(show, type="l", bty="n", lwd=2)

