gpuLr                package:gputools                R Documentation

_A _T_o_y _L_o_g_i_s_t_i_c _R_e_g_r_e_s_s_i_o_n _R_o_u_t_i_n_e

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

     This function is an demonstration of logistic regression.  The
     matrix QR decomposition implemented by this function is not quite
     up to snuff.  The regression is not numerically stable and doesn't
     handle inputs that give  rise to rank deficient matrices.  We hope
     to release a better version of this in the future.

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

             gpuLr(obs, outcomes, epsilon=0.00001, ridge=0.00001, maxiter=200)

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

     obs: a matrix of floating point numbers.  Each column is an
          observed set of parameters (inputs) for the logistic
          function.

outcomes: a vector of floating point numbers.  Each value is an
          observed output when the corresponding column of the 'obs'
          argument is input into the logistic function.

 epsilon: a floating point number.  When the sum of squares of the 
          difference between outputs of the logistic functions on input
          of obs is less than the number of  columns of obs times
          epsilon squared, the regression is declared to have converged
          and the iteration stops.

   ridge: a floating point number.  Amount of error to introduce during
           the iterations of the regression to aid convergence.

 maxiter: an integer.  Maximum number of iterations that the regression
          will be allowed to execute without converging.

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

     a vector of floating point numbers of length 'nrow(obs)'.  The
     coefficients  of the logistic function fitted to 'obs' and
     'outcomes'.

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

     glm

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

     numParameters <- 5
     numExperiments <- 5
     observationMat <- matrix(runif(numParameters*numExperiments), numParameters, 
             numExperiments)
     obsOutcomes <- runif(numExperiments)
     for(i in 1:numExperiments) {
             if(obsOutcomes[i] > 0.5) {
                     obsOutcomes[i] <- 1
             } else {
                     obsOutcomes[i] <- 0
             }
     }
     gpuLr(observationMat, obsOutcomes)

