# How to get mathematical model from a data set

51 views (last 30 days)
Andrew Farsech on 8 Dec 2015
Commented: Andrew Farsech on 8 Dec 2015
I have some values imported from excel about the annual sell of a product, with 3 var, month, price, sold items I have seen how to plot a chart using curve fitting tool but I need to define a math expression that can describe the relation between these variables. How can I do this in matlab? Is there any tool that can achieve this automatically.

Star Strider on 8 Dec 2015
Not really. You have to have some idea of the relationships between the variables in order to hypothesise a mathematical model. Then you can use a number of statistical tools (for example the likelihood ratio) to compare different mathematical models to determine the one that best explains the data.
The first step regardless is to plot your data and see if any trends are evident. With three variables, you might want to plot ‘sold items’ (Z) as a function of ‘month’ (X) and ‘price’ (Y).

Walter Roberson on 8 Dec 2015
There are various routines in the Financial Toolbox; see http://www.mathworks.com/help/finance/functionlist.html but nothing springs to mind except maybe the SDE.
The most obvious possibility would seem to be Curve Fitting Toolbox
There are techniques that are used for timeseries in Neural Networks; see for example http://www.mathworks.com/help/nnet/ug/design-time-series-narx-feedback-neural-networks.html
There are possibilities in the Statistics Toolbox
But as for automatically determining the relationship between variables: No, you cannot do that. For any finite set of points, there is an infinite number of possible relationships that exactly match the data, let alone saying that there might be errors (or measurement limitations) in the original data that lead to many more possible relationships. There is no mathematical way to know that any one of those relationships is more correct than the others. You must therefore make use of any information you have about what would cause those variables to have a particular relationship to each other, and use that information in forming models and evaluating their effectiveness.
If there were tools that could automatically find the relationship between variables, then the tools would be able to explain why there is a correlation better than 0.99 between Margarine Consumption in Maine, and overall US Divorce Rates Andrew Farsech on 8 Dec 2015
Maybe I wasn't clear enough. if you see the data as an infinite set of point the relations are infinite, you cannot say why in a point there is that value, but if you look at the chart harmony should exist a way to use an approximation that can mime the behavior(maybe with spline functions or n-point-hermit), is enough one approximated expression of the model that for the 3 var replicate a similar chart if plotted. Certainly you don't need to know why there is the correlation to achieve this.

### Categories

Find more on Noncentral t Distribution in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!