Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Fitting using multiple functions (piecewise?)

Subject: Fitting using multiple functions (piecewise?)

From: Allen H.

Date: 28 Feb, 2010 06:55:22

Message: 1 of 15

Hi everyone,

Here's the crazy idea- I've got some data that has portions that are
gaussian and portions that are exponential (it comes from
cathodoluminescence (CL) in a jeol sem). I found a piecewise function
in a text book for CL that I'd like to see how well it fits to my
data.

Basically, the emission data I'm trying to fit has a front and rear
tail that appear exponential, and a middle region (with the maxima)
that is gaussian.

Is it possible to curve-fit a constrained piecewise formula? I
noticed the piecewise fitting routine on mathworks files, but this is
for a monotonic function? I tend to use cftool gui, but can learn
another method to make what I need to do work.

I'm going to just start by plotting by hand and see if I can get
somewhat close to the parameters for the data, which will help with
any constrained fitting routines.

Is this impossible? Or nearly impossible?

Thanks for your thoughts!
-Allen

Subject: Fitting using multiple functions (piecewise?)

From: Bruno Luong

Date: 28 Feb, 2010 08:07:03

Message: 2 of 15


It is possible, but it is no doubt a difficult non-linear fitting problem.
The closest ready-in-the can function I can think of is free-knot-spline fitting.

http://www.mathworks.com/matlabcentral/fileexchange/25872-free-knot-spline-approximation

where each interval is a spline of arbitrary order. I have saw a paper of such technique is used to cardiogram data.

If you want piecewise exponential or Gaussian, I'm afraid you have to code yourself. But it will be a pain (the spline code I made have more than 5000 lines in Matlab I believe), and if it works reliably, it will be worth to publish it.

Bruno

Subject: Fitting using multiple functions (piecewise?)

From: John D'Errico

Date: 28 Feb, 2010 14:17:20

Message: 3 of 15

"Allen H." <ajhall@gmail.com> wrote in message <f67aca84-b097-408d-abb7-2352fa9c1982@k17g2000yqb.googlegroups.com>...
> Hi everyone,
>
> Here's the crazy idea- I've got some data that has portions that are
> gaussian and portions that are exponential (it comes from
> cathodoluminescence (CL) in a jeol sem). I found a piecewise function
> in a text book for CL that I'd like to see how well it fits to my
> data.
>
> Basically, the emission data I'm trying to fit has a front and rear
> tail that appear exponential, and a middle region (with the maxima)
> that is gaussian.
>
> Is it possible to curve-fit a constrained piecewise formula? I
> noticed the piecewise fitting routine on mathworks files, but this is
> for a monotonic function? I tend to use cftool gui, but can learn
> another method to make what I need to do work.
>
> I'm going to just start by plotting by hand and see if I can get
> somewhat close to the parameters for the data, which will help with
> any constrained fitting routines.
>
> Is this impossible? Or nearly impossible?

I would not bother to do so. You are essentially
trying to build a "spline" from these various
nonlinear segments. So then rather than play
with these pieces and try to make them work,
why not use a spline itself? Use a tool that allows
you to create a basic underlying shape that has
the properties that you are looking for.

My SLM tools allow you to specify these basic
shape primitives, in a natural language of shape,
in a form that makes sense to the user. SLM is on
the file exchange, and requires only the optimization
toolbox.

http://www.mathworks.com/matlabcentral/fileexchange/24443

For example, if you would have a specific domain
where the function has a negative exponential
character, then over that interval force the result to
be both decreasing and concave upwards. Over the
central region where your result wants to look like
a gaussian, force the curve to be concave downwards.

Use a tool that allows you to work with your curve in
a natural way based on natural shape primitives.

HTH,
John

Subject: Fitting using multiple functions (piecewise?)

From: Mark Shore

Date: 1 Mar, 2010 01:45:06

Message: 4 of 15

