@@ -180,11 +180,36 @@ where
180
180
/// fit. This uses single threaded calculations.
181
181
///
182
182
/// That means the observations are expected to be a matrix, where the
183
- /// columns correspond to the individual observations. The nonlinear
184
- /// parameters will be optimized across all the observations, but the
185
- /// linear coefficients are calculated for each observation individually.
186
- /// Hence, they also become a matrix where the columns correspond to the
187
- /// linear coefficients of the observation in the same column.
183
+ /// columns correspond to the individual observations.
184
+ ///
185
+ /// For a set of observations `$\vec{y}_1,\dots,\vec{y}_S$` (column vectors) we
186
+ /// now have to pass a _matrix_ `$Y$` of observations, rather than a single
187
+ /// vector to the builder. As explained above, the resulting matrix would look
188
+ /// like this.
189
+ ///
190
+ /// ```math
191
+ /// \boldsymbol{Y}=\left(\begin{matrix}
192
+ /// \vert & & \vert \\
193
+ /// \vec{y}_1 & \dots & \vec{y}_S \\
194
+ /// \vert & & \vert \\
195
+ /// \end{matrix}\right)
196
+ /// ```
197
+ ///
198
+ /// The nonlinear parameters will be optimized across all the observations
199
+ /// globally, but the best linear coefficients are calculated for each observation
200
+ /// individually. Hence, the latter also become a matrix `$C$`, where the columns
201
+ /// correspond to the linear coefficients of the observation in the same column.
202
+ ///
203
+ /// ```math
204
+ /// \boldsymbol{C}=\left(\begin{matrix}
205
+ /// \vert & & \vert \\
206
+ /// \vec{c}_1 & \dots & \vec{c}_S \\
207
+ /// \vert & & \vert \\
208
+ /// \end{matrix}\right)
209
+ /// ```
210
+ ///
211
+ /// The (column) vector of linear coefficients `$\vec{c}_j$` is for the observation
212
+ /// `$\vec{y}_j$` in the same column.
188
213
pub fn mrhs ( model : Model ) -> Self {
189
214
Self {
190
215
Y : None ,
@@ -205,16 +230,12 @@ where
205
230
{
206
231
/// Create a new builder based on the given model
207
232
/// for a problem with **multiple right hand sides** and perform a global
208
- /// fit. This tries to increase the speed by using multithreaded calculations.
233
+ /// fit, see also [`LevMarProblemBuilder::mrhs`](crate::solvers::levmar::LevMarProblemBuilder::mrhs)
234
+ /// for an explanation how to order the observations into a matrix.
235
+ ///
236
+ /// This approach tries to increase the speed by using multithreaded calculations.
209
237
/// **Attention**: using multithreading might actually be slower,
210
238
/// so always try it for your usecase and measure!
211
- ///
212
- /// That means the observations are expected to be a matrix, where the
213
- /// columns correspond to the individual observations. The nonlinear
214
- /// parameters will be optimized across all the observations, but the
215
- /// linear coefficients are calculated for each observation individually.
216
- /// Hence, they also become a matrix where the columns correspond to the
217
- /// linear coefficients of the observation in the same column.
218
239
pub fn mrhs_parallel ( model : Model ) -> Self {
219
240
Self {
220
241
Y : None ,
0 commit comments