title: Optimize: convert has no method matching
body: <p>This is the first time that I write Julia code. I am writing a function to calculate the Likelihood for linear mixed models with specific var-cov matrix for random terms. Then I want to use <code>optimize</code> from the <code>Optim</code> package to get the variance of random terms. However, I cannot make it work. </p>
  
  <p>The code and the example data are here: <a href="https://github.com/daijiang/pglmm.jl/blob/master/pglmm.jl" rel="nofollow">https://github.com/daijiang/pglmm.jl/blob/master/pglmm.jl</a> </p>
  
  <p>The code runs well in R but very slow. So I am trying to convert it into Julia. I have very little idea why this error happened. </p>
  
  <blockquote>
    <p>MethodError: <code>convert</code> has no method matching convert(::Type{Float64},
    ::Array{Float64,1}) This may have arisen from a call to the
    constructor Float64(...), since type constructors fall back to convert
    methods. Closest candidates are:   call{T}(::Type{T}, ::Any)<br>
    convert(::Type{Float64}, !Matched::Int8)   convert(::Type{Float64},
    !Matched::Int16)   ...  in nelder_mead at
    /home/dli/.julia/v0.4/Optim/src/nelder_mead.jl:74  in optimize at
    /home/dli/.julia/v0.4/Optim/src/optimize.jl:482  in include_string at
    /home/dli/.julia/v0.4/CodeTools/src/eval.jl:28  in include_string at
    /home/dli/.julia/v0.4/CodeTools/src/eval.jl:32  [inlined code] from
    /home/dli/.julia/v0.4/Atom/src/eval.jl:39  in anonymous at
    /home/dli/.julia/v0.4/Atom/src/eval.jl:62  in withpath at
    /home/dli/.julia/v0.4/Requires/src/require.jl:37  in withpath at
    /home/dli/.julia/v0.4/Atom/src/eval.jl:53  [inlined code] from
    /home/dli/.julia/v0.4/Atom/src/eval.jl:61  in anonymous at task.jl:58</p>
  </blockquote>
  
  <p>Any help will be appreciated. Thanks!</p>