Can I use matlab to curve fit/predict market price of a company? I

Ok, So I want to model the closing price of Apple (for educational purpose) and I am looking for mathematical tools that would make it easier. I have used excel to get a trend line of 6th degree polynomial. <https://docs.google.com/file/d/0Bz9r9M4ruXtrWjMwUmRtNTVfbGc/edit?usp=sharing>
I want my input to have the data integrated from 1990 to 2010 and with that, i want the my estimation function to be able to approximate closing price of 10 years.
I know i have to use probability and statistics theories but i wanted some specific answers about what theory I must use.
I would be glad if you could guide me to the tools that can be used in matlab for the job and also, tutorials too :D
Thanks

1 Kommentar

i looked into this webinar https://www.mathworks.in/webex/recordings/NA_110324_fittingml/index.html
but it was not much of help. Too technical.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Sean de Wolski
Sean de Wolski am 17 Sep. 2013
Bearbeitet: Sean de Wolski am 17 Sep. 2013
Do you have the curve fitting toolbox? If so, either click on the curve fitting app in the apps gallery or run:
>> cftool
This will pull up an interactive environment for you to do your curve fitting.
As an aside, I highly recommend against fitting high order polynomials to anything. They're highly unstable, overfit to noise, are useless for prediction and have no place in physics. If you are trying to fit to something that does not have an analytic model, such as a stock price, use one of the data driven modeling techniques. This webinar might interest you:

2 Kommentare

I've heard if you use a n+1 degree polynomial to perfectly fit any n-points :-). Complex coefficients in question in the most general case.

Melden Sie sich an, um zu kommentieren.

Try this untested code:
[coeffs, s, mu] = polyfit(dates, prices, 6);
extrapolatedPrices = polyval(coeffs, extrapolatedDates, s, mu);
plot(extrapolatedDates, extrapolatedPrices, 'b-', 'LineWidth', 3);
grid on;
fontSize = 24;
title('Apple Stock', 'FontSize', fontSize);
xlabel('Date', 'FontSize', fontSize);
ylabel('Stock Price', 'FontSize', fontSize);
Of course you need to supply the arrays with the known stock prices and the dates.

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 17 Sep. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by