Displaying 1 result from an estimated 1 matches for "profileenv".
2008 Aug 28
2
Defining environments within functions
...ally, within ProfileErr, I need to calculate
coefs(params,...)
This a function which requires a further optimization, and I can achieve
significant efficiency gains by starting where the last optimization
ended, so I would like to keep track of it.
At the command line, I get around this by
ProfileEnv = new.env()
assign('coefs',coefs,3,ProfileEnv)
and within ProfileErr, I can call
startcoefs = get('coefs',envir=ProfileEnv)
* do the optimization to get newcoefs *
assign('coefs',newcoefs,3,ProfileEnv)
Then calling
optim(pars,ProfileErr,....)
works fine. However, w...