Lua jit tests faster than Julia for Stock Prediction Engine

Lua jit tests faster than Julia for Stock Prediction Engine

I started testing Julia as a possible alternative because Julia advocates claimed the interpreter loop was nearly as fast a C and it was similar in concept to Python which I love but which was too slow for our application.   I recently ran across a blog entry mentioning a new Lua Jit. I found it intriguing because Lua did quite well during our last round of tests.

Performance comparison Julia versus Lua Jit

Relative Execution Time. Lua Jit as baseline – lower is better  
Operation Lua52 LuaJit Julia Julia Typed Array
Parse File into Data Frame 2.42 1.0 5.64 5.64
Compute SMA(14) 2.81 1.0 6.87 0.70
Compute SMA(600) 33.32 1.0 80.00 1.30
Compute SMA_slice(14) 2.42 1.0 11.87 1.83
Compute SMA_slice(600) 33.32 1.0 15.52 5.90
Did not implement slice in Lua so re-used the timing from nested loop version.
Response times are in seconds.

Only 1 tested Julia operation was faster than Lua JIT

The only function where Julia out performed Lua Jit was in the SMA(14) all other items tested were slower.   I think the reason it did better in this instance is that the SMA function must allocate a new array with 71K rows to store the results. In Julia you can do this as a typed Array of float.   In Lua this is done as an append to list so it is allocating memory in little pieces. In the SMA(600) the Lua jit was faster again because it is doing more work compute in a tight loop relative to the memory allocation overhead.

Continue reading “Lua jit tests faster than Julia for Stock Prediction Engine”

Why Language Performance Matters & Some Measurements

An optimization pass that takes 10 minutes in one language could take 15 hours in the slower language.

I work from the philosophy that I want the highest performance I can afford but this is traded off against development costs and delivery time because a great solution 6 months later  may be less valuable than a good enough solution 6 months sooner.

Continue reading “Why Language Performance Matters & Some Measurements”

How Day purchased and Week of Month affects option trading sucess

The Bayes Analytic engine is designed to predict probability of success for a given offer to meet a goal.   In some instances the goal could be will a particular customer buy from a specific offer.   I originally designed the stock prediction Engine to answer the question of which recent trades have the highest probability of meeting a specific goal such as increasing in value by 23% over a 7 day period.   The idea was that if we treat every option trade like an offer if we could isolate the set of offers which provided the highest probability of reaching the goal then we could buy those and skip the trades which offer a lower probability of delivering a profitable trade. Continue reading “How Day purchased and Week of Month affects option trading sucess”

Bayes Analytic Retail Marketing with Machine Learning

The Bayes Analytic engine is a  machine learning classification engine designed to predict which stock offers a have the highest probability of success.  This can be applied to  price movement or customer behavior.     The engine can be of benefit to organizations that maintain long-term relationships with their customers.  It can ensure more customers receive offers for products they will find valuable which can increase the sales per contact and cause customers pay more attention to future communications. Continue reading “Bayes Analytic Retail Marketing with Machine Learning”