[R] Multi-dimensional function.

2008-01-04 Thread José Luis Aznarte M.
Hi there! Happy new year to everyone! There's a piece of code that I must write that's driving me crazy. Maybe any of you has previous experiences in something similar. Any help will be greatly appreciated! The problem is as follows. I have a matrix Z with dimensions c(m, p). I have

[R] Passing parameters to 'optim' fn function

2007-09-12 Thread José Luis Aznarte M.
Hi again! I'm using the 'optim' method to fix the parameters of a model. I have written the function to be minimised and another function which returns the gradient of the error. Now my problem is that, in order to compute that gradient, it would be extremely convenient to be able to pass s