robertw has asked for the wisdom of the Perl Monks concerning the following question:

Dear Perl Monks,

I have always been wanting to make a program capable of processing seemingly random input and make a formula that explains all the input.

I read this article today which made me remember this, it is about how stock market graphs correspond to completely irrelevant data, how one formula synchronizes with the S&P500 of 1883-1992. The formula is below since it does not come out correct in google translate

25*1016-.26*1013y+.12*1010y2-320000.y3+56.y4-.0064y5+.49*10-6y6-.24*10 +-10y7+.69*10-15y8-.88*10-20y9 http://translate.google.com/translate?hl=en&sl=nl&u=http://www.iexprof +s.nl/Column/Opinie/80107/Succes-met-voorspellen.aspxprev=/search%3Fq% +3Diex%2Bprof%2Bvoorspel%2Bsucces%26hl%3Den%26biw%3D1280%26bih%3D659%2 +6prmd%3Dimvns&sa=X&ei=ixD3T_SrL8HN0QWd_4GMBw&ved=0CFEQ7gEwAA

Do you know anything about a perl module or any kind of way to create a formula through a program based on either randomized or non randomized input? A formula that corresponds with all that is put in? I really appreciate your input on this matter:)

Replies are listed 'Best First'.
Re: formula creating algorithm
by BrowserUk (Patriarch) on Jul 06, 2012 at 17:54 UTC

    Start here. See also.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      I never knew linear regression before, I do have some experience with quantitative finance though its often hard to find data sources apart from html parsing yahoo finance archives. I did not know i was going to get such a fast response, if other people can contribute i would be very grateful to hear their advice or maybe some handy perl module recommendations as well but this is already such a helpful answer. I thank you very much.
        maybe some handy perl module

        Take a look at Statistics::Regression. Not a "recommendation" as I've never used it, but it might get you started.

        It is also possible, and often more effective and efficient, to tackle this kind of problem using Genetic Programming algorithms.

        But you need to know pretty well what conclusions you are looking for up front to construct the algorithm, and that often leads to the curse of statistics: the forgone conclusion. Ie. Finding exactly what you set out to find.

        But done properly -- using independent criteria -- it can reach conclusion -- positive ot negative -- very quickly. Which can be very useful for exploring a whole gamut of possible correlations and rejecting many of them as early as possible. You can then concentrate the usually slower, more laborious, formal arithmetic techniques on the few remaining.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

Re: formula creating algorithm
by zentara (Cardinal) on Jul 06, 2012 at 21:05 UTC
      Thanks you guys this is awesome help

      I am well on my way now with these modules and studying linear regression.