Skip to content

Commit 9ea6494

Browse files
committed
fix docs some more
1 parent 63f43c5 commit 9ea6494

File tree

4 files changed

+6
-52
lines changed

4 files changed

+6
-52
lines changed

CHANGES.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ See also here for a [version history](https://crates.io/crates/varpro/versions).
55

66
## 0.10.0
77

8-
Updated dependencies to current versions.
8+
- Updated dependencies to current versions.
9+
- Updates to documentation
910

1011
## 0.9.0
1112

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
//! ```
201201
//!
202202
//! We'll see in the example how the [function](crate::model::builder::SeparableModelBuilder::function) method
203-
//! and the [partial_deriv](crate::model::builder::SeparableModelBuilderProxyWithDerivatives::partial_deriv)
203+
//! and the [partial_deriv](crate::model::builder::SeparableModelBuilder::partial_deriv)
204204
//! methods let us add the function and the derivative as base functions.
205205
//!
206206
//! There is a second type of basis function, which corresponds to coefficient `$c_3$`. This is a constant

src/solvers/levmar/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ impl<Model> LevMarSolver<Model, false>
218218
where
219219
Model: SeparableNonlinearModel,
220220
{
221-
/// Same as the [LevMarProblem::fit] function but also calculates some additional
221+
/// Same as the [LevMarSolver::fit] function but also calculates some additional
222222
/// statistical information about the fit, if the fit was successful.
223223
///
224224
/// # Returns
225225
///
226-
/// See also the [LevMarProblem::fit] function, but on success also returns statistical
226+
/// See also the [LevMarSolver::fit] function, but on success also returns statistical
227227
/// information about the fit.
228228
///
229229
/// ## Problems with Multiple Right Hand Sides

src/statistics/mod.rs

+1-48
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ where
130130
}
131131

132132
#[deprecated(note = "Use the method calc_correlation_matrix.", since = "0.9.0")]
133-
/// calculate the correlation matrix. **Deprecated**, use the `calc_correlation_matrix``
134-
/// function instead.
133+
/// calculate the correlation matrix.
135134
pub fn correlation_matrix(&self) -> OMatrix<Model::ScalarType, Dyn, Dyn>
136135
where
137136
Model::ScalarType: Float,
@@ -263,52 +262,6 @@ where
263262
/// let cb_upper = best_fit + cb_radius;
264263
/// let cb_lower = best_fit - cb_radius;
265264
/// ```
266-
/// # An Important Note on the Confidence Band Values
267-
///
268-
/// This library chooses to implement the confidence interval such that it
269-
/// gives the same results as the python library [`lmfit`](https://lmfit.github.io/lmfit-py/).
270-
/// That means that the confidence interval is given _as if_ during the
271-
/// fitting process the weights had been uniformly scaled such that the
272-
/// reduced `$\chi^2$` after fitting is equal to unity: `$\chi_/nu^2 = \chi^2/\nu = 1$`,
273-
/// where `$\nu$` is the number of degrees of freedom (i.e. the number of data
274-
/// points minus the number of total fit parameters).
275-
///
276-
/// Scaling the weights does not influence the best fit parameters themselves,
277-
/// but it does influence the resulting uncertainties. Read [here](https://www.astro.rug.nl/software/kapteyn/kmpfittutorial.html#reduced-chi-squared)
278-
/// for an in-depth explanation. Briefly, the expected value for
279-
/// `$\chi^2_\nu$` for a fit with `$\nu$` degrees of freedom is one.
280-
/// Therefore it can be reasonable to apply the scaling such that we force
281-
/// `$chi^2_\nu$` to take its expected value. This will correct an overestimation
282-
/// or underestimation of the errors and is often a reasonable choice to make.
283-
///
284-
/// However, this will make this confidence band inconsistent with the other
285-
/// information from the fit, such as the standard errors from the covariance matrix
286-
/// or the reduced `$\chi^2$`. Luckily, it's easy to obtain the confidence
287-
/// bands with the errors exactly as given. Just multiply the result of this
288-
/// function with the _reduced_ `$\chi^2$` of this fit.
289-
///
290-
/// ```no_run
291-
/// # let model : varpro::model::SeparableModel<f64> = unimplemented!();
292-
/// # let y = nalgebra::DVector::from_vec(vec![0.0, 10.0]);
293-
/// # use varpro::solvers::levmar::LevMarProblemBuilder;
294-
/// # use varpro::solvers::levmar::LevMarSolver;
295-
/// # let problem = LevMarProblemBuilder::new(model)
296-
/// # .observations(y)
297-
/// # .build()
298-
/// # .unwrap();
299-
///
300-
/// let (fit_result,fit_statistics) = LevMarSolver::default()
301-
/// .fit_with_statistics(problem)
302-
/// .unwrap();
303-
///
304-
/// let best_fit = fit_result.best_fit().unwrap();
305-
/// // get the unscaled confidence band by multiplying with the
306-
/// // reduced chi2
307-
/// let cb_radius_unscaled = fit_statistics.reduced_chi2() * fit_statistics.confidence_band_radius(0.683);
308-
/// // upper and lower bounds of the confidence band
309-
/// let cb_upper = best_fit + cb_radius_unscaled;
310-
/// let cb_lower = best_fit - cb_radius_unscaled;
311-
/// ```
312265
///
313266
/// # Panics
314267
///

0 commit comments

Comments
 (0)