comparison m-toolbox/html_help/help/ug/sigproc_example_matrix_linlsqsvd.html @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
3
4 <html lang="en">
5 <head>
6 <meta name="generator" content=
7 "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org">
8 <meta http-equiv="Content-Type" content=
9 "text/html; charset=us-ascii">
10
11 <title>Linear least squares with singular value deconposition - multiple experiments (LTPDA Toolbox)</title>
12 <link rel="stylesheet" href="docstyle.css" type="text/css">
13 <meta name="generator" content="DocBook XSL Stylesheets V1.52.2">
14 <meta name="description" content=
15 "Presents an overview of the features, system requirements, and starting the toolbox.">
16 </head>
17
18 <body>
19 <a name="top_of_page" id="top_of_page"></a>
20
21 <p style="font-size:1px;">&nbsp;</p>
22
23 <table class="nav" summary="Navigation aid" border="0" width=
24 "100%" cellpadding="0" cellspacing="0">
25 <tr>
26 <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td>
27
28 <td valign="baseline" align="right"><a href=
29 "sigproc_example_ao_linlsqsvd.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="Linear least squares with singular value deconposition - single experiment"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "sigproc_example_matrix_linfitsvd.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="Iterative linear parameter estimation for multichannel systems - symbolic system model in frequency domain"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Linear least squares with singular value deconposition - multiple experiments</h1>
37 <hr>
38
39 <p>
40
41
42
43 <p>Determine the coefficients of a linear combination of noises</p>
44
45 <h2>Contents</h2>
46 <div><ul><li><a href="#1">Make data</a></li>
47 <li><a href="#2">Do fit</a></li></ul></div>
48
49 <h2>Make data<a name="1"></a></h2>
50
51 <div class="fragment"><pre>
52
53 fs = 10;
54 nsecs = 10;
55
56 <span class="comment">% fit basis for 2 experiments case</span>
57 B1 = ao(plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>, <span class="string">'fs'</span>, fs, <span class="string">'nsecs'</span>, nsecs, <span class="string">'yunits'</span>, <span class="string">'T'</span>));
58 B1.setName;
59 B2 = ao(plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>, <span class="string">'fs'</span>, fs, <span class="string">'nsecs'</span>, nsecs, <span class="string">'yunits'</span>, <span class="string">'T'</span>));
60 B2.setName;
61 B3 = ao(plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>, <span class="string">'fs'</span>, fs, <span class="string">'nsecs'</span>, nsecs, <span class="string">'yunits'</span>, <span class="string">'T'</span>));
62 B3.setName;
63 B4 = ao(plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>, <span class="string">'fs'</span>, fs, <span class="string">'nsecs'</span>, nsecs, <span class="string">'yunits'</span>, <span class="string">'T'</span>));
64 B4.setName;
65
66 C1 = matrix(B1,B2,plist(<span class="string">'shape'</span>,[2,1]));
67 C1.setName;
68 C2 = matrix(B3,B4,plist(<span class="string">'shape'</span>,[2,1]));
69 C2.setName;
70
71 <span class="comment">% make additive noise</span>
72 n1 = ao(plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>, <span class="string">'fs'</span>, fs, <span class="string">'nsecs'</span>, nsecs, <span class="string">'yunits'</span>, <span class="string">'m'</span>));
73 n1.setName;
74 n2 = ao(plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>, <span class="string">'fs'</span>, fs, <span class="string">'nsecs'</span>, nsecs, <span class="string">'yunits'</span>, <span class="string">'m'</span>));
75 n2.setName;
76
77 <span class="comment">% coefficients of the linear combination</span>
78 a1 = ao(1,plist(<span class="string">'yunits'</span>,<span class="string">'m/T'</span>));
79 a1.setName;
80 a2 = ao(2,plist(<span class="string">'yunits'</span>,<span class="string">'m/T'</span>));
81 a2.setName;
82
83 <span class="comment">% assign output values</span>
84 <span class="comment">% y is a matrix containing the outputs of two experiments:</span>
85 y1 = a1*B1 + a2*B3 + n1;
86 y2 = a1*B2 + a2*B4 + n2;
87 y = matrix(y1,y2,plist(<span class="string">'shape'</span>,[2,1]));
88
89 </pre></div>
90
91
92 </pre><h2>Do fit<a name="2"></a></h2>
93
94 <div class="fragment"><pre>
95
96 <span class="comment">% Get a fit with linlsqsvd</span>
97 pobj = linlsqsvd(C1, C2, y)
98
99 </pre></div>
100
101 <div class="fragment"><pre>
102
103 ---- pest 1 ----
104 name: a1*C1+a2*C2
105 param names: {'a1', 'a2'}
106 y: [0.97312642877028477;2.0892132651873916]
107 dy: [0.06611444020240001;0.065007088662104057]
108 yunits: [T^(-1) m][T^(-1) m]
109 pdf: []
110 cov: [2x2], ([0.00437111920327673 -0.000390118937121542;-0.000390118937121542 0.00422592157632266])
111 corr: []
112 chain: []
113 chi2: 0.85210029717685576
114 dof: 198
115 models: matrix(B1/tsdata Ndata=[100x1], fs=10, nsecs=10, t0=1970-01-01 00:00:00.000 UTC, B2/tsdata Ndata=[100x1], fs=10, nsecs=10, t0=1970-01-01 00:00:00.000 UTC), matrix(B3/tsdata Ndata=[100x1], fs=10, nsecs=10, t0=1970-01-01 00:00:00.000 UTC, B4/tsdata Ndata=[100x1], fs=10, nsecs=10, t0=1970-01-01 00:00:00.000 UTC)
116 description:
117 UUID: 545c9699-e749-40d5-bbe1-1322599c9c5d
118 ----------------
119
120 </pre></div>
121
122 <div class="fragment"><pre>
123
124 <span class="comment">% do linear combination: using eval</span>
125 yfit = pobj.eval;
126
127 <span class="comment">% extract objects</span>
128 yfit1 = getObjectAtIndex(yfit,1);
129 yfit2 = getObjectAtIndex(yfit,2);
130
131 <span class="comment">% Plot - compare data with fit</span>
132 iplot(y1, yfit1)
133 iplot(y2, yfit2)
134
135 </pre></div>
136
137 <p>
138 <div align="center">
139 <IMG src="images/example_matrix_linlsqsvd_01.png" align="center" border="0">
140 </div>
141 </p>
142 <p>
143 <div align="center">
144 <IMG src="images/example_matrix_linlsqsvd_02.png" align="center" border="0">
145 </div>
146 </p>
147
148
149 </p>
150
151 <br>
152 <br>
153 <table class="nav" summary="Navigation aid" border="0" width=
154 "100%" cellpadding="0" cellspacing="0">
155 <tr valign="top">
156 <td align="left" width="20"><a href="sigproc_example_ao_linlsqsvd.html"><img src=
157 "b_prev.gif" border="0" align="bottom" alt=
158 "Linear least squares with singular value deconposition - single experiment"></a>&nbsp;</td>
159
160 <td align="left">Linear least squares with singular value deconposition - single experiment</td>
161
162 <td>&nbsp;</td>
163
164 <td align="right">Iterative linear parameter estimation for multichannel systems - symbolic system model in frequency domain</td>
165
166 <td align="right" width="20"><a href=
167 "sigproc_example_matrix_linfitsvd.html"><img src="b_next.gif" border="0" align=
168 "bottom" alt="Iterative linear parameter estimation for multichannel systems - symbolic system model in frequency domain"></a></td>
169 </tr>
170 </table><br>
171
172 <p class="copy">&copy;LTP Team</p>
173 </body>
174 </html>