Skip to content

Commit

Permalink
Add initial_step keyword to nelder_mead
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed May 8, 2014
1 parent e78efc9 commit f6f53d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nelder_mead.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function nelder_mead{T}(f::Function,
g::Real = 2.0,
b::Real = 0.5,
ftol::Real = 1e-8,
initial_step::Vector{T} = ones(T,length(initial_x)),
iterations::Integer = 1_000,
store_trace::Bool = false,
show_trace::Bool = false,
Expand All @@ -54,7 +55,7 @@ function nelder_mead{T}(f::Function,
n = m + 1
p = repmat(initial_x, 1, n)
for i in 1:m
@inbounds p[i, i] += one(T)
@inbounds p[i, i] += initial_step[i]
end

# Count function calls
Expand Down

0 comments on commit f6f53d5

Please sign in to comment.