"Allen H." <ajhall@gmail.com> wrote in message <f67aca84-b097-408d-abb7-2352fa9c1982@k17g2000yqb.googlegroups.com>...
> Hi everyone,
>
> Here's the crazy idea- I've got some data that has portions that are
> gaussian and portions that are exponential (it comes from
> cathodoluminescence (CL) in a jeol sem). I found a piecewise function
> in a text book for CL that I'd like to see how well it fits to my
> data.
>
> Basically, the emission data I'm trying to fit has a front and rear
> tail that appear exponential, and a middle region (with the maxima)
> that is gaussian.
>
> Is it possible to curve-fit a constrained piecewise formula? I
> noticed the piecewise fitting routine on mathworks files, but this is
> for a monotonic function? I tend to use cftool gui, but can learn
> another method to make what I need to do work.
>
> I'm going to just start by plotting by hand and see if I can get
> somewhat close to the parameters for the data, which will help with
> any constrained fitting routines.
>
> Is this impossible? Or nearly impossible?
>
> Thanks for your thoughts!
> -Allen

I hesitate to disagree with Bruno and John, but I assume you're trying to fit data points of luminescent intensity vs. photon energy? If you need a smooth interpolated curve, then their suggestions are all you need (you'll require the optimization toolbox for the SLM tools).

If you want to fit the data to theoretical models and work out the slope of the tails and the center and FWHM of the Gaussian for more fundamental reasons, then you have several approaches. The easiest would be to fit the central portion of your data with a Gaussian fit (or simply take the log of the amplitude and fit a quadratic), and fit your tails separately with exponentials (again, take the log of the amplitude and fit straight lines) and then work out some ad-hoc weighted transfer function between the separate parts.

It also depends on how good your data is. The only references I could find on this date from the late 1970s, so it's not inconceivable that you could work out a better model on your own with improved data and numeric tools.

Subject: Fitting using multiple functions (piecewise?)

From: Allen H.

Date: 1 Mar, 2010 05:33:02

Message: 5 of 15

...
> If you want to fit the data to theoretical models and work out the slope of the tails and the center and FWHM of the Gaussian for more fundamental reasons, then you have several approaches. The easiest would be to fit the central portion of your data with a Gaussian fit (or simply take the log of the amplitude and fit a quadratic), and fit your tails separately with exponentials (again, take the log of the amplitude and fit straight lines) and then work out some ad-hoc weighted transfer function between the separate parts.
...

Hi everyone!! Something is definitely wrong with my gmail push these
days- I missed your messages! Thank goodness I checked on here
tonight! I want to first thank everyone who posted- John, Bruno,
Mark! Thank you *very* much. I really appreciate hearing from those
who have dabbled into these darker areas of fitting! My hat is off to
all of your work!

John- I read your work very closely- I did find the spline fit tool
you created, and it appears to be excellent. One question I have for
you is exactly to Mark's point- when the fit is completed, and you
have a good spline curve with multiple sections defined- is there any
way to get back to the non-spline form of the equation which is
recognized to be the trend of your data? i.e., if it's gaussian in
the middle, is there a manner to which I can get back to the gaussian
coefficients? or the exponential sections? The fits are most useful
when they can tell you more about your data, and so, Mark has hit upon
the crux- I'd like to learn about the various coefficients for the
curves that create the shape of the peak.

Bruno- I also read about your free-knot fitting- awesome work as
well! Seriously, guys, my hat is off to both of you- I don't even
know how you accomplished such amazing tools! Awesome work! [I'd
love to be able to create such a tool- but both time and current
knowledge is lacking, unfortunately!!]

Mark- I think you touched on the biggest point here- I am trying to
eek out info from my dataset, and knowing the forms of the curves for
each section is what helps us determine the parameters for the fit.
Now, a lot of things can be added here- is this old fitting from the
70's etc (Yacobi and Holt I think it was) any use? Maybe not!! Maybe
all I really should do is cut the data up as you suggest and try
fitting each segment. In fact, since it's taken quite some time to
wrap my head around the possible manners to which I could LSQ fit the
curves, I'm thinking that might be the fastest approach- all be it a
bit messy, but fastest. Interesting idea about the weighted mix of
the two!

Thank you again for all your help, guys, and if you can let me know
what you think about the coefficients for the general functions on
each part, that would be wonderful! If it's not possible with the
splines, I appreciate you letting me know. I don't think that
degrades from the usefulness of the spline tools, I just want to make
sure that I'm not missing something really important!

Big Cheers! Thanks so much for your reply! [I'm a bit humbled both
John and Bruno replied! Thank you!]
-Allen

Subject: Fitting using multiple functions (piecewise?)

From: Allen H.

Date: 1 Mar, 2010 05:35:31

Message: 6 of 15

Um, please excuse the free-form version of "albeit"

Subject: Fitting using multiple functions (piecewise?)

From: John D'Errico

