Changeset 32 for tests/testPF.cpp
- Timestamp:
- 03/03/08 13:00:32 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
tests/testPF.cpp
r19 r32 13 13 14 14 RV x("1"); 15 RV xm=x; xm.t(-1); 15 RV xm=x; xm.t(-1);const 16 16 RV y("2"); 17 17 … … 19 19 vec vR = "1"; 20 20 ldmat R(vR); 21 22 eEmp emp(x,10); 23 euni eun(x); 24 eun.set_parameters("0","1"); 25 emp.set_parameters(ones(10),&eun); 26 vec &v=emp._w(); 27 Array<vec> &S=emp._samples(); 21 28 29 for (int i=0;i<10;i++){ v(i) = exp(-0.5*sum(pow(S(i)-1,2.0))*10);} 30 v/=sum(v); 22 31 23 vec ptc = randn(10);24 vec w = exp(-0.5*(pow(ptc,2))/0.2);32 cout << "p:" << S << endl; 33 cout << "w:" << v << endl; 25 34 26 cout << "p:" << ptc << endl; 27 cout << "w:" << w << endl; 28 29 PF pf(w); 30 ivec ind = pf.resample(); 35 ivec ind = emp.resample(); 31 36 32 37 cout << ind << endl; 33 /*34 mlnorm<ldmat> obs(x,xm,A,R);35 mlnorm<ldmat> par(y,x,A,R);36 38 37 TrivialPF TPF(obs,par,10);38 */39 39 //Exit program: 40 40 return 0;