[R] FW: problem with optim()

2011-05-19 Thread chirine wolley
ut? Your code doesn't work for me because it references X in > places and X is not defined. > > Have you tested your functions to make sure they return reasonable values? > > On Thu, May 19, 2011 at 9:17 AM, chirine wolley > wrote: > > > > Dear R-users, > > &g

[R] problem with optim()

2011-05-19 Thread chirine wolley
Dear R-users, I would like to maximize the function g above which depends on 4 parameters (2 vectors, 1 real number, and 1 matrix) using optim() and BFGS method. Here is my code: # fonction to maximize g=function(x) { x1 = x[1:ncol(X)] x2 = x[(ncol(X)+1)] x3 = matrix(x[(ncol(X)+2):(ncol(

Re: [R] question about optim‏

2011-04-14 Thread chirine wolley
Subject: Re: [R] question about optim > > chirine wolley hotmail.com> writes: > > > Dear R-users, I would like to use optim( ) to minimize a function > > which depends on 4 parameters: 2 vectors, a scalar, and a matrix. > > And I have a hard to define the parameter

Re: [R] question about optim

2011-04-14 Thread chirine wolley
Subject: Re: [R] question about optim > > chirine wolley hotmail.com> writes: > > > Dear R-users, I would like to use optim( ) to minimize a function > > which depends on 4 parameters: 2 vectors, a scalar, and a matrix. > > And I have a hard to define the parameter

[R] question about optim

2011-04-12 Thread chirine wolley
Dear R-users, I would like to use optim( ) to minimize a function which depends on 4 parameters: 2 vectors, a scalar, and a matrix. And I have a hard to define the parameters at the beginning of the function, and then to call optim. Indeed, all the examples I have seen dont treat cases where