Forums  > Software  > Open source domain-specific language for time series  
     
Page 1 of 1
Display using:  

punkbrwstr


Total Posts: 2
Joined: May 2018
 
Posted: 2018-05-18 16:53
I have been working on functional DSL called Pinto that is made for financial time series. I think I have the syntax relatively ironed out. It's a stack-based "concatenative" language like postscript or forth and uses postfix notation. Python-style indexing makes it easier to apply functions to specific parts of the stack. Expressions can be evaluated over any time range or (supported) periodicity. It includes interfaces for blp and iex. I have been using it myself and I think an efficient way to define series, but would be interested if anybody had any ideas to contribute.

https://github.com/punkbrwstr/pinto

Patrik
Founding Member

Total Posts: 1354
Joined: Mar 2004
 
Posted: 2018-05-18 21:47
I've tinkered with similar ideas, but in a lisp (clojure) setting. I've got a declarative time series "dsl" (depends on your definition of such a thing in a lisp context) to model time series from various sources and for defining general purpose time series functions.

The time series, or network of time series coming out via various functions are defined declaratively and can then be batch evaluated over some historical time frame, or fed new "real time" data with consumers of the outputs reacting to new data. I tend to think of time series modelling a lot like information flowing through a network like an electrical circuit with components having inputs and outputs.

Your project looks cool, although it'd take me a bit of time to get used to the syntax and terseness. I don't see any obvious references to the ongoing realtime updating setting (as opposed to historical batch processing setting) - is that an area you have thought about at all? I like the mindset of using the same code for batch work and ongoing updates. It's been moderately successful to me but my attempt still needs more time and love to come to full fruition.

Capital Structure Demolition LLC Radiation

punkbrwstr


Total Posts: 2
Joined: May 2018
 
Posted: 2018-05-21 17:33
I have thought about handling real-time updates. It would be pretty easy to push new data through the function definitions but I haven't been ready to tackle an asynchronous api for consumers. My workaround is to take today's data out of the cache after a short time so subsequent requests pull fresh data for the latest observation.

The network analogy is a good one. I keep a bi-directional dependency graph to make sure I don’t delete a function that others depend on (and in previous, more cache-intensive iterations, to clear cache for downstream functions after a definition changes). I guess you have something similar to determine the order of batch processing and flow for real time updates.

Originally I had chosen postfix notation to simplify parsing and avoid having too many parens, but it does seem like more people are used to lisp-style syntax than I realized.

Patrik
Founding Member

Total Posts: 1354
Joined: Mar 2004
 
Posted: 2018-05-22 13:56
Under the covers my implementation uses this clojure library (mostly the streams abstraction): https://github.com/ztellman/manifold

It's a great library and it makes my work in the time series domain pretty simple (compared to not building on top of such a library).

Capital Structure Demolition LLC Radiation
Previous Thread :: Next Thread 
Page 1 of 1