Revision 940, 0.7 kB
(checked in by suzdalev, 15 years ago)
|
simulator
|
-
Property svn:eol-style set to
native
|
Rev | Line | |
---|
[934] | 1 | clear all |
---|
[615] | 2 | % name random variables |
---|
[630] | 3 | y = RV({'y'},1); |
---|
| 4 | u = RV({'u'},1); |
---|
[615] | 5 | |
---|
| 6 | % create f(y_t| y_{t-3}, u_{t-1}) |
---|
| 7 | fy.class = 'mlnorm<ldmat>'; |
---|
| 8 | fy.rv = y; |
---|
[630] | 9 | fy.rvc = RVtimes([y,u], [-3, -1]); |
---|
[615] | 10 | fy.A = [0.5, -0.9]; |
---|
| 11 | fy.const = 0; |
---|
[701] | 12 | fy.R = 1e-2; |
---|
[615] | 13 | |
---|
| 14 | % create f(u_t| ) |
---|
| 15 | fu.class = 'enorm<ldmat>'; |
---|
| 16 | fu.rv = u; |
---|
| 17 | fu.mu = 0; |
---|
[630] | 18 | fu.R = 1e-1; |
---|
[615] | 19 | |
---|
| 20 | % create DS |
---|
[701] | 21 | DS.class = 'PdfDS'; |
---|
| 22 | DS.pdf.class = 'mprod'; |
---|
| 23 | DS.pdf.pdfs = {fy, fu}; |
---|
[630] | 24 | DS.init_rv = RVtimes([y,y,y], [-1,-2,-3]); |
---|
[615] | 25 | DS.init_values = [0.1, 0.2, 0.3]; |
---|
| 26 | |
---|
| 27 | experiment.ndat=100; |
---|
| 28 | |
---|
[940] | 29 | M=simulator(DS,experiment); |
---|
[617] | 30 | %M=estimator(DS,{},experiment); |
---|
[630] | 31 | |
---|
| 32 | %%% store results |
---|
[934] | 33 | Data=[M.DS_dt_y'; M.DS_dt_u']; |
---|
[631] | 34 | drv = RVjoin([y,u]); |
---|
| 35 | true_theta=[fy.A fy.const]; |
---|
| 36 | true_R=[fy.R]; |
---|
[701] | 37 | save pdfds_results Data drv y u true_theta true_R |
---|