Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Petite Abeille
On Mar 28, 2012, at 12:50 AM, Simon wrote: > - Look at sqlite's source code and try to implement analytical functions > in a way that leads to an optimization better than log(n^2) and contribute > my findings on this topic back to the community. Enhancing SQLite with analytics would be a

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Darren Duncan
Simon Slavin wrote: On 27 Mar 2012, at 11:50pm, Simon wrote: Thank you all very much for all your answers, they have been most useful. You're welcome. Something else to consider is whether you should be doing this in C. C++ can do everything, but it's not ideally

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon Slavin
On 27 Mar 2012, at 11:50pm, Simon wrote: > Thank you all very much for all your answers, they have been most useful. You're welcome. Something else to consider is whether you should be doing this in C. C++ can do everything, but it's not ideally suited to heavy

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon
> > I would love to do an sql query that would look like the following > ones. I wonder if they are possible and valid applications for SQL and > what would be the proper implementation for these. I know I can calculate > all this using C, but it would be most useful (to my later projects) to

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon
> I think it is possible to create a custom aggregate function which would > work on a cross-join of the data to analyse. The cross-join makes all the > data available to each bucket (group by Date, for example), and each bucket > is basically one row of the whole data. The aggregate function

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon Slavin
On 27 Mar 2012, at 9:47pm, Simon wrote: > But I don't think aggregates is the key here... Basically, the kind of > function I need is something like this: > For each row, in this column, calculate the foobar result on all (or a > group of) the values of another column. > I

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon
> > A DBMS is a good way to keep your raw data. But I highly doubt that a > majority of your analysis algorithms are going to be expressible in SQL > without going way beyond the intended purpose of the language. I think you are right, but the cases where it can be expressed in SQL means it can

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon
> Generally speaking, analytical functions (aka windowing functions [1]) > would appear to be the most useful for your endeavor. > > Sadly, SQLite doesn't provide anything like this out-of-the-box. > I wasn't aware of the term. Thanks! I'll be able to google on that now! ;) And here are

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Gabor Grothendieck
On Tue, Mar 27, 2012 at 3:02 PM, Simon wrote: > select closing_price, moving_average( funky_oscillator( closing_price ) )... There is a moving average calculation in SQLite here but given the complexity you might prefer to do the analytical portion in your program:

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Doug Currie
On Mar 27, 2012, at 3:46 PM, Larry Brasfield wrote: > A DBMS is a good way to keep your raw data. But I highly doubt that a > majority of your analysis algorithms are going to be expressible in SQL > without going way beyond the intended purpose of the language. You will > either find

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Larry Brasfield
Hi there, I'm about to start a project I have been thinking about for a long while. I basically wish to analyse stock market data. I already have the data in a table and I'm now in the process of writing my own indicators and oscillators. I hope to learn while re-inventing this wheel and

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Petite Abeille
On Mar 27, 2012, at 9:02 PM, Simon wrote: > I would love to do an sql query that would look like the following ones. > I wonder if they are possible and valid applications for SQL and what would > be the proper implementation for these. Generally speaking, analytical functions (aka windowing