Dear Statalist,
I'm not sure I understand how seeds work, even after having read the documentation. I want my results to be replicable, but also as random as possible. I am trying to predict a continuous value for a range of financial products like savings acounts, stocks, etc. using regressions. Therefore, I'm using a loop for each financial product defined in a local. The code involves pseudorandom functions like -rnormal()-.
Here's a code example:
``finprod'_random' involves transformations of `finprod'_y with rnormal(). My question is : If I want results as random as possible, do I just need one seed set before the loop begins, or do I have to store different seeds in a nested loop and include it within my loop of local product, so that each financial product has its own seed?
Thank you so much for your help !
I'm not sure I understand how seeds work, even after having read the documentation. I want my results to be replicable, but also as random as possible. I am trying to predict a continuous value for a range of financial products like savings acounts, stocks, etc. using regressions. Therefore, I'm using a loop for each financial product defined in a local. The code involves pseudorandom functions like -rnormal()-.
Here's a code example:
Code:
foreach finprod of local product { intreg `finprod'1 `finprod'2 ``finprod'_regressors' predict `finprod'_y, xb * I skip the useless bit here local `finprod'_predicted = `finprod'_y[`i'] + ``finprod'_sigma' * ``finprod'_random' }
Thank you so much for your help !
Comment