F********E 发帖数: 1025 | 1 Hi all:
I want to do a least square fitting, but I need to apply a constraint--which
is that the fitting line has to exactly cut through one specific data point
in my data set. For example, I want the parabolic line pass the origin, or
I need the following equation to fit in my data:
*************
a*x^2+b*x
**************
instead of the regular one:
*************
a*x^2+b*x+c
**************
Does anybody know any function in PYLAB OR PYTHON or other suite which can
do this? Thanks a lot! | e****d 发帖数: 333 | 2 What you are doing is called "non-linear least square fit". The well known
algorithm is "Gauss–Newton algorithm".
You can write a short script in matlab.
If you don't want to use Gauss–Newton algorithm, an alternative is to use
fminsearch(RSS), where RSS is in a function form.
there may be other better solutions out there. | h********8 发帖数: 1 | 3
which
point
or
【在 F********E 的大作中提到】 : Hi all: : I want to do a least square fitting, but I need to apply a constraint--which : is that the fitting line has to exactly cut through one specific data point : in my data set. For example, I want the parabolic line pass the origin, or : I need the following equation to fit in my data: : ************* : a*x^2+b*x : ************** : instead of the regular one: : *************
|
|