Re: [Insight-users] polynomial fitting for fcMRI processing

Tomáš Kazmar Tomash.Kazmar at seznam.cz
Thu Jun 7 04:36:07 EDT 2007


# >  part of what Luis adviced was using Levenberg-Marquardt to fit a
# polynomial
# >with sum of squared differences as a metric. It sounds to me pretty
# much as
# >least squares;) BTW, in non-linear cases you always end up with
# numerical
# >solutions to least squares, so it depends what kind of problem this is.
# 
# There is one big difference between the solution I provided and the
# Levenberg-Marquardt.
# LM is a very useful and generic algorithm, but it is intrinsically
# numerical. The
# least-squares solution I provided a link to, is not numerical. Just
# because the function
# is non-linear, doesn't mean you cannot solve the LeastSquares problem
# exactly. In this
# case, the polynomial least squares problem can be solved exactly. It
# just takes a matrix
# multiplication (the formulae for the matrix elements you'll have to
# compute by hand from
# the general formula). So this is probably much faster than
# Levenberg-Marquardt, don't
# you think?

You are right. I was speaking about non-linear least squares which has
little to do with polynomial fitting (no matter if the polynomial itself is or
is not linear - different notion of linearity).

But still isn't it possible that symbolic solution could be numerically
unstable?

"This matrix equation can be solved numerically, or can be inverted
directly if it is well formed, to yield the solution vector" [from the link
you posted]


Tomas

# # If you restrict yourself to polynomials, then why don't you use a 
# # LeastSquares fitting algorithm?
# # http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html
# # You can work out the cubic case and obtain a closed-form formula for
# the 
# # fit. I don't know
# # how the LevenbergMarquardt performance with respect to the
# LeastSquares 
# # fitting, but I guess
# # that LeastSquares fitting is both faster and more accurate in this
# case.
# # 
# # best,
# # Jeroen
# # 
# # Karen Guan wrote:
# # > Hi Luis,
# # >
# # > Thanks very much for the answer and the reference! However, after
# the 
# # > manual of itk::MultivariateLegendrePolynomial seems to suggest that 
# # > this function works only for 2D and 3D data. Although it's possible
# to 
# # > add one dummy dimension (eg. all zero), I'm wondering whether
# there's 
# # > a function more suitable for 1D signal.
# # >
# # > Best,
# # > - Karen
# # >
# # > On 6/6/07, *Luis Ibanez* <luis.ibanez at kitware.com 
# # > <mailto:luis.ibanez at kitware.com>> wrote:
# # >
# # >
# # >     Hi Karen,
# # >
# # >
# # >     You can use the Multivariate Legendre Polynomials,
# # >     and combine them with the Linear Kalman estimator,
# # >     or with the Levenberg-Marquard optimizer.
# # >
# # >     
# # >
# #
# http://www.itk.org/Insight/Doxygen/html/classitk_1_1MultivariateLegendre
# Polynomial.html
# # 
# # >
# # >     
# # >
# http://www.itk.org/Insight/Doxygen/html/classitk_1_1KalmanLinearEstimato
# r.html
# # 
# # >
# # >     
# # >
# #
# <http://www.itk.org/Insight/Doxygen/html/classitk_1_1KalmanLinearEstimat
# or.html>
# # 
# # >
# # >     
# # >
# #
# http://www.itk.org/Insight/Doxygen/html/classitk_1_1LevenbergMarquardtOp
# timizer.html
# # 
# # >
# # >
# # >
# # >     In both cases you will be using the sum of squared
# # >     differences between your data and the polynomial,
# # >     as the metric to minimize.
# # >
# # >
# # >     Please look at the recent trail by Mathieu Malaterre
# # >     on this topic in the users list.
# # >
# # >
# # >
# # >         Regards,
# # >
# # >
# # >            Luis
# # >
# # >
# # >     --------------------
# # >     Karen Guan wrote:
# # >     > Dear all,
# # >     >
# # >     > I'm working on fcMRI processing, and need polynomial fitting
# # >     (3rd order,
# # >     > ax3 + bx2 + cx +d) for each time course (with about 600 time
# # >     points)
# # >     > to remove B0 fluctuation or shifting. The entire data set
# # >     > has 128 * 128 * 7 samples ( i.e. time courses).
# # >     >
# # >     > The questions are:
# # >     > 1. Is there such an algorithm in ITK (including vnl/vcl)?
# # >     > 2. If so, for fast processing of 1-D signal with 600 samples,
# # >     what are
# # >     > be best choices?
# # >     >
# # >     > I appreciate the help!
# # >     >
# # >     > - X.
# # >     >
# # >     >
# # >     >
# # >     >
# # >     
# # >
# ------------------------------------------------------------------------
# # >
# # >     >
# # >     > _______________________________________________
# # >     > Insight-users mailing list
# # >     > Insight-users at itk.org <mailto:Insight-users at itk.org>
# # >     > http://www.itk.org/mailman/listinfo/insight-users
# # >
# # >
# # >
# ------------------------------------------------------------------------
# # >
# # > _______________________________________________
# # > Insight-users mailing list
# # > Insight-users at itk.org
# # > http://www.itk.org/mailman/listinfo/insight-users
# # >   
# # 
# # 
# # _______________________________________________
# # Insight-users mailing list
# # Insight-users at itk.org
# # http://www.itk.org/mailman/listinfo/insight-users
# # 
# # 
# # 
# _______________________________________________
# Insight-users mailing list
# Insight-users at itk.org
# http://www.itk.org/mailman/listinfo/insight-users
# _______________________________________________
# Insight-users mailing list
# Insight-users at itk.org
# http://www.itk.org/mailman/listinfo/insight-users
# 
# 
# 


More information about the Insight-users mailing list