# Parameters in lower, upper and initial\_x in optim

**URL:** <https://discourse.julialang.org/t/parameters-in-lower-upper-and-initial-x-in-optim/72467>\
**Category:** New to Julia\
**Created:** [December 2, 2021, 3:56pm UTC](https://discourse.julialang.org/t/parameters-in-lower-upper-and-initial-x-in-optim/72467 "2021-12-02T15:56:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Linnea](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@Linnea](https://discourse.julialang.org/u/Linnea)\
**Post date:** [December 2, 2021, 3:56pm UTC](https://discourse.julialang.org/t/parameters-in-lower-upper-and-initial-x-in-optim/72467/1 "2021-12-02T15:56:57Z")

</div>

Hi! I have some issues understaning the first two parameters of lower, upper and initial\_x (I understand that the other parameters are selected according to the data )  
begin  
lower\_ = [0., 0., 10., 1.]  
upper\_ = [1., 1.,30., 3]  
initial\_x\_ = [0.5, 0.5, 15., 2.]  
res1 = optimize(HLT\_loss\_, lower\_, upper\_, initial\_x\_)  
end  
I need it to estimate parameters to obtain a trend of a time series, I am following the code found [here](https://datasciencejuliahackers.com/time-series.html). Thank tou for your help!

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [December 2, 2021, 3:59pm UTC](https://discourse.julialang.org/t/parameters-in-lower-upper-and-initial-x-in-optim/72467/2 "2021-12-02T15:59:42Z")

</div>

What exactly do you have issues with?

Your function `HLT_loss_` takes four parameters, and you are giving the optimization function a vector of initial guesses for each parameter, as well as upper an lower bounds. The first parameter is bound between zero and one, with an initial guess of 0.5, smae for the second, while the third parameter is bound between 10 and 30 with an initial guess of 15, and the fourth is between 1 and 3 with a guess of 2.

---

<div class="post-metadata">

**Author:** ![Linnea](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@Linnea](https://discourse.julialang.org/u/Linnea)\
**Post date:** [December 2, 2021, 4:04pm UTC](https://discourse.julialang.org/t/parameters-in-lower-upper-and-initial-x-in-optim/72467/3 "2021-12-02T16:04:51Z")

</div>

I did not know how to interpret the parameters in order to use the code with my data, thanks!
