title: MLE error in R: non-finite finite-difference value/ value in 'vmmin' is not finite
body: <p>I am working on a loss aversion model in R (beginner) and want to estimate some parameters, from a dataset with 3 columns (loss/gain values (both continous and a column with decisions coded as 0 or 1 (binary)) 
  dropbox.com/s/fpw3obrqcx8ld1q/GrandAverage.RData?dl=0 
  The part of the code if have to use for this I am using is given below:</p>
  
  <pre><code>set &lt;- GrandAverage[, 5:7];
    Beh.Parameters &lt;- function (lambda, alpha, temp) {
   u = 0.5 * set$Gain^alpha + 0.5 * lambda * set$Loss^alpha
    GambleProbability &lt;- 1 / (1 + exp(-temp * u))
  
    loglike &lt;- set$Decision*log(GambleProbability) + 
      (1- set$Decision)*log(1-GambleProbability)   
  
    return(-sum(loglike))
   }
  
    temp_s &lt;- 0.1 #runif(1, 0.1, 1)
  
    ML.estim1  &lt;- mle(Beh.Parameters, start = list (lambda = 1, alpha = 1, temp = temp_s), nobs = length(set$Decision))
    ML.estim2  &lt;- mle(Beh.Parameters, start = list(lambda = 0.1, alpha = 0.1,  temp = temp_s), nobs = length(set$Decision))
  </code></pre>
  
  <p>I use the mle function in order to estimate the 3 parameters (lambda, alpha and temp), without the alpha i receive this output for example:</p>
  
  <blockquote>
    <p>ML.estim1
    Call:
    mle(minuslogl = Beh.Parameters, start = list(lambda = 1, temp = temp_s), 
        nobs = length(set$Decision))
    Coefficients:
      lambda     temp 
    1.298023 1.041057</p>
  </blockquote>
  
  <p>When I try to run it without the alpha parameter it works fine but when I include it I received these two errors:  </p>
  
  <blockquote>
    <p>Error in optim(start, f, method = method, hessian = TRUE, ...) :
    non-finite finite-difference value [2] (for the first MLE) Error in
    optim(start, f, method = method, hessian = TRUE, ...) :    initial
    value in 'vmmin' is not finite (for the second MLE)</p>
  </blockquote>
  
  <p>I tried to recode the matrix, singular value decomposition, BFGS etc. 
  Any help is welcome...thanks in advance.</p>