-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIntegrateNorm.html
174 lines (129 loc) · 7.48 KB
/
IntegrateNorm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<html><body>
<OL>Contents
<li><a href="#Introduction"> Introduction</a>
<LI> <a href="#Formula"> Formula</a>
<LI><a href="#Conditions">Conditions </a>
<LI> <a href="#Derivs"> Derivs</a>
</ol>
<P>
<HR>
<H1><a name="Introduction">Introduction</a></h1>
This application is an attempt to model a peak on a timeslice with the formula<P>
<UL> Intensity(row,col) = background + IntegIntensity* Normal( μ<sub>x</sub>, μ<sub>y</sub>, σ<sub>x</sub>,
σ<sub>y</sub>,σ<sub>xy</sub> )
</ul><P>
The parameters are background,μ<sub>x</sub>, μ<sub>y</sub>,IntegIntensity, σ<sub>x</sub><sup>2</sup>,
σ<sub>y</sub><sup>2</sup>,and σ<sub>xy</sub><P>
The Marquardt algorithm was used to fit these parameters. Only the IntegIntensity parameter was used, though
if real data is desired, the background parameter could be used to calculate the Tot intensity - backgound.<P>
The Peak should be centered at ( μ<sub>x</sub>, μ<sub>y</sub>) and only (large)rectangle around this center is
considered.
<HR>
<H1><a name="Formula">Formula</a></h1>
Let uu = σ<sub>x</sub><sup>2</sup>σ<sub>y</sub><sup>2</sup>-σ<sub>xy</sub><sup>2</sup>
<table>
<tr><td></td><td></td><td></td><td></td><td></td><td></td><td>
-σ<sub>y</sub><sup>2</sup>(col- μ<sub>x</sub>)<sup>2</sup>/(2*uu)+
σ<sub>xy</sub>(col- μ<sub>x</sub>)(row-μ<sub>y</sub>) -
σ<sub>x</sub><sup>2</sup> (row-μ<sub>y</sub>)<sup>2</sup> /(2*uu)
</td></tr>
<tr><td>Intensity(row,col)</td><td> =</td><td>background</td><td> + </td>
<td><table><tr><td>IntegIntensity</td></tr>
<tr><td> <hr width=100%></td></tr>
<tr><td>2 &pi *
sqrt(σ<sub>x</sub><sup>2</sup>σ<sub>y</sub><sup>2</sup>-
σ<sub>xy</sub><sup>2</sup> )</td></tr></table>
</td>
<td>e</td><td></td></tr>
</table>
<HR>
<H1><a name="Conditions">Conditions</a></h1>
The Marquardt algorithm has tendencies to roam around when there is not a definite minimum.<P>
<UL>Below are Conditions on the parameters
<LI> background and IntegIntensity should be nonNegative.<P>
<LI>(orig_μ<sub>x</sub>- μ<sub>x</sub>) and (orig_μ<sub>y</sub>-μ<sub>y</sub>)
should be "small".<P>
<LI> μ<sub>x</sub> and μ<sub>y</sub> should be on the detector.<P>
<LI> σ<sub>x</sub> and σ<sub>y</sub> should be positive<P>
<LI> σ<sub>x</sub><sup>2</sup>σ<sub>y</sub><sup>2</sup>-σ<sub>xy</sub><sup>2</sup> should
be positive( correlation coeff is defined)<P>
</UL><P>
A range of time slices( channels) are used to build up the total intensity of the peak.
<UL> Criteria to determine good time slices
<LI> The IntegIntensity and its error are defined for this time slice<P>
<LI> The IntegIntensity/ its error > 5<P>
<LI>The value below(Max height of peak) is less than 2<P>
<table><tr><td>IntegIntensity</td></tr>
<tr><td> <hr width=100%></td></tr>
<tr><td>2 &pi *
sqrt(σ<sub>x</sub><sup>2</sup>σ<sub>y</sub><sup>2</sup>-
σ<sub>xy</sub><sup>2</sup> )</td></tr></table><P>
<LI>(???)center ± 2*σ<sub>x</sub> and center ± 2*σ<sub>y</sub> are
in the rectangle around the peaks center. NOTE: using this criteria will mean that
peaks close to edges and overlapping peaks will not work well here.
</ul>
</ul>
<HR>
<H1><a name="Derivs">Derivs</a></h1>
The Marquardt algorithm can be supplied with appropriate derivatives. If not supplied, the derivatives
are approximated numerically. Supplying the derivatives has two advantages. First, the supplied deriatives
are faster to calculate. Second,it the parameters are close to the boundaries, the numerical approximations
commonly yield NaN or Infinity.<P>
<UL>Define the following:
<LI> uu = σ<sub>x</sub><sup>2</sup>σ<sub>y</sub><sup>2</sup>-σ<sub>xy</sub><sup>2</sup><P>
<LI> E(row,col) = e <sup>( -σ<sub>y</sub><sup>2</sup>(col- μ<sub>x</sub>)<sup>2</sup>/(2*uu)+
σ<sub>xy</sub>(col- μ<sub>x</sub>)(row-μ<sub>y</sub>)/uu -
σ<sub>x</sub><sup>2</sup> (row-μ<sub>y</sub>)<sup>2</sup> /(2*uu))<P>
<LI>
<OL> Deiriv formulas
<LI> with respect to background
<UL> D(row,col) =1;
</ul><P>
<LI> with respect to IntegIntensity
<UL> D(row,col)= E(row,col)/(2 πsqrt(uu))
</ul><P>
<LI> with respect to μ<sub>x</sub>
<UL> D(row,col)= IntegIntensity*E(row,col)/(2 πsqrt(uu))*
[ σ<sub>y</sub><sup>2</sup>(col-μ<sub>x</sub>)/uu-
σ<sub>xy</sub>(row-μ<sub>y</sub>)/uu]
</ul><P>
<LI> with respect to μ<sub>y</sub>
<UL>
D(row,col)=IntegIntensity* E(row,col)/(2 πsqrt(uu))*
[ σ<sub>x</sub><sup>2</sup>(row-μ<sub>y</sub>)/uu-
σ<sub>xy</sub>(col-μ<sub>x</sub>)/uu]
</ul><P>
<LI> with respect to σ<sub>x</sub><sup>2</sup>
<UL>
D(row,col) =IntegIntensity* E(row,col)/(2 πsqrt(uu))*
[
σ<sub>y</sub><sup>2</sup>/(2*uu) +
σ<sub>y</sub><sup>4</sup>(col- μ<sub>x</sub>)<sup>2</sup>/(2*uu<sup>2</sup>)-
σ<sub>xy</sub>(col- μ<sub>x</sub>)(row-μ<sub>y</sub>)σ<sub>y</sub><sup>2</sup>/uu<sup>2</sup> +
σ<sub>x</sub><sup>2</sup> (row-μ<sub>y</sub>)<sup>2</sup>σ<sub>y</sub><sup>2</sup> /(2*uu<sup>2</sup>)
-(row-μ<sub>y</sub>)<sup>2</sup>/(2*uu)
]
</ul><P>
<LI> with respect to σ<sub>y</sub><sup>2</sup>
<UL>
D(row,col) =IntegIntensity* E(row,col)/(2 πsqrt(uu))*
[
σ<sub>x</sub><sup>2</sup>/(2*uu) +
σ<sub>y</sub><sup>2</sup>(col- μ<sub>x</sub>)<sup>2</sup>σ<sub>x</sub><sup>2</sup>/(2*uu<sup>2</sup>)-
σ<sub>xy</sub>(col- μ<sub>x</sub>)(row-μ<sub>y</sub>)σ<sub>x</sub><sup>2</sup>/uu<sup>2</sup> +
σ<sub>x</sub><sup>4</sup> (row-μ<sub>y</sub>)<sup>2</sup> /(2*uu<sup>2</sup>)
- (col-μ<sub>x</sub>)<sup>2</sup>/(2*uu)
]
</ul><P>
<LI> with respect to σ<sub>xy</sub>
<UL>
D(row,col) =IntegIntensity* E(row,col)/(2 πsqrt(uu))*
[
-σ<sub>xy</sub>/uu
-σ<sub>y</sub><sup>2</sup>(col- μ<sub>x</sub>)<sup>2</sup>σ<sub>xy</sub>/(uu<sup>2</sup>)+
2σ<sub>xy</sub>(col- μ<sub>x</sub>)(row-μ<sub>y</sub>)σ<sub>xy</sub>/uu<sup>2</sup> -
σ<sub>x</sub><sup>2</sup> (row-μ<sub>y</sub>)<sup>2</sup>σ<sub>xy</sub> /(uu<sup>2</sup>)
+
(col- μ<sub>x</sub>)(row-μ<sub>y</sub>)/uu]
</ul><P>
</OL>