On 20-09-2012, at 16:06, Berend Hasselman wrote: > > On 20-09-2012, at 15:17, Christopher Kelvin wrote: > > ..... > A final remark on function z: > > - do not calculate things like n*sum(s) repeatedly: doing something like > A<-n*sum(s) and reusing A is more efficient. > - same thing for log((exp(-(scale)*sum(x)))) (recalculated four times) > - same thing for sum(x) >
Oops! No not four times. Twice. But (exp(-(scale)*sum(x))) is calculated three times. Berend ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.