Prev: cell challenge
Next: Matlab Error Handles
From: Torsten Hennig on 23 Jul 2010 05:21 > This what I am doing actually, but it is not > satistying! > Indeed it is well known that with a least square > approach even few wrong points may have a strong > influence on the result because it is a global > approach and here it is amplified because data have > the same variance (so same weights) including the > wrong points (they are wrong, not noisier). Yes, that's the reason why I said you should attach weights to each measurement. In principle, it's the same thing as you want to achieve with constraints - with the advantage that you do not have to know in advance the minimum possible deviation between model and data point in order to keep the problem feasible. > This problem belong to the class of problem known as > "curve fitting in presence of obstacles", and trust > me it is not easy to solve! > If you explain me how to post an image on this forum, > I can show you an exemple. > Regards, > Eric > > Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote > in message > <1241922333.42334.1279889225290.JavaMail.root(a)gallium. > mathforum.org>... > > You should not fix an allowed error between model > > and data points in advance and put it into > constraints > > because you don't know in advance whether the > problem > > posed in this way will even be feasible. > > Better take weights w_i > 0 and minimize the > weighted > > squared error > > sum_i w_i*(y_i-s(p,x_i))^2 > > with w_i "small" if larger errors are allowed in > x_i > > and w_i "big" if only small errors in x_i are > allowed. > > > > Best wishes > > Torsten. Best wishes Torsten.
From: Eric Anterrieu on 23 Jul 2010 09:40 Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote in message <1455531772.42464.1279891336267.JavaMail.root(a)gallium.mathforum.org>... > > This what I am doing actually, but it is not > > satistying! > > Indeed it is well known that with a least square > > approach even few wrong points may have a strong > > influence on the result because it is a global > > approach and here it is amplified because data have > > the same variance (so same weights) including the > > wrong points (they are wrong, not noisier). > > Yes, that's the reason why I said you should > attach weights to each measurement. > In principle, it's the same thing as you want > to achieve with constraints - with the advantage > that you do not have to know in advance the minimum > possible deviation between model and data point > in order to keep the problem feasible. Agree with you, but here all the points have the same weights because the same variance. The wrong points are not points with more uncertainty, they are simply wrong for instrumental reason with the same level of noise but don't know a priori where they are, nor the amplitude of the wrongness. Just know that the wrongness is additive. Regards, Eric
From: Gene on 23 Jul 2010 09:59 "Eric Anterrieu" <eric.anterrieu(a)ast.obs-mip.fr> wrote in message <i2bmvt$6nk$1(a)fred.mathworks.com>... > I have data vectors x and y and I would like to minimize a function f(p)=||y-s(p,x)||² with respect to parameters vector p subject to a constraint (y-s(p,x)) < d on each data point (d is a vector the same size as x and y). > The problem is the following one: fmincon allows linear/nonlinear constraints but with vectors the same size the variable on which the optimization is performed, here p. > The size of my constraint is not the same size as p, it has the same size as x and y. > Typically, I would like to find a curve which depends on 10 parameters and passing through 10000 points with the constraint to control the individual distances between the curve and each data points. > Any idea? Eric: Based on the constraint you wish to impose ( (y-s(p,x)) < d ) perhaps the least-squares functional is not the best choice. In theory, you might consider minimizing the worst error, that is f(p) = \max_i |y_i - s(p, x_i) |. In practice such max function are problematic - typically they are not continuously differentiable and many minimization algorithms assume (at least) this much regularity. One trick that optimizers have used is to approximate the max function by using a p-norm \| e \|p = ( \sum_i | | e_i |^p )^(1/p) for some modest p (say p = 6). Good luck gene
From: Yi Cao on 23 Jul 2010 10:07 "Eric Anterrieu" <eric.anterrieu(a)ast.obs-mip.fr> wrote in message <i2bmvt$6nk$1(a)fred.mathworks.com>... > I have data vectors x and y and I would like to minimize a function f(p)=||y-s(p,x)||² with respect to parameters vector p subject to a constraint (y-s(p,x)) < d on each data point (d is a vector the same size as x and y). > The problem is the following one: fmincon allows linear/nonlinear constraints but with vectors the same size the variable on which the optimization is performed, here p. > The size of my constraint is not the same size as p, it has the same size as x and y. > Typically, I would like to find a curve which depends on 10 parameters and passing through 10000 points with the constraint to control the individual distances between the curve and each data points. > Any idea? Your understanding on constraint size is wrong. This problem can be solved using fmincon. You need to provide a cost function, which is f(p) and a constraint function, which returns an empty equality constrat and a residual vector of the inequality constraints y-d-s(p,x) (<0). HTH Yi
From: Eric Anterrieu on 23 Jul 2010 10:15
> Based on the constraint you wish to impose ( (y-s(p,x)) < d ) perhaps the least-squares functional is not the best choice. In theory, you might consider minimizing the worst error, that is f(p) = \max_i |y_i - s(p, x_i) |. In practice such max function are problematic - typically they are not continuously differentiable and many minimization algorithms assume (at least) this much regularity. One trick that optimizers have used is to approximate the max function by using a p-norm > \| e \|p = ( \sum_i | | e_i |^p )^(1/p) > for some modest p (say p = 6). > > Good luck > > gene This exactly what does the fminimax function (but with the L2 norm), but I don't want to minimize the max of the distances d_i=(y_i-s(p,x_i)). On the contrary, I would like to have large values of d_i for wrong points, and values coming from the least square fit within some sigmas for the other points. Again, it is a question of an obstacle on a curve, and I want to pass through it, I want to make a fit without being influenced by it. Actualy, any global approach with weights does not behave like this. |