Date: 1 Mar, 2010 13:17:02

Message: 7 of 15

"Mark Shore" <mshore@magmageosciences.ca> wrote in message <hmf672$lfh$1@fred.mathworks.com>...
> "Allen H." <ajhall@gmail.com> wrote in message <f67aca84-b097-408d-abb7-2352fa9c1982@k17g2000yqb.googlegroups.com>...
> > Hi everyone,
> >
> > Here's the crazy idea- I've got some data that has portions that are
> > gaussian and portions that are exponential (it comes from
> > cathodoluminescence (CL) in a jeol sem). I found a piecewise function
> > in a text book for CL that I'd like to see how well it fits to my
> > data.
> >
> > Basically, the emission data I'm trying to fit has a front and rear
> > tail that appear exponential, and a middle region (with the maxima)
> > that is gaussian.
> >
> > Is it possible to curve-fit a constrained piecewise formula? I
> > noticed the piecewise fitting routine on mathworks files, but this is
> > for a monotonic function? I tend to use cftool gui, but can learn
> > another method to make what I need to do work.
> >
> > I'm going to just start by plotting by hand and see if I can get
> > somewhat close to the parameters for the data, which will help with
> > any constrained fitting routines.
> >
> > Is this impossible? Or nearly impossible?
> >
> > Thanks for your thoughts!
> > -Allen
>
> I hesitate to disagree with Bruno and John, but I assume you're trying to fit data points of luminescent intensity vs. photon energy? If you need a smooth interpolated curve, then their suggestions are all you need (you'll require the optimization toolbox for the SLM tools).
>
> If you want to fit the data to theoretical models and work out the slope of the tails and the center and FWHM of the Gaussian for more fundamental reasons, then you have several approaches. The easiest would be to fit the central portion of your data with a Gaussian fit (or simply take the log of the amplitude and fit a quadratic), and fit your tails separately with exponentials (again, take the log of the amplitude and fit straight lines) and then work out some ad-hoc weighted transfer function between the separate parts.
>
> It also depends on how good your data is. The only references I could find on this date from the late 1970s, so it's not inconceivable that you could work out a better model on your own with improved data and numeric tools.

Well, feel free to disagree. Debate is good. Let me
explain my philosophy here.

When I see someone say they want to fit a curve
like this, where they want to use a Gaussian in one
part of the curve and an exponential in another,
they are doing so only because those pieces have
the basic shape they are looking for. They are usually
not doing so because they have any fundamental
reason for needing EXACTLY that fundamental shape,
as opposed to some other class of curve that has the
same intrinsic behavior.

If this is true, then the OP might as well use a spline
fit that can be carefully tuned to model their data
along with the expectations for the underlying
curve the OP wishes to extract from the fit.

Next, if the OP really does need to use a Gaussian
in the middle section, then a Gaussian that has been
modified by blending it with an exponential is no
longer truly a Gaussian. It becomes just another
arbitrary curve shape that sort of looks like what
they want. MAYBE.

Why do I say maybe? I recall creating an example
of such a linear combination blending between two
curves, both of which were realistic in the regions
where they were modeled, but when you applied
a blending scheme to them, you ended up with
strange artifacts in the region of overlap. It was
documented in a report I wrote many years ago,
so I might be able to find it.

If the OP really needs a Gaussian in the middle for
example, then the choice of where to put the breaks
is important, but is probably also non-obvious. This
can be a difficult task to model such a piecewise
nonlinear curve well. Since a spline is so easy to
formulate that has the required behaviors and
shapes, use those tools here.

And if you will split the data into segments, fitting
only one segment independently from the rest with
the chosen models, then you are not using the
global set of data to best advantage. This comes
neatly from a spline.

So yes, you CAN build a nonlinear spline (of sorts)
from the pieces indicated, using a linear blending
to interpolate. But I doubt it is a good choice here.
It might be, but I doubt it.

John

Subject: Fitting using multiple functions (piecewise?)

From: Luca Zanotti Fragonara

Date: 1 Mar, 2010 14:38:02

Message: 8 of 15

