root/tests/test0.cpp @ 32

Revision 32, 1.0 kB (checked in by smidl, 16 years ago)

test KF : estimation of R in KF is not possible! Likelihood of y_t is growing when R -> 0

RevLine 
[1]1#include <itpp/itbase.h>
[15]2#include "../bdm/stat/libBM.h"
3#include "../bdm/math/libDC.h"
[1]4
5using namespace itpp;
6
7//These lines are needed for use of cout and endl
8using std::cout;
9using std::endl;
10
11int main()
12{
13
[32]14        RV th = RV ( "1 2","{a b }","1 1","0 0");
[7]15        RV r = RV ( "3 4" );
[1]16
[7]17        cout << th << r << endl;
[1]18
[32]19        ldmat ld = ldmat("1 0;0.5 1","1.1 1.3");
[7]20        vec v = "1 -0.1";
21       
22        cout << "Test to_mat"<<endl;
23//      cout << ld << endl;
24        cout << ld.to_mat()<<endl;
25
26        cout << "Test opupdt" <<endl;
27        ldmat ldup = ld;
28        ldup.opupdt(v,1);
29        cout << ldup.to_mat()<<endl;
30
31        cout << "Test +="<<endl;
32        ldmat ld2x = ld;
33        ld2x+=ld;
34        cout << ld.to_mat() << ld2x.to_mat() <<endl;
35
36        cout << "Test ldinv()"<<endl;
37        ldmat Il = ld; 
38        ld.inv(Il); //
39        mat I = Il.to_mat()*ld.to_mat();
40                cout << "ld:"<<Il.to_mat() << "eye:"<< I <<endl;
41
[18]42        cout << "Test ldform()"<<endl;
[28]43        mat V = "1 2; 2 13"; 
[18]44        ldmat lV(V);
[24]45        ldmat ilV(V); 
46        lV.inv(ilV);
47        cout << "ld:" << lV << "eye:"<< V*(ilV.to_mat()) <<endl;
[7]48
[18]49
[5]50        //Exit program:
51        return 0;
[1]52
53}
Note: See TracBrowser for help on using the browser.