search for: makefn

Displaying 11 results from an estimated 11 matches for "makefn".

Did you mean: makefw
2019 May 02
2
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
Dear all, when using optim() for a function that uses the parent environment, I see the following unexpected behavior: makeFn <- function(){ ??? xx <- ret <- NA ??? fn <- function(x){ ?????? if(!is.na(xx) && x==xx){ ?????????? cat("x=", xx, ", ret=", ret, " (memory)", fill=TRUE, sep="") ?????????? return(ret) ?????? } ?????? xx <<- x; ret <<- sum(x^2)...
2019 May 03
2
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
On 03/05/2019 10:31, Serguei Sokol wrote: > On 02/05/2019 21:35, Florian Gerber wrote: >> Dear all, >> >> when using optim() for a function that uses the parent environment, I >> see the following unexpected behavior: >> >> makeFn <- function(){ >> ???? xx <- ret <- NA >> ???? fn <- function(x){ >> ??????? if(!is.na(xx) && x==xx){ >> ??????????? cat("x=", xx, ", ret=", ret, " (memory)", fill=TRUE, sep="") >> ??????????? return(ret) >...
2019 May 03
2
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
...Serguei Sokol wrote: >>> On 02/05/2019 21:35, Florian Gerber wrote: >>>> Dear all, >>>> >>>> when using optim() for a function that uses the parent environment, I >>>> see the following unexpected behavior: >>>> >>>> makeFn <- function(){ >>>> xx <- ret <- NA >>>> fn <- function(x){ >>>> if(!is.na(xx) && x==xx){ >>>> cat("x=", xx, ", ret=", ret, " (memory)", fill=TRUE, sep="") >&...
2019 May 03
0
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
On 02/05/2019 21:35, Florian Gerber wrote: > Dear all, > > when using optim() for a function that uses the parent environment, I > see the following unexpected behavior: > > makeFn <- function(){ > ??? xx <- ret <- NA > ??? fn <- function(x){ > ?????? if(!is.na(xx) && x==xx){ > ?????????? cat("x=", xx, ", ret=", ret, " (memory)", fill=TRUE, sep="") > ?????????? return(ret) > ?????? } > ???...
2019 May 06
2
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
...gt;>> On 02/05/2019 21:35, Florian Gerber wrote: >>>>> Dear all, >>>>> >>>>> when using optim() for a function that uses the parent environment, I >>>>> see the following unexpected behavior: >>>>> >>>>> makeFn <- function(){ >>>>> xx <- ret <- NA >>>>> fn <- function(x){ >>>>> if(!is.na(xx) && x==xx){ >>>>> cat("x=", xx, ", ret=", ret, " (memory)", fill=TRUE, sep...
2019 May 03
0
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
...te: > On 03/05/2019 10:31, Serguei Sokol wrote: >> On 02/05/2019 21:35, Florian Gerber wrote: >>> Dear all, >>> >>> when using optim() for a function that uses the parent environment, I >>> see the following unexpected behavior: >>> >>> makeFn <- function(){ >>> ???? xx <- ret <- NA >>> ???? fn <- function(x){ >>> ??????? if(!is.na(xx) && x==xx){ >>> ??????????? cat("x=", xx, ", ret=", ret, " (memory)", fill=TRUE, sep="") >>> ???...
2005 Aug 06
1
problems with function-formating, please help
please help me. since 2 days i have tried desperately to find desperately a solution for the following problem: i have an array of 3 different vectors like: > clustertransformationstabelle[,15:17] x1 x2 x3 1 0.6270023 0.2464946 0.5074781 2 0.5629291 0.1783861 0.4398626 3 0.6773455 0.3107641 0.5637289 4 0.0000000 0.0000000 0.0000000 i want to calculate
2019 May 03
0
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
...gt;>> On 02/05/2019 21:35, Florian Gerber wrote: >>>>> Dear all, >>>>> >>>>> when using optim() for a function that uses the parent environment, I >>>>> see the following unexpected behavior: >>>>> >>>>> makeFn <- function(){ >>>>> xx <- ret <- NA >>>>> fn <- function(x){ >>>>> if(!is.na(xx) && x==xx){ >>>>> cat("x=", xx, ", ret=", ret, " (memory)", fill=TRUE, sep...
2007 Sep 12
3
Passing parameters to 'optim' fn function
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 some parameters to the gradient function. I don't see how to do it given the fixed syntax
2019 May 06
0
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
...9 21:35, Florian Gerber wrote: >>>>>> Dear all, >>>>>> >>>>>> when using optim() for a function that uses the parent environment, I >>>>>> see the following unexpected behavior: >>>>>> >>>>>> makeFn <- function(){ >>>>>> xx <- ret <- NA >>>>>> fn <- function(x){ >>>>>> if(!is.na(xx) && x==xx){ >>>>>> cat("x=", xx, ", ret=", ret, " (memory)"...
2019 May 06
1
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
...wrote: >>>>>>> Dear all, >>>>>>> >>>>>>> when using optim() for a function that uses the parent environment, I >>>>>>> see the following unexpected behavior: >>>>>>> >>>>>>> makeFn <- function(){ >>>>>>> xx <- ret <- NA >>>>>>> fn <- function(x){ >>>>>>> if(!is.na(xx) && x==xx){ >>>>>>> cat("x=", xx, ", ret=", ret, &...