[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: Speed problems using Stata 8.2
One very small comment here. If this is run, the time
will include the time to -drop _all-, which -- the
very first time this is done -- could be all sorts
of different datasets in memory before the -simulate-.
As several people may be interested in
this or other benchmarking programs, then
the number of sources of variability can
be reduced by ensuring that -simulate- is
run after -clear-.
> program define lnsim, rclass
> syntax [, obs(integer 1) mu(real 0) sigma(real 1)]
> drop _all
> set obs `obs'
> tempvar z
> gen `z' = exp(`mu' + `sigma'*invnorm(uniform()))
> summarize `z'
> return scalar mean = r(mean)
> return scalar Var = r(Var)
> simulate "lnsim, obs(100)" mean=r(mean) var=r(Var), reps(10000)
* For searches and help try: