FRACLAB Functions | ![]() ![]() |
Linear regression with a possible choice of the linearity bounds on a drawing.
Syntax
[dim,handlefig,bounds]=fl_regression(x,y,FORMULE,ChoixTextes,reg,RegParam)
Inputs
x
vector = abscissas of the points
y
vector = ordinates of the points
FORMULE
Expression of dim as a function of the regression slope a_hat (e.g if it is '-a_hat', the output dim will be the opposite of the calculated slope).
ChoixTextes
If ChoixTextes is a string arrray, the titles and label axes will be consistent with the calculation of the corresponding dimension.
ChoixTextes = 'BoxDimension' | => Box dimension calculation |
ChoixTextes = [] | => Default displaying |
You may also define ChoixTextes the following way:
ChoixTextes=strvcat(title1, title2, title_estimated, xlabel1, xlabel2, ylabel1, ylabel2, FORMULE)
with :
title1,title2 | : Titles of both graphs before estimation |
title_estimated | : Title of the second graph after estimation (eg 'Slope = '). |
xlabel1,xlabel2,ylabel1,ylabel2 | : Axes labels |
reg
0
: All box sizes are taken into consideration when computing the linear regression.
1
: The output 'dim' is empty, but a figure appears. In this figure, you will be able to choose manually a range of sizes where the evolution of x versus y is linear and to read the result of the calculation with this range.
2
: All box sizes are taken into consideration when computing the output 'dim'. Moreover, the same figure appears on which you will be able to choose another regression range.
-1
: The same figure appears, but the function waits for your choice of bounds and returns the resulting dimension in the output 'dim'.
RegParam
Regression parameters. See the help of monolr for more
informations.
Outputs
dim
Output calculated with the formula FORMULE as a function of the regression slope a_hat. By default, dim is the slope of the regression line.
handlefig
: figure handle
bounds
: Vector [xmin xmax] : Bounds of linearity of y.
Optional arguments
FORMULE
: 'a_hat' (the slope)ChoixTextes
: Simple titles and labelsreg
: 2RegParam
: 'ls'