Displaying 1 result from an estimated 1 matches for "newcoefs".
Did you mean:
new_offs
2008 Aug 28
2
Defining environments within functions
...ere 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, when I try to wrap all of that in its own function
profile.estimate = fn(pars,...){
ProfileEnv = new.env()
assign('coefs',coefs,3,ProfileEnv)
res = optim(pars,Profile...