Options
It is possible to pass an optional set of parameters to the fitting functions with the options keyword, using an Options struct. For example:
using EasyFit, Random
Random.seed!(1)
x = sort(rand(10))
y = @. 0.3 * exp(5x)
fitexp(x, y, options=Options(maxtrials=1000))------------ Single Exponential fit -----------
Equation: y = a exp(-x/b) + c
With: a = 0.3000000000000478
b = -0.2000000000000075
c = -1.326315096604623e-13
Correlation coefficient, R² = 1.0
Average square residue = 1.0136631520496675e-26
Predicted Y: ypred = [ 0.33840859531570533, 0.3836158209060227, ...]
residues = [ -8.021361352916756e-14, -7.499556531342932e-14, ...]
-----------------------------------------------
Available options:
| Keyword | Type | Default value | Meaning |
|---|---|---|---|
fine | Int | 100 | Number of points of fit to smooth plot. |
p0_range | Vector{Float64} | [-100*(maximum(Y)-minimum(Y)), 100*(maximum(Y)-minimum(Y))] | Range of generation of initial random parameters. |
nbest | Int | 5 | Number of repetitions of best solution in global search. |
besttol | Float64 | 1e-4 | Similarity of the sum of residues of two solutions such that they are considered the same. |
maxtrials | Int | 100 | Maximum number of trials in global search. |
debug | Bool | false | Prints errors of failed fits. |
The nbest, besttol, and maxtrials options are also used by the multistart search performed by fitexpdecay (see Normalized exponential decay).