"Allen H." <ajhall@gmail.com> wrote in message <f67aca84-b097-408d-abb7-2352fa9c1982@k17g2000yqb.googlegroups.com>...
> Hi everyone,
>
> Here's the crazy idea- I've got some data that has portions that are
> gaussian and portions that are exponential (it comes from
> cathodoluminescence (CL) in a jeol sem). I found a piecewise function
> in a text book for CL that I'd like to see how well it fits to my
> data.
>
> Basically, the emission data I'm trying to fit has a front and rear
> tail that appear exponential, and a middle region (with the maxima)
> that is gaussian.
>
> Is it possible to curve-fit a constrained piecewise formula? I
> noticed the piecewise fitting routine on mathworks files, but this is
> for a monotonic function? I tend to use cftool gui, but can learn
> another method to make what I need to do work.
>
> I'm going to just start by plotting by hand and see if I can get
> somewhat close to the parameters for the data, which will help with
> any constrained fitting routines.
>
> Is this impossible? Or nearly impossible?
>
> Thanks for your thoughts!
> -Allen

If you have that your data are kind of similar at an exponential curve and a gaussian curve in the middle, I would think in two way:

1) Build a fitting function as f=F1(a,b,c)+F2(d,e,f)
where F1 is the exponential and F2 the Gaussian, and you minimize guessing the parameters of the two separated function.

If the model is to rough, you could think of separe your data in two different function, and fit them lonely.

2) You can split the curve where the "function" seems to change.

Subject: Fitting using multiple functions (piecewise?)

From: Bruno Luong

Date: 1 Mar, 2010 15:33:21

Message: 9 of 15

Attention to Allen: There is one interesting mathematics property that I would like to state: The B-spline basis (Benstein basis) converges to a Gaussian curve when the order tends toward infinity.

Bruno

Subject: Fitting using multiple functions (piecewise?)

From: Allen H.

Date: 1 Mar, 2010 19:55:01

Message: 10 of 15

On Mar 1, 9:33 am, "Bruno Luong" <b.lu...@fogale.findmycountry> wrote:
> Attention to Allen: There is one interesting mathematics property that I would like to state: The B-spline basis (Benstein basis) converges to a Gaussian curve when the order tends toward infinity.
>
> Bruno

Hello again everyone!

Thanks so much for this discussion, it hits exactly upon the points
that I wanted to understand regarding splines and functions of
specific shape. I agree with much of what John is discussing, and
feel that fitting in particular may be questionable with my data- the
reason? The total data output is the convolution of minute areas of
material that emit at specific frequencies, likely in a gaussian
emission, but then overlap with each other to produce a very large
broader semi-gaussian peak. Being that the variations in the material
tend towards a gaussian distribution, the peak shape tends to be
gaussian (made up of little gaussian peaks if you can believe it- but
our methods can't see them well enough)... that only leaves the tails-
which we currently believe are likely related to "Band-tails" in the
electronic band structure of the semiconductors- i.e., the population
of electrons in the conduction band gets denser in an exponential
manner as one get further into the band, away from the band-tail.

So, there are physical reasons for wanting these peak shapes, and they
are intimately linked to what we believe the physics of the
semiconductor are saying to us, however, I understand completely what
John is suggesting, and in many cases this may be the primary interest
of a fitting routine. I too have a problem with the area of
discontinuity between the exponential section and gaussian section-
and exactly how does that change? The only possible solution I've
come up with is the distribution of the material properties is what
allows that discontinuity to become washed away by little emissions in
different areas of the material. [This is fairly common in our
material- which is ternary, and just a complete mess.]

Luca- thanks for the good ideas! I think the additive function likely
won't work in this particular case, but I think in other cases it
would be perfect. Thank you for the suggestion! (I may still try
this- it's not a bad idea.)

Bruno- Very interesting! I was wondering if there were types of
splines that tended towards known curves when certain coefficients
went to limits- exactly the type of question I was asking! Thank you!

So, I hate to say this, but I think I'm chopping up my data near
portions of inflection (or more likely where the data leaves the
gaussian) and fitting by hand each segment- the added advantage to
this is it's exactly what my professor is doing in a huge excel-
spreadsheet by hand. (ick ick)

:) Big cheers, guys! Thank you for this discussion!!
-Allen

Subject: Fitting using multiple functions (piecewise?)

From: John D'Errico

Date: 1 Mar, 2010 21:29:25

Message: 11 of 15

"Allen H." <ajhall@gmail.com> wrote in message <d6820909-5cdf-480a-88af-caf552d24351@o30g2000yqb.googlegroups.com>...
> ...
> > If you want to fit the data to theoretical models and work out the slope of the tails and the center and FWHM of the Gaussian for more fundamental reasons, then you have several approaches. The easiest would be to fit the central portion of your data with a Gaussian fit (or simply take the log of the amplitude and fit a quadratic), and fit your tails separately with exponentials (again, take the log of the amplitude and fit straight lines) and then work out some ad-hoc weighted transfer function between the separate parts.
> ...
>
> Hi everyone!! Something is definitely wrong with my gmail push these
> days- I missed your messages! Thank goodness I checked on here
> tonight! I want to first thank everyone who posted- John, Bruno,
> Mark! Thank you *very* much. I really appreciate hearing from those
> who have dabbled into these darker areas of fitting! My hat is off to
> all of your work!
>
> John- I read your work very closely- I did find the spline fit tool
> you created, and it appears to be excellent. One question I have for
> you is exactly to Mark's point- when the fit is completed, and you
> have a good spline curve with multiple sections defined- is there any
> way to get back to the non-spline form of the equation which is
> recognized to be the trend of your data? i.e., if it's gaussian in
> the middle, is there a manner to which I can get back to the gaussian
> coefficients? or the exponential sections?

But it is not gaussian, or exponential, etc. At this
point, it is simply a segment from cubic polynomial.

You cannot simply turn one into the other. For
example, an exponential is represented by a Taylor
series, thus a polynomial with an infinite number of
terms, all of which have explicit relations between the
coefficients for it to be an exponential.


> The fits are most useful
> when they can tell you more about your data, and so, Mark has hit upon
> the crux- I'd like to learn about the various coefficients for the
> curves that create the shape of the peak.

You can compute curvatures, derivatives, etc, that
will relate to the nonlinear parameters. You could
probably even compute an average, effective "rate"
parameter over a segment. Thus, for a curve that
looks like an exponential, compute the function:

  R(t) = f'(t)/f(t)

You could generate the average value for that "rate"
over the segment by integration. Where R(t) is
negative, this corresponds to a negative exponential
segment.

Similarly, one could compute effective spreads for the
Gaussian-like mode in the center. Compute the location
of the maximum, then look to see how quickly the curve
drops off from that maximum. The width at half height
will be proportional to the spread of the Gaussian mode.
(One can compute what the proportionality factor is,
but I'm feeling lazy here.)

 
> Bruno- I also read about your free-knot fitting- awesome work as
> well! Seriously, guys, my hat is off to both of you- I don't even
> know how you accomplished such amazing tools! Awesome work! [I'd
> love to be able to create such a tool- but both time and current
> knowledge is lacking, unfortunately!!]
>
> Mark- I think you touched on the biggest point here- I am trying to
> eek out info from my dataset, and knowing the forms of the curves for
> each section is what helps us determine the parameters for the fit.
> Now, a lot of things can be added here- is this old fitting from the
> 70's etc (Yacobi and Holt I think it was) any use? Maybe not!! Maybe
> all I really should do is cut the data up as you suggest and try
> fitting each segment. In fact, since it's taken quite some time to
> wrap my head around the possible manners to which I could LSQ fit the
> curves, I'm thinking that might be the fastest approach- all be it a
> bit messy, but fastest. Interesting idea about the weighted mix of
> the two!

As I suggested, computing a weighted mix of curves is
possible, but problematic. It will require care to do well,
and care to watch for problems. It will also be less than
optimal, since unless you build an effective nonlinear
"spline" from the pieces itself, the resulting curve fit will
use the data inefficiently.

Regardless, this will then require a nonlinear optimization
to build those models, thereby requiring starting values
for the parameters, etc.

John

Subject: Fitting using multiple functions (piecewise?)

From: Mark Shore

Date: 2 Mar, 2010 00:45:23

Message: 12 of 15


>
> As I suggested, computing a weighted mix of curves is
> possible, but problematic. It will require care to do well,
> and care to watch for problems. It will also be less than
> optimal, since unless you build an effective nonlinear
> "spline" from the pieces itself, the resulting curve fit will
> use the data inefficiently.
>
> Regardless, this will then require a nonlinear optimization
> to build those models, thereby requiring starting values
> for the parameters, etc.
>
> John

To use your data efficiently and fit it to the desired starting model in its most general form, you'll have to minimize the residuals to a function with at least seven, and more likely nine or more independent variables. Something along the lines of

I(x) = exp(a1x+b1) + exp(a2x^2+b2x+c2) + exp(a3x+b3) + f(x)

where sign(a1) = -sign(a3) and a2 < 0. The background f(x) may be a simple linear function of x, a constant or even 0 if you're lucky (but luck is never to be relied on in science and engineering). Measurement uncertainty or other noise near the ends of the tails will have a disproportionate effect on the fit unless weighted appropriately.

As suggested by John, fitting the whole data set at once will be more effective than doing three separate fits, but you could use the piecewise preliminary fits to get starting parameter estimates.

And of course, bear in mind Lippmann's comment: "Everyone believes in the normal law, the experimenters because they imagine it is a mathematical theorem, and the mathematicians because they think it is an experimental fact."

Subject: Fitting using multiple functions (piecewise?)

From: Mark Shore

Date: 2 Mar, 2010 01:24:22

Message: 13 of 15

"Mark Shore" <mshore@magmageosciences.ca> wrote in message <hmhn33$rk$1@fred.mathworks.com>...


> To use your data efficiently and fit it to the desired starting model in its most general form, you'll have to minimize the residuals to a function with at least seven, and more likely nine or more independent variables. Something along the lines of
>
> I(x) = exp(a1x+b1) + exp(a2x^2+b2x+c2) + exp(a3x+b3) + f(x)
>
> where sign(a1) = -sign(a3) and a2 < 0.

Oops. Overlooked that the range of exp(a1x+b1) and exp(a3x+b3) must be limited to a subset of x or they grow without bound. So you're stuck with splitting the function into two parts or figuring out some clever workaround. Maybe a hyperbolic function, if the two tails are symmetric...

Subject: Fitting using multiple functions (piecewise?)

From: PhysicsGal Meyer

Date: 3 Jun, 2010 19:59:21

Message: 14 of 15

Are any of you guys still watching this? You seem smart and you've already discussed this issue.

On a similar note, I'm trying to fit a function that is undefined at the maximum, but has a limit that I know. So I was thinking piecewise, but apparently that is not an easy thing to do. Any other ideas for this? I tried just cutting out that data point, which works fine, but it's not very elegant and who want to throw away data where your signal is highest, even just one point?

I'm no expert, so this spline thing sounds pretty complicated, for this application. Really I just wish I could plot the function, but replace the undefined value with the limit.

Thanks for any help you can give me. Right now I'm out of fresh ideas.

Stephanie



"Allen H." <ajhall@gmail.com> wrote in message <f67aca84-b097-408d-abb7-2352fa9c1982@k17g2000yqb.googlegroups.com>...
> Hi everyone,
>
> Here's the crazy idea- I've got some data that has portions that are
> gaussian and portions that are exponential (it comes from
> cathodoluminescence (CL) in a jeol sem). I found a piecewise function
> in a text book for CL that I'd like to see how well it fits to my
> data.
>
> Basically, the emission data I'm trying to fit has a front and rear
> tail that appear exponential, and a middle region (with the maxima)
> that is gaussian.
>
> Is it possible to curve-fit a constrained piecewise formula? I
> noticed the piecewise fitting routine on mathworks files, but this is
> for a monotonic function? I tend to use cftool gui, but can learn
> another method to make what I need to do work.
>
> I'm going to just start by plotting by hand and see if I can get
> somewhat close to the parameters for the data, which will help with
> any constrained fitting routines.
>
> Is this impossible? Or nearly impossible?
>
> Thanks for your thoughts!
> -Allen

Subject: Fitting using multiple functions (piecewise?)

From: John D'Errico

Date: 4 Jun, 2010 03:38:04

Message: 15 of 15

"PhysicsGal Meyer" <brastarREMOVETHIS@gmail.com> wrote in message <hu91ip$ppq$1@fred.mathworks.com>...
> Are any of you guys still watching this? You seem smart and you've already discussed this issue.
>
> On a similar note, I'm trying to fit a function that is undefined at the maximum, but has a limit that I know. So I was thinking piecewise, but apparently that is not an easy thing to do. Any other ideas for this? I tried just cutting out that data point, which works fine, but it's not very elegant and who want to throw away data where your signal is highest, even just one point?
>
> I'm no expert, so this spline thing sounds pretty complicated, for this application. Really I just wish I could plot the function, but replace the undefined value with the limit.
>
> Thanks for any help you can give me. Right now I'm out of fresh ideas.

Using the SLM tools, there is no problem with specifying
a known value of your function at some point.

John

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us