0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 %% Simple test:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 x = 1*ones(1000,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 y = 3*x;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 x = ao(x);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 y = ao(y);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 x0 = 3.3;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 model = smodel(plist('expression','A*x','xvar','x','params','A','xvals',[x.y]));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 noise = ao(plist('waveform', 'noise', 'fs', 10, 'nsecs', 100,'sigma',0.1));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 pl = plist('N',1000,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 'J',1,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 'cov',0.1,... % [4e-5 1e-5 1e-6 1e-8 1e-9]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 'range',{[0.5 5.5]},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 'param',{'A'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 'model',model,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 'noise',noise,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 'search',false,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 'x0',[x0],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 'simplex',false,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 'plot',1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 b = mcmc(x,y,pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 plot(b.chain) |