Examples
Basic Examples (2)
Fit some random data to simple linear models with a shared slope parameter:
Fit the same model with parameter constraints to allow for a small difference between the slopes of the lines. This works best by using a quadratic form for the difference between the slope parameters, since (a1-a2)2is differentiable (unlike Abs[a1–a2]):
Scope (2)
It is possible to define a fitting function that evaluates to a list of values equal to the number of datasets when provided with numerical parameters:
The fit function does not evaluate symbolically, only numerically:
Use this function to fit with:
Fit two Gaussian peaks with a shared location parameter:
Fit with the models that were used to generate the data:
Extract the fits as a list of expressions:
Compare the fits to the data:
Options (6)
Weights (5)
The Weights option can be specified in a number of ways. First generate datasets with an unequal number of points and offset them slightly:
Fit the data normally. In this case, each individual data point has equal weights in the fit, so the first dataset gets more weight overall since it has more points:
Assign more weight to the second dataset:
Assign weights inversely proportional to the number of points in the dataset. This asserts that each dataset is equally important:
To assign weights for each individual data point, you can pass a list of vectors matching the input data:
DatasetIndexSymbol (1)
Use a different symbol to index the datasets:
Publisher
Sjoerd Smit
Version History
-
7.1.0
– 14 October 2022
-
7.0.0
– 06 October 2020
-
6.0.0
– 24 July 2020
-
5.0.0
– 05 December 2019
-
4.0.0
– 22 May 2019
-
3.0.0
– 19 April 2019
-
2.0.0
– 01 April 2019
-
1.0.0
– 14 March 2019