2
」srand「是不正確的命令,這是我第一次使用D語言。 d爲R.D程序中與set.seed(1234)相同的語法是什麼「R
void main() {
//srand(1234); ????//
randInit();
auto x = RMatrix(10,1);foreach(rep; 0..1) {
printR(rep.robj);
double init = 0.0;
foreach(ii; 0..100) {
init = 0.5*init + rnorm();
}
x[0,0] = init;
foreach(ii; 1..x.rows) {
x[ii,0] = 0.8*x[ii-1,0] + rnorm();
}
你能不能在技術上只是做'均勻(T1,T2)'不指定發電機?據我所知,然後'uniform(T1,T2)'將用默認的隨機生成器進行初始化,該生成器使用'unpredictableSeed'初始化' – Bauss
是的,我首先從文檔中引用了該示例! :) –
我的不好,我沒有仔細閱讀! :) – Bauss