One thing my instructors have told me is that I should use Monte-Carlo simulations to validate new statistical estimators.
One such synthetic dataset in a paper I found (for free on arXiv, see page 23 if you'd like) generated the data according to the following
The issue is that after the second term [4*cos(time/_pi)], there's an error term epsilon indexed to time. I currently used runiform(), but methinks this isn't the same thing as adding in noise. Specifically, the paper says that epsilon_t
Well........ how would I generate Gaussian noise? Or any other kind of noise? How would I specify its variance?
Presumably there's a simple solution, I've just never made a simulation before. Any ideas how I'd do this?
One such synthetic dataset in a paper I found (for free on arXiv, see page 23 if you'd like) generated the data according to the following
Code:
clear set obs 100 egen id = seq(), f(1) t(100) // 100 units expand 250 // 250 time periods bys id : g time = _n // time 1-250 set seed 1000 // The synthetic data **!! qbys id: g y = ln(time)+4*sin(time/_pi)+4*cos(time/_pi)+runiform() //**!! above, runiform() should be an additive noise term epsilon_t xtset id time, g
is an i.i.d Gaussian noise with a mean of zero and variances of 1, 4, 9, 16, and 25
Presumably there's a simple solution, I've just never made a simulation before. Any ideas how I'd do this?
Comment