|
"Arjun Chennu" <arjun.chennu@gmail.com> wrote in message
<fur8d1$8ja$1@fred.mathworks.com>...
>
> > If the curve has the wrong fundamental shape,
> > then insisting that it take on the shape you
> > want will not help.
> >
> > Effectively, this is all you are doing when you
> > tighten the tolerance. You are demanding
> > more and more fervently that the curve takes
> > on a different shape. Your demands will fall
> > on deaf ears I'm afraid.
> >
> > You might want to take a read through this
> > document. It talks about the idea of a
> > fundamental shape of a curve, and what
> > you can do.
>
> Thanks! That was indeed an interesting read on data
> modelling... cleared up a few concepts better! :-)
>
> However, from my theoretical predictions the intensity
> profile must be the square of a bessel function (of the
> first kind). That is the model I'm applying...
>
> ... and the fit does find a bessel, but not centered at the
> same spot as my empirical curve, and neither the same
> 'thickness' of the central core.
>
> Thus: a huge resnorm (of 1e7 or 1e8 order), and a residual
> with bumps and humps from the zero plane.
>
>
> While I realize I'm trying to coerce the minimization to
> render a bessel form, there ARE some problems with my data:
>
> 1. In some of the frames, the central core has saturated the
> ccd, and so the "heads" of the bessel are chopped off at the
> ends.
>
> 2. Due to a slight amount of astigmatism, the annular rings
> are not perfectly symmetrical but have a higher intensity in
> one direction, or so.
>
>
> I thought these limitations would not change severly affect
> the fit, because the smallest residual should be the one
> with the bessel's "head" filled out, with the annular rings
> matching up.
>
> But that doesn't seem to be the case. Is there an
> intelligent way to edit my model to incorporate the planar
> top of the bessel into the fit?
>
> This has been a journey into modelling for me. Thanks for
> the guidance! :)
>
> Arjun
Modeling is a sometimes tricky thing, as you
are finding. It sounds like your data has some
problems. Why does data always come out that
way? ;-)
One option is to down-weight data points that
you don't trust. Its not that hard to build a
weighted fit.
Do you have good enough starting values?
Sometimes if the starting values are poor on
problematic data, the whole thing diverges on
you. One way to improve things is to use a
partitioned fit. The idea is to use a tool like
my fminspleas, which reduces the problem
to a 3 variable one from 5 variables. So you
only need to choose starting values for those
three parameters.
data = {x,y};
funlist = {@(params,data) besselj(0, ...
params(1)*sqrt( (data{1}-params(2)).^2 + ...
(data{2}-params(3)).^2 )).^2,1};
[INLP,ILP] = fminspleas(funlist,NLPstart,data,z)
The nonlinear parameters are [b,c,d] in your
model, and the linear parameters are [a,e].
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?
objectId=10093&objectType=FILE
I'm not certain about what the problem is with
your data. Is it the asymmetry? Or is it that
the central peak has the wrong shape?
You might try down weighting the outer lobes,
or vice-versa. Or perhaps build an asymmetric
bessel, so that the radial behavior is a function
of angle. Or, you might add a secondary term
to tweak the shape of that central peak. There
are lots of things you might try here, so don't
give in.
John
|