in reply to Confirming what we already knew

You are correct that C is much faster than perl at number crunching. In this case, perl is a screwdriver and the problem is a nail. Perl could compete if you use something like PDL to handle the math in matrix form.

Otherwise, you can write your own Inline::C or XS code to speed up your code. I think that Inline::C could work very well for your application. You can have the speed of C with perl's ease of development. An electric nail-gun!

For analyzing stocks I like R, especially as a post-processor for the data. It has CRAN, which takes after CPAN.

It should work perfectly the first time! - toma

Replies are listed 'Best First'.
Re: Re: Confirming what we already knew
by AssFace (Pilgrim) on Mar 05, 2003 at 14:27 UTC
    interesting - I wasn't familiar with R nor S prior to this. I'll have to read up on that - from my 2 second glance at the page, it looks like it is good at graphically representing data?

    I'll look into the Inline::C stuff in the future, but for now I'm just going to use Perl to grab a directory, read in all of the filenames in there, and then loop over those, feeding one at a time into forkmanager, which will then spawn off my C program - this works nicely on clustered systems, but will be fine for a single machine as well.

    That way I can write the controlling and analysis code in Perl and that suits my needs just fine.
    For future projects I will definitely look to Inline::C if I run into a performance question again.
      R is really good at creating statistical models from your data. It works interactively and as a programming languate. It can create decent graphs, which is helpful for interactive model-building.

      Typical models in R include linear, generalized linear, generalized additive, local regression, tree-based, and nonlinear. A good book on this is Statistical Models in S by Chambers and Hastie.

      I have used it for stock analysis and for web log file analysis. It is not particularly fast, so you would benefit from performing data reduction on your dataset before handing it off to R.

      It should work perfectly the first time! - toma