# Powell's Line Search Algorithm in Julia

**URL:** https://discourse.julialang.org/t/powells-line-search-algorithm-in-julia/115459
**Category:** Optimization (Mathematical)
**Created:** [June 11, 2024, 8:28am UTC](https://discourse.julialang.org/t/powells-line-search-algorithm-in-julia/115459 "2024-06-11T08:28:29Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![TimOb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/timob/32/206645_2.png) [@TimOb](https://discourse.julialang.org/u/TimOb)
#### Post date: [June 11, 2024, 8:28am UTC](https://discourse.julialang.org/t/powells-line-search-algorithm-in-julia/115459/1 "2024-06-11T08:28:29Z")

</div>

I’m looking for a Julia implementation of Powell’s line search algorithm. It’s essentially this algorithm from Scipy:

[https://docs.scipy.org/doc/scipy/reference/optimize.minimize-powell.html](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-powell.html)

which is similar to the algorithm described on slide 7 here:

> **[09\_direct\_methods.pdf](https://qzhu2017.github.io/assets/pdfs/courses/numerical-optimization/09_direct_methods.pdf)**
>
> 1011.68 KB

In Julia, I could only find COBYLA etc, but not this algorithm. Does anyone know any packages or codes which might have it?

---

<div class="post-metadata">

### Author: ![magister-ludi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magister-ludi/32/4003_2.png) [@magister-ludi](https://discourse.julialang.org/u/magister-ludi)
#### Post date: [June 11, 2024, 10:30am UTC](https://discourse.julialang.org/t/powells-line-search-algorithm-in-julia/115459/2 "2024-06-11T10:30:42Z")

</div>

I haven’t used the package, but [PRIMA.jl](https://juliahub.com/ui/Packages/General/PRIMA) provides many of Powell’s algorithms.

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [June 11, 2024, 10:37am UTC](https://discourse.julialang.org/t/powells-line-search-algorithm-in-julia/115459/3 "2024-06-11T10:37:37Z")

</div>

> [@TimOb](#):
>
> Does anyone know any packages or codes which might have it?

Not sure but the first places I’d look are

- [GitHub - JuliaNLSolvers/Optim.jl: Optimization functions for Julia](https://github.com/JuliaNLSolvers/Optim.jl)
- [GitHub - JuliaNLSolvers/LineSearches.jl: Line search methods for optimization and root-finding](https://github.com/JuliaNLSolvers/LineSearches.jl)
- [GitHub - SciML/Optimization.jl: Mathematical Optimization in Julia. Local, global, gradient-based and derivative-free. Linear, Quadratic, Convex, Mixed-Integer, and Nonlinear Optimization in one simple, fast, and differentiable interface.](https://github.com/SciML/Optimization.jl)

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [June 11, 2024, 12:35pm UTC](https://discourse.julialang.org/t/powells-line-search-algorithm-in-julia/115459/4 "2024-06-11T12:35:24Z")

</div>

" Powell’s line search algorithm", that’s underdetermined since there’s 5 of them? Optimization.jl has an interface over PRIMA which gives all of these:

> **[PRIMA.jl · Optimization.jl](https://docs.sciml.ai/Optimization/stable/optimization_packages/prima/)**
>
> Documentation for Optimization.jl.

---

<div class="post-metadata">

### Author: ![TimOb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/timob/32/206645_2.png) [@TimOb](https://discourse.julialang.org/u/TimOb)
#### Post date: [June 11, 2024, 1:05pm UTC](https://discourse.julialang.org/t/powells-line-search-algorithm-in-julia/115459/5 "2024-06-11T13:05:10Z")

</div>

Thanks for your replies! Just to clarify the question, the PRIMA package has the algorithms UOBYQA, NEWUOA, BOBYQA, LINCOA and COBYLA. However, none of these is the algorithm from Scipy and slide 7 of the document above, which is based on having a set of search directions and updating these in each step (I think it’s from one of Powell’s much older publications). This algorithm usually works really well for economic models and I’m hoping to find it in Julia. 🙂

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [June 11, 2024, 1:18pm UTC](https://discourse.julialang.org/t/powells-line-search-algorithm-in-julia/115459/6 "2024-06-11T13:18:15Z")

</div>

Probably there’s no particular reason for that algorithm be better than any of the others, and I would give them a try. In particular, if sticking to Powell’s methods is a reason per se, using the implementations in PRIMA is probably the way to go, as they have better performance and fixed bugs relative to older (Powell’s) implementations. Otherwise there is a great variety of derivative-free methods (in Julia and otherwise) to be experimented. Maybe [this thread](https://discourse.julialang.org/t/comparison-of-derivative-free-black-box-optimization-algorithms-in-julia/109614) is a starting point to test alternatives.
