using optim.jl in julia ( using ATOM ide )
opt = optimize(function, [starting_guess] )
suposse my starting guess is [ 1 ; 2 ] for x and x … the program will find the best x and x to fit my data …
but if i want to tell julia to find x in a range of ( 0 , 2 ) and x in a range of ( 1 , 5 ) which best fit my data ?
is it possble using optim ? or Nlopt ?
Using Optim and NLOpt.
Questions like these can be answered with 30 seconds of Googling–it is often best to save the community’s goodwill for when you’re truly stuck.
none of this documentations has an example using a range of starting guess instead of a unique point
but thanks …
Have you actually read Optim’s documentation? The first line says: “…for simple “box” constraints (lower and upper bounds)…”.
Box constrains means setting an interval on each variable independently of the others.
People have been interpreting your question as optimization over a bounded parameter space. If you are asking how to use multiple start values, then just embed the call to optimize in a loop, and generate the trial start values in the loop.
look what i did
and look the results …
do you see the negative value ? why it happens ?
my lower and upper value do not be negative, in the case of x
Please post a minimal working example, i.e. Complete code that people can copy and paste to run it, instead of screenshots.
In this case, for example, you also need to post the definition of the function X2.
I am not sure about the details but I think
GradientDescent needs the objective function gradient which will be computed numerically  if you don’t provide it. If your
X2 still contains a numerical integration routine, it may compute a wrong gradient.
But please post a minimal (20 lines at most) working example if you want help.
 From the manual:
If we pass
f alone, Optim will construct an approximate gradient for us using central finite differencing
Is this problem solved? I am having similar issues
Are you talking about using box constraints or these constraints not being fulfilled? If the former then check the links in the top, if the latter I think we might need to see a MWE (minimal working example) to check out what’s going on.
Edit: nevermind, I just saw you already got some help in another thread.