- Timestamp:
- 05/21/10 13:31:06 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/tutorial/userguide/pdfds_example.m
r944 r968 1 1 clear all 2 2 % name random variables 3 x = RV({'x'},2); 3 y = RV({'y'},1); 4 u = RV({'u'},1); 4 5 6 % create f(y_t| y_{t-3}, u_{t-1}) 7 fy.class = 'mlnorm<ldmat>'; 8 fy.rv = y; 9 fy.rvc = RVtimes([y,u], [-3, -1]); 10 fy.A = [0.5, -0.9]; 11 fy.const = 0; 12 fy.R = 1e-2; 5 13 6 fx.class = 'mgnorm<ldmat>'; 7 fx.rv = x; 8 fx.rvc = RVtimes(x,-1); 9 fx.g = 'mexFunction'; % function is evaluated in matlab 10 fx.g.function = 'test_function'; % name of the matlab function to evaluate 11 fx.g.dim = 2; % expected dimension of output 12 fx.g.dimc = 2; % expected dimension of input 13 fx.R = eye(2); % variance R 14 14 % create f(u_t| ) 15 fu.class = 'enorm<ldmat>'; 16 fu.rv = u; 17 fu.mu = 0; 18 fu.R = 1e-1; 15 19 16 20 % create DS 17 21 DS.class = 'PdfDS'; 18 22 DS.pdf.class = 'mprod'; 19 DS.pdf.pdfs = {f x, fu};20 DS.init_rv = RVtimes([ x], [-1]);21 DS.init_values = [0.1, 0.2 ];23 DS.pdf.pdfs = {fy, fu}; 24 DS.init_rv = RVtimes([y,y,y], [-1,-2,-3]); 25 DS.init_values = [0.1, 0.2, 0.3]; 22 26 23 27 experiment.ndat=100;