# How to fit an equation to a curve with disturbances

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:

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

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)$.

regards

-
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. – Arkamis 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.