root/testSmp.cpp @ 13

Revision 13, 0.6 kB (checked in by smidl, 16 years ago)

priprava na preskupeni

Line 
1#include <itpp/itbase.h>
2#include "libEF.h"
3
4using namespace itpp;
5
6//These lines are needed for use of cout and endl
7using std::cout;
8using std::endl;
9
10int main() {
11
12        //RNG_randomize();
13
14        RV rv("1","{x }","2","0","0");
15        int N = 10000; //number of samples
16        vec mu0 = "1.5 1.7";
17        ldmat R = ldmat("1.2 0.3; 0.3 5");
18        enorm<ldmat> eN(rv,mu0,R);
19       
20        mat Smp = eN.sample(N);
21        cout << "True:" <<endl;
22        cout << "mu:" << mu0 ;
23        cout << "R:" << R ;
24        cout << "R:" << R.to_mat() ;
25       
26        vec Emu = Smp*ones(N) /N ;
27        cout << "Empirical:" <<endl;
28        cout << "mu:" << Emu;
29        cout << "R:" << (Smp*Smp.transpose())/N - Emu*Emu.transpose() <<endl;
30
31        //Exit program:
32        return 0;
33
34}
Note: See TracBrowser for help on using the browser.