Hi Pieter, thank you for your response. I am indeed using the "optim" function. I had already tried the trace option under the control argument - however it only provides me with iteration no. 10, 20, 30 etc. I would like to be able to generate the results for every iteration.
Here is an example (where fr is the function and grr the gradient - which were previously defined already) <- optim(c(-1,1), fr, grr, method = "BFGS", control=list(trace = TRUE))) Also I shd mention I had tried the print command previously too but this hadn't worked. You mentioned that I could use fix() to add a print statement - would you be able to suggest how to implement it pls? Once again, thank you for your help -I am really appreciative! -- View this message in context: http://r.789695.n4.nabble.com/how-to-show-iterations-tp4646133p4646158.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.