Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example, I have the following data:

$Y = 366$ measured values

$X = 366$ measured values

$t = [ 1 : 366 ]$, representing the days of the year (index)

So at each $t$ (day), we have value of $Y$ and corresponding value of $X$. When drawing $Y$

and $X$ vs. $t$, it shows a continued curve for $Y$ with disturbances. These disturbances

are caused by the change of $X$ and it is clear that $Y$ is mainly affected by $X$, meaning

that: $Y = f(X)$

This figure is shown here:

Y and X plot

This figure shows $Y$ vs. $X$:

Y vs. X scatter plot

My aim is to find this relation between $Y$ and $X$ or in another words: $Y = f(X)$.

What I have tried and think so far is first to smooth the curve $Y$ and from the

smoothed points and smoothed curve, some function may be established.

Then, including the effect of disturbances (up and down) by some function,

may be exponential.

Could you please guide me how can I manipulate this problem to get

a final model $Y = f(X)$.


share|cite|improve this question
Looks quite messy. I'm not quite sure if your data's trying to be exponential or sigmoidal in the second plot... – J. M. Sep 20 '11 at 18:30
When you say disturbances, what exactly do you mean? For example, are these observation errors? In particular, are they equally applicable to $X$ and $Y$, or are these quantities (and their observations) fundamentally different types of processes? The reason I ask is because in classic nonlinear regression, which models dependence as opposed to least squares or curve fitting which model relationship, $X$ is assumed to have no error. – bgins Mar 19 '12 at 8:09
If you want to get a function $y=f(x)$, you must have 1 y value for each distinct x value. Looking at the second chart, taking x=20 for example, there seems to be several y-values. So is this the case or is this due to the fact that x values are so close? – NoChance Mar 19 '12 at 8:53
To me, this looks linear with a low-end saturation. – Emily Aug 9 '12 at 1:16

Usually people do regression, ananlysis of variance, and perhaps also time series for problems like this. Regression means least-squares fitting of the data to a curve of predefined form but unknown parameters. The analysis of variance is a breakdown of the residual errors to search for systematic components, to see how well the model fits the data. Time series can help you find further relationships. It might also be interesing to see your second plot with data points on either side of $t=200$ (or near the ends versus near the middle, or into $7$ partitions by day of week, etc.) having alternate colors.

share|cite|improve this answer

There are applications around that will fit curves to data, using a number of functions such as polynomial, exponential, and trig functions. For example, Matlab has built-in curve fitting and there are some add-on toolboxes for it as well.

share|cite|improve this answer
I already used curve fitting toolbox in matlab but it only fits the curve, meaning that it finds the average curve and this is easy, but it does not follow the up and down disturbances in Y that are caused by the change of X as shown in figure 1 . My goal is to find Y = f ( X ) so that if I gave the equation a value for X, it gives me the value of Y and then compare the result to the original measured Y data. If the two Y values are near to each other, then we can use this equation for predicting unknown Y values by entering new X values to the equation. thanks – Arth.Mc Sep 20 '11 at 19:03
I see -- I misunderstood the question. Thanks. – xpda Sep 20 '11 at 19:29
I don't know Matlab, but Excel will happily fit a polynomial of any order you the two columns of X and Y data. Just make an xy scatter plot and ask for a fit. – Ross Millikan Dec 20 '11 at 1:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.