Skip to content

How to optimize function parameters?

4 messages · zbynek.janoska@gmail.com, Jonathan P Daily

#
Hi,

I have a dataset and I want to fit a function to it.
The function is variogram model (http://en.wikipedia.org/wiki/Variogram)
The variogram model is defined by three parameters and I want them to be
automatically optimized for real time data.
I tried to use gafit {gafit} for this, but there are some data
configuration, where optimal results given by gafit() are negative, which is
not correct and cannot be used for further calculating. gafit() does not
enable me to set a range of possible results (at least I did not succeded in
doing so), therefore I am looking for another solution (Powell?s gradient
descent possibly?).

Can anyone give me a hint where to look?

Thanks

Zbynek
#
Without an example, I'm not sure how much help I can be. Does your 
Variogram calculation return a single value that could be minimized? Or 
could it be coerced to be so?

I would suggest, if you haven't done so, a look at ?nlm and ?nlminb.
Alternatively, the CRAN package 'optimx' serves as a wrapper to many 
optimization algorithms and offers methods to compare them side-by-side.

Good luck,
Jon
--------------------------------------
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Road
Kearneysville WV, 25430
(304) 724-4480
"Is the room still a room when its empty? Does the room,
 the thing itself have purpose? Or do we, what's the word... imbue it."
     - Jubal Early, Firefly

r-help-bounces at r-project.org wrote on 12/20/2010 09:39:49 AM:
which is
succeded in
gradient
http://www.R-project.org/posting-guide.html
#
Thanks for your suggestions, I will certainly look at that

To answer your question...
I can calculate root square error between empirical data a those predicted
by model (I used this to optimize the parameters using gafit()).
#
If you can somehow add the sign of the output to the root square error, 
nlm, nlminb, and many options within optimx accept bounds.
--------------------------------------
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Road
Kearneysville WV, 25430
(304) 724-4480
"Is the room still a room when its empty? Does the room,
 the thing itself have purpose? Or do we, what's the word... imbue it."
     - Jubal Early, Firefly

r-help-bounces at r-project.org wrote on 12/20/2010 01:13:53 PM:
predicted
http://www.R-project.org/posting-guide.html