Guide to this Site

Decided I should put a top-level explanation here.  Mostly, it just seems to be the data-harvesting robots that are looking at things here - but that may change, given the nature of the results that I suspect might be possible.

[Feb. 21, 2018] - I think I get the CNN (convolutional neural network) idea now.  I found I could train the Xerion Jumpvector AI down to 91% accuracy, but could not get better than 45% accuracy on the post-training test dataset. Obviously, as I train tighter on the training data, I push the training first towards the signal, then away from it, as I train down to noise.  I ran 13 separate train-then-test exercises - creating 13 different network weight-matricies.  They all perform pretty much the same, despite randomizing the net weights each time.  So I trained part-way (to about 72% accuracy) on the main training data - then loaded in the test data, and trained just a little part-way with it, then re-loaded the main training data, and trained a bit more.  I stopped the training early (which was using an effcient conjugate gradient direction selection, with a line-search step method), so you have to watch the gradient vector carefully.  This gives me semi-final results for the 13th network weight matrix of 68.41% accuracy on the primary training data (now running from Feb. 1995 to June 2017), and a level of 58.14% accuracy on the test data set.  If this result holds going forward, then I might have something.  The true signal is very weak and fraught with noise, but it looks like it might be there.  This is like tuning a radio circuit on a regenerative radio receiver (see image at right of a vacuum-tube regen radio I built to experiment with that technology).  If I understand how the Laplacian heat-transfer calculations work, then I think I might also almost understand how the CNN idea works - and more importantly - why it works.  Each network node ripples its results out to others nearby - probably like neural state-pontential leakage would actually occur in our own brains ("little grey cells", as M. Poirot would say...)

[Feb. 20, 2018] - Revisited the whole Xerion-AI project:  With my third version of network weights, for the 4500 record boolean jump-vector dataset (which only trains to 87 % accuracy), I can now get 41.17% prediction accuracy on my test boolean jumpvec dataset, for July 27 to Feb. 15, 2018.  That is a staggering improvement from the 24% accuracy I was consistantly showing.  If I can push the accuracy up above the 50% level, then any casino gambler will tell you that you might just have an edge, if one can manage the betting very carefully.  See info below for this date for more details.

[Feb. 18-19, 2018] - Updated the Xerion NN-AI for dataset from June 27, 2017 to Feb. 14, 2018.  Accuracy co-efficient is 23.4 percent - random results with a couple of degrees of freedom, I am assuming.  (Two purely random variables, each with a 50% chance, so we get a consistant percentage of correct predictions around 25 percent.  Not much use, I fear.)  See third screenshot from top.  Experimenting with TensorFLow.  Built the MNIST stuff, loaded sample MNIST image datasets, setup simple network, trained it, and got accuracy of 90.18 %. 

[Feb. 6-17, 2018] - The V-bottom is back in fashion, yes?   Mkt action typical of tightly-coupled feedback(feedforward?) self-reference system.   Probably computers should not be connected to trading feeds.   No benefit to real investors and companies using the stock market to raise funds.  But the pros have to have some way to make money off of the farmers, clearly.   Too bad the Chinese investors got nuked by the SEC for trying to acquire the tiny Chicago Stock Exchange.  (Anyone even know there was a "Chicago Stock Exchange"?).  Funny also how the Russians are being painted as the bad guys again.  Most of the world disliked Hillary Clinton (if they had any memory of the Clinton lawbreaking projects back in the old days.  Remember her "Cattle Futures" trading?)  Curious to see the latest American witchunt play out. 

Elon Musk & SpaceX Team had a successful launch of the Falcon-Heavy multi-rocket.  Bravo to them! (See "ExoPlanets & Space" for image of "Starman" driving to Mars in Elon's red Tesla Roadster!   

[Feb. 05, 2018 ] - Ugly mkt action provides opportunity for new positioning.  Been focused on mkt action.  Curious how all the news services completely miss the trigger events, and interview analysts who prattle about US Fed. Reserve and interest rate delta's and 10 Yr US Treasuries at 2.85%.  Ho hum.  No new news there.  Fully discounted, of course.  It is the Bitcoin/NIM meltdown, and the $500 million theft from Coinbase in Japan which is driving this.  (Bitcoin Investment Trust thing in Cda did a 91 for 1 split recently.  Perfect indictor of a market floating on foam and fluff-puff.)  Bitcoin and other cryptocurrencies is a great idea for a transactional tool - but as an investment, it is just another mechanism to prevent compound growth from operating long-term.  Important to keep the world poor and hungry or no one will go to work, will they?   All investment *schemes* must vaporize wealth, or within 300 years every family would have billions of dollars, wouldn't they?   Studying CNN's (convolutional neural networks, from Stanford course:  CS231N

[Jan. 30, 2018] - I was getting different numbers on the MacBook (MacOS 10.10.5) and the Linux boxes (CentOS-7.4, with current Linux kernel) in Python+TensorFlow simulation.  Downloaded & converted floating-point test suite: UCBTest,  (UCB=Univ. Calif. Berkeley, Sun Microsystems & W. Kahan, early 1990's). Also built "chkprec.c" to tweak precision control-word in Intel (for 32-bit chips), and to my surprise, the program also works to set precision on 64-bit Core-i3 Intel SSE2 chips, if running Linux (CentOS-7.4).  Resolved TensorFlow simulation problems on MacBook, by re-coding program to use *all* 64-bit (float64 instead of float32) floating point variables.

Key Results:  [Jan. 04-11, 2018] -  Successful build of TensorFlow 1.4.1 from source, on Macbook (Yosemite, MacOS 10.10.5), using Xcode-7.2.1, with Bazel 0.9.0.  [See Research Log below the pictures] - AND successful install of Python "wheel" file into Python, (built using the Tensorflow script file: build_pip_package).  Crazy simple: Just rename or copy the newly-built Python wheel-file name from "tensorflow ... cp27-cp27m-macosx_10_4_x86_64.whl" to "tensorflow-1.4.1-py2-none-any.whl" and it pip installs it fine, no problem.  Ran tests to confirm binary TF and newly-built-from-source TF run the same.  See full details of how to build at closed issue:

Strange issue.  Getting different results when running Laplace PDE simulation example on Linux and Macbook.  Mac version evolves to big positive numbers everywhere, whereas Linux version evolves to big positive and negative numbers.  With the sim tensor np.clip-ed to 0-255, the Mac version evolves to blank white image.  On a Mac running Sierra, my Linux box, and an Ubuntu Linux box, the sim evolves to something very similar to the image at right.  Unsure which is correct, doing tests.

What's Here...

  • Picture on Right:       Image created with Tensorflow 1.4.0 on CentOS-7.4 Linux box.
  • First Three Pictures:  Images created relating to TensorFlow 1.4.0 install and configuration on CentOS-7.4 Linux.  Seems to work well.  Awful image of my notes provided.
  • Picture Four:            Image showing CentOS-7.4 successful install on HP 7600 Intel-based Core-i3 (four processor), 64-bit box.
  • Picture Five:             Showing results of Python/IPython+Jupyter install and configure with various key packages, including Tcl/Tk (for use with networkx, matplotlib, pillow, etc.).  Works very well.  Real work can be done.
  • Picture Six:               Example of using "hacked" iPad-1 running ssh to remote control the Linux laptop running MPlayer-1.2.1 rendering a video on big-screen.  Home-made home theatre - can pause, skip, selected OSD/subtitles, and render downloaded videos and/or d v d based TS_VIDEO sets.
  • Pictures 7 to 13:       Images from the Xerion project in 2017.  The Xerion product is a neural-network framework from the late 1990's, developed by Dr. Hinton's team at Univeristy of Toronto.  I used it here to build and train a neural network to predict the expected direction of market prices, based on boolean-encoded slices of price data for several securities and economic series, sliced also across time.  The process worked, but results showed (again) that recent past cannot say much about the near future.  
  • Next section - the AI Research-Blog:  Field Notes on AI from Lorcalon Farm - where I have a daily log of what I am doing, and the results (or lack thereof!) that I am getting.  Just got TensorFlow 1.4.1 to build successfully from source on my Macbook.  This is big result, I think.
  • Details of how I got Sharp APL to run on the iPad.  (Uses my hacky version of DOSbox, available on Android, as "gDOSbox" at the Google Play Store)
  • GEMESYS Android Apps - gDOSbox, GNUPlot37, SharpAPL, WatcomAPL, IBM's TryAPL2 and STSC(Manugistics) APLpc - all available as no-cost apps from Google Play Store. No tracking code or in-app selling attempts.  Research results to see if it was possible.  The gDOSbox (and the GNUplot37 and the APL's) do their math correctly.
  • Pictures of versions of background work related to "AI Helper Apps" - Various useful tools I've built to run charting, number-processing and image-generation on the iPad and Android tablets. I first started building this stuff on the Blackberry Playbook, and still have a couple of Playbooks that run Market Price Analysis software similar to what is shown in these images.

This website is a work-in-progress.  Hope it is useful as a learning resource.  I will attempt to clean it up a bit and re-factor things.  Scroll down to see what is described above.

The whole thing started as the result of technology/investment assessment I did on a small company looking to raise a second round of financing.  I got brought in by the investor group to provide a quick independent assessment.  (The company's tech was fine, and they got their money, btw).  As part of initial discussion (where everyone sniffs everyone else to see if they are bona-fide or not), I mentioned the work I had done on neural-networks, in the 1990's.  The new technology-lead mentioned that Google had just open-sourced TensorFlow, and that really got my attention.  I had gone to Dr. Hinton's lectures back in mid-1990's, gotten a copy of the Xerion product, bought a copy of Slackware Linux (since Xerion was Tck/Tk and "C" based and ran on X-windows), built a working environment on an IBM P/C, (and learned Linux and Tck/Tk along the way) and had used all this to create datasets, transform them, create and train a neural-net, and build a forecasting procedure to predict commodity future prices. 

The thing sort-of worked, but not as good as I had expected.  I considered it a fail, actually - but I had learned  a lot.  The Linux and Tcl/Tk stuff turned out to be *really* useful - more so than the neural-net stuff was, since it just did not forecast very well.  But the skills were platinum, and I got pulled into many other projects, which were both interesting and lucrative.

But the open-sourcing of TensorFlow meant I could take another run at the market price prediction ideas.  I had a bunch of ideas for a different approach, including using only booleans (up, down, or zero=don't know/not enough signal).   This approach had promise, and I decided to document the whole process on this website as I proceeded.  There is value in being formal and posting results, because it keeps you on track.

At first, I had planned to use TensorFlow, but the multi-machine loosely-coupled environment I've cobbled together at the Farm, is almost all built on 32-bit machines.  I managed to get TensorFlow installed and working on a new MacBook I had, but the Apple environment is annoying.  I learned that in my initial work that involved hacking my iPad.  I wanted to use the iPad to run local versions of the trained network, so I could just drop in current price-data (after it was boolean-converted), and get my "Go Long / Go Short / Can't Tell What to Do") market-descision assistant tool, by pushing the data thru the trained neural-net.  And because TensorFlow could not be installed on any 32-bit devices, (the binaries are 64-bit), and the development/build environment is very non-standard (it uses bazel), I decided to use Xerion, as I was able to modify it, and the Tcl/Tk stuff to run on the modern Fedora Linux boxes I was running.

I got all that working - and the details re. building Xerion, hacking the iPad, and the work related to installing my own software on it (basically, the open-sourced DOSbox + a special DOS-based APL interpreter from the days of IP-Sharp) is documented here.   The first-generation iPad is a marvelous, wonderful device.  Mine is circa 2010 - and it is still running strong and I use it every day, despite having a bunch of other tablets and computers.  The UI and the UX is just plain, well done, and even with current modern Android ART stuff (on a Samsung Tablet I have), the Apple is just much nicer to use.  And with the hacks, that open up the O/S, and give you a Linux-like environment with full "root" access, you get a real computer which can do real work -  like grind thru a few matricies and calculate a result value.  (You can also use "" to watch any Youtube video, as they just render to Quicktime, and the thing just works.)

But it was the Xerion work that comprised the main project that is documented here.  I built the thing, and much of the site is devoted to documenting what I had to do to actually make the old Xerion product work successfully, the design and development of the data-management tool, and the boolean converter.  I had built a Time Series Managment database, and procedures to keep it updated, and corrected, but it ran on Windows.  I converted it to run on Linux. This involved running WINE (a framework that lets Windows programs operate nicely within and under Linux)  and it works great on Fedora and CentOS boxes I have.  Developing the Xerion-based neural-network, training it, and then evaluating it was a fairly big exercise.  You can read all about it here, as I logged the daily efforts.

And it didn't work either, just like Dr. Ng of Stanford, in his excellent lecture series, suggests it probably won't.  Market price action is inherently non-predictiable.  You can have an edge (I know this to be true, because I seem to have one - even though I am not sure what it actually is...), but basically, the recent past has no data within it to say anything much at all about the near-future.   This is the third major project that I have done that confirmed this.  Details are posted on this site.

And lots of other stuff is posted also.  I decided to re-think the whole process of how an AI (Artificial Intelligence) device should operate for an investor, in a market context.  And in other contexts, also.  Basically, you don't want to try to predict - because you pretty much cannot.  But you can still make good trades and good decisions to get better than average outcomes.  I know, because I have done this - and so have a few others.  And I am not terribly clever or smart - I am pretty average, and actually, rather stupid and careless quite often - certainly more often than I should be.

So, I decided to build TensorFlow on a 64-bit Linux environment (since I just cannot stand the Apple stuff - I just don't like the problems and issues that restrict, prevent, limit and frustrate me at every turn using Apple OSX.  It is ok - it sort-of works - but the hassles I went thru putting DOSbox on my iPad was just beyond anything reasonable.  

I had built a bunch of freeware apps for Google Android with much less difficulty, and they remain available - at zero cost, and with no in-app tracking or advertising - on the Google "Play Store" (an idiotic name - but hey, I am a dodo maybe...).  

The Android apps I built are documented here also.  You can page down to see them - gDOSbox, GnuPlot37, and several APL interpreters: IBM's TryAPL2, the IP Sharp APL (uses the actual assembler-code for the old IBM 370, and an MS-DOS interpreter), the freeware Manugistics/STSC 16-bit PCAPL, and the Watcom APL.  APL is really good at doing things like dot-product, matrix math, and other tensor-fiddling.

It turned out putting TensorFlow on the 64-bit Linux I wanted to use, was a non-trivial exercise.  The Google/TensorFlow team only supports one version of Ubuntu, and all my machines are Fedora and/or CentOS based.  But it turned out to be do-able.  I had to configure and build a local version of Python 2.7.   But I have succeeded in getting the binary of TensorFlow 1.4.0 installed and running on CentOS-7.4, and using the new, latest Linux kernel, 4.14.9.  The new experimental box is an old HP Intel Core-i3 I bought as a testbed - but it has 4 processors, runs the latest Linux, the latest systemd based CentOS, and is the latest 7.4 variant, which does not go "end-of-life" until June of 2024.  

The recent four screen shots below show the results of getting the CentOS-7.4 box up and running, and getting TensorFlow 1.4.0 (almost the latest one), installed and loadable on it.  And note, I am using Python 2.7.14 - the latest (November 2017) Python of the 2.7 stream.  I decided to use 2.7 stream, as that is what most of the documentation and data-science material I can find has as its default.  Plus, if you use Python 2.7.14 (the 2.7 stream), then you can be assured the language won't be *changed* as you develop within it!  (Hear me here... "Stability" is the new killer-app...)

The TensorFlow Tutorial had a simple simulation program that generated images, using Laplace partial differential equation (PDE) math, and the initial program used IPython (interactive Python) and Python Notebook (which is now Jupyter Notebooks), to show a real-time simulation of rain-drops falling on a pond.  I fiddled the damping parameter, the image display mechanism, and the background to create something that looks more like star formation via gravitational mass-accretion.  This program verifies that Tensorflow has been installed successfully, and is doing its mathematics correctly.  Oh, I also converted it from the TensorFlow 1.00 version (which I downloaded initially for the MacBook), to what is now TensorFlow 1.4.0, which has a more restrictive and explicit requirement to define a current session. 

The screen image below shows the TensorFlow Laplace PDE program, modified to just display interative .JPG file-based images, so it can be run in plain Python, rather than requiring the "Jupyter notebook" to be run - which basically fires up a local web-server, and then serves up the image material - ie. matplotlab graphics, and such - using your local web-browser, in this case Firefox 52.2, the CentOS-7.4 default browser.  Oh, and actually you have to toggle Firefox 52.2 to *be* the default browser, if you want Jupyter to automatically invoke itself correctly.   And the little screen-image at right, at the beginning of this document, shows the result of letting the Laplace simulation run 10,700 times, instead of the 1,470 iterations in the image below.  The code for the Laplace sim is provide in the "Code" section - just click on the top-line menu, and you can cut an paste it to check your Python and TensorFlow setup.

Much of the site is basically just the daily weblog notes.  I will re-organize things soon, I promise... Just scroll down to see the: "[Month Day, Year]" headings.  Go to the bottom and read up (it's basically a blog, or a diary), or start at the top, and read backwards in time.

My plan now, is to get the Kepler Telescope data and source-code - which used TensorFlow to assist in the discovery of many new exoplanets - and adapt that to what will be my "market pictures" - so I can use the MINST-style image-classification procedures to classify and charactersize my "market pictures".  It won't be forecasting - just assistance and augmentation to assist us in what we already are doing.

I think that is how AI technology will work.  It won't replace people, it will assist them.  It will just amplify their abilities, like so many of our important inventions have done.  Stay tuned, as they say...  Cool

- Mark Langdon,  Director & Owner
  January-February, 2018 


Laplace star-formation simulation, running under latest TensorFlow 1.4, on CentOS-7.4 (with latest Linux 4.14.9 kernel). This result matches exactly the TensorFlow run on Apple Macbook OSX - but we are now in a pure Linux environment, using latest code for CentOS 7, Linux Kernel, and TensorFlow 1.4.1. Linux and Apple Macbook now evolve the simulation the same, but I had to create, which uses "double" precision (64-bit) floating values on Macbook, due to curious problems with MacOS Yosemite.)

TensorFlow installed and works! Screen shot of TensorFlow installed on Intel Core-i3, 64-bit box running CentOS 7.4 Linux (with a 4.14.9 kernel). I've run a tiny "Hello TensorFlow!" sample program from the TensorFlow site, to validate the installation. The TensorFlow support team indicates they only support a specifc Ubuntu version of Linux, but if they have built wheel-files for pip, the stuff should install on any Linux+Python that is built right, and has the required installed libraries.

Full disclosure: This is further result of MarketAI (Xerion Neural-Net, built using jump-delta's and TANH (hyperbolic tangent) transfer function, with boolean case data. It just does not work. I was able to train to 89% accuracy, but only get around 25% accuracy going forward. This screenshot shows results from June 27th, to Feb. 14, 2018 (second tranche of test-data). Accuracy level stays roughly the same (you can see it at 23.4 percent, and also in the graphic - which shows actual jump-delta in red, predicted in blue. Just does not work. Confirms the recent past has little or nothing to say about the near future. This rocket exploded, I fear.

I have Jupyter/Interactive-Python working correctly on Linux, and this example shows the scikit-image being used to create a gray-scale version of the "testimg.png" file which I built using Python with Numpy and Pillow (updated PIL - Python Image Library), created numerically. I also have exactly the same environment now built on Windows. You need the MS C++ compiler to run "pip install scikit-image", as well as a copy of the "stdind.h" header file. I have created a detail log of what I had to do to get Jupyter/IPython and the routines to do these example, running on Linux and on Windows. I will post it once I edit it down, and remove some of the unprofessional language used in the current version (which is so full of profanity as to be unpublishable at the moment...) I had not planned to put the Python image manipulation environment on the Windows box, but I managed to get it working - after downloading a bunch of material as a test - including the MS-Visual C++ 9.0 compiler for Python 2.7, which Microsoft offers at no cost. More info to be offered in the notes on how I got Python and the image libraries to run on Linux and Windows. I also got Jupyter+IPython to run on Windows, and run the same historgram and line-graph test programs I've run on Linux. The example shown here is Linux, CentOS 6.6 on an Intel box, running a Linux 2.6.32-504 kernel, with Gnome 2.28.2. Everything works nicely. Windows version of these image test programs look the same.

Update: Got it working on the older Linux, also. Very cool. Actually, really surprising. By doing the manual builds, one really learns how the components are "glued" together. You need to get "_tkinter" (the Tcl/Tk interface) stuff working, to render images using "matplotlib", without the "notebook" stuff. (The little window, bottom right, with the gray-scale version of the colour image). This means you can build research-grade, one-off apps, to address specific, immediate needs. (See the "Linux Jupyter/Python" section for some *very* preliminary notes, including my hilarious "real-time" note on what I had to do to get Python, Jupyter, IPython Notebooks and Scikit-Image with Tcl/Tk image-rendering working on my Linux laptops. I should edit it up, but I think it is perhaps helpful to see what the user-on-the-edge-of-the-network faces when trying (successfully!), to get software working. (The Linux laptops are truly "Cyberspace Deck's", as per William Gibson's famous 1984 "Neuromancer" novel, published when the IBM P/C was 1 year old.)

Results of Jump-Delta NN-AI Experimental Work. The result above, with a coefficient of accuracy of only .24 on 81 post-training set example cases, shows the network does not work - at least not as a useful predictive tool.

The visual GNUplot chart shows what we are getting the sign wrong most of the time, and are making correct 4-day ahead predictions of percent change, only about one quarter of the time. Note that it is interesting that the co-efficient of accuracy is not changing significantly, as we add more observations, and is remaining essentially the same. The conclusion has to be that there is insufficient information contained in the 4361 training cases of 5 days of percent-changes (daily data from January 2, 2000 to May 11, 2017, five series, 5 days data for each, boolean coded), to make any useful inference about what the percent change of the target series will be, in the near-future (4 days ahead), time position.

This result actually matches what we found back in the mid-1980's, when I participated in a detailed analytic exercise for the Ontario Ministry of Treasury and Economics, where we used a DECsystem 20/20 and some state-of-the art (for those days) time-series analysis software, to determine if we could make any predictive statement about the evolution of the future course of interest rates. The existing dataset of the *now*, does not seem to be able to provide enough information to predict the near-future. These kind of studies always seem to confirm that the best estimate of the future value, is the current value, ie. the "null forecast" - basically: "It will be in the future what it is now" generally provides a superior estimate to any proactive attempt to estimate a different future value. In the old study from the 1980's, we could not even predict if a turning point was evident, much less get the sign right.

Of course, with massive data-sets, better results may be possible - but the nature of unfolding economic process, suggests that this may prove to be unlikely. The results of this exercise are also confirmed by a "two portfolio" experiment I have been running for many years. My actively traded portfolio shows substantially inferior performance, compared to a very passive, lower-risk "buy-and-hold" portfolio that I have been running in the Lorcalon process.

At some point, you have to accept what the data and the experimental results keep telling you. One can make money in the markets - but not by predicting the future course of events. The key fact here, is to make decisions based on current, accurate information, to as great a degree as is possible, and avoid the siren-song of trying to know the future. Keep your portfolio tied to the mast, if you are sailing near those dangerous shores.

My research continuely suggests that an education in classical history is perhaps more useful, than an education in advanced math, software development, and modern finance theory, if one's goal is medium and long trading / investing success.

Neural-Network-AI Experimental Results: Developed portable Xerion + TSM + Lynx(ssl-enabled) + GNUplot platform on Linux (Fedora/Redhat) laptop platform, (ACER with Intel Centrino). This Linux laptop (Gnome Desktop) also runs current Firefox (modern gtk+2, glib, gdk, etc.). Wine - Windows emulator on Linux - is used to support a runtime-version of TSM, the Time Series data manager, which transforms raw price data into training cases for the Xerion-configured neural network (NN). For the current NN-driven AI under test, the training is sourced with boolean impulse-data from various daily market prices for tradable securities and commodities, for an 18 year period. The resulting neural-network can be evaluated for current datasets (ie. the last couple of weeks) on either this platform, or using an iPad or Android tablet.

[June 28, 2017] - New image, with Probability Calculator, Time Series Manager, (with linked GNUplot graphics), Xerion NN-AI (cmd-line mode runs GNUplot display, Xerion gui showing Hinton Diagrams of network unit values for most recent data case). The "plotValues" tcl/tk prgm shows boolean training target, and output of network boolean prediction in bottom, centre chart). All is integrated using the Fedora/RedHat platform, running on the dedicated AI box, an Intel 32-bit uniprocessor. Linux utilities "DOSemu" and "Wine - WINdows Emulator [or "Wine Is Not and Emulator"], used to support Probability Calculator app, WINE used to run Time Series Manager. Xerion was compiled from UTS source, with various minor modifications to support modern (sort of) Linux kernel (Fedora/RedHat Kernel #1 SMP. (Kernel is "old" now, but has a few custom bits compiled in)). Everything together at last, and running well. Results looking good - both technology, and market tone. Note that I modified the GNUplot display of "Actual" vs "Network Forecast" to show the predicted boolean output on the top (green line), with the actual training target on lower line. This makes it easier to see most-recent predicted network value, which can be expected to drive one's tactical market efforts. FD: I remain fully invested, long.

Here is image of tanh (hyperbolic tangent) function from Gnuplot37, overlaid with hypertanf sAPL function from "neuralxr" workspace. This sAPL workspace will accept the MNnet4~1.WTT file of Xerion weights for the MarketNet network, and use dot-product to vector multiply the weights to "activate" the Xerion-trained network. This will let me "run" the network, on the iPad. I wrote the function to load the Xerion weights file into sAPL, (format: wt <- readfile fname) and second function to convert the text into numeric (format: wnet <- procwt wt). Currently, wnet is just a high-precision vector of 1281 32-bit floats. Since I'm using hyperbolic tangent instead of logistic as my transfer function, I needed to write this tiny transfer function. The tanh function already exists in GNUplot37. You can start GNUplot, and just enter "plot tanh(x)" and see this S-curve, which is the mechanism by which machine-intelligence is stored in a neural-network. Getting closer for an NN-based iPad-runable Augmenter. [Update: I wrote the function on top-left, but then remembered the APL built-in trig. functions, and yes, "7oX" gives hyperbolic tangent for X. The "o" operator is "ALT-o", and when used dyadic (two arguments), it gives access to all the trig. functions. With full precision of 18 digits enabled, the built-in "tanh" function gives slightly more precise results.]

This screen shot from the Linux AI-box is a quick way to post results - not sophisticated, but clear. Speaking of "quick", I used the "quickProp" method here, which models derivatives as independent quadratics. The method tries to jump to the projected minimum of each quadratic. This is one of the minimization methods in Xerion, and it has worked well on my signed boolean data. (See: S. Fahlman "An Empirical Study of Learning Speed in Back-Propagation Networks", 1988, CMU-CS-88-162, Carnegie-Mellon University.) Typically this method uses fixed steps with epsilon of 1, but I used a line-search here. The error value (f:) is driven down below 300, with a gradient vector length of less than 6. From the plotValues.tcl chart, one can see it improves on the previous result. If this network is this good on a different dataset outside the training example, then we might just have something here. I want to thank Dr. Hinton and everyone at U of Toronto for making Xerion available.

Running Xerion with gui, running backpropagation using conjugate gradient and line-search, with new network with twice the nodes. Error level (F:) down below previous 20 node network in less than 400 evaluations. Looks promising...
[Initial Results: - MarketNet was built using signed boolean jump coding. Note that for the graphic (Postscript output, shown using GhostView), I tweaked my plotValues.tcl displayer to shift the actual data +3 up, so it does not obscure the network output forecast. The network is called "MarketNet", and is not fully trained, as I need to reset the "tcl_precision" value to 17 (from its default of 6). With improved precision, the network trains further, and should become more accurate. What one needs to do, is save the weights, and then try the network on a dataset built for a different time period. This will provide indication of whether I am just training to noise or not.]

Network Evaluation Results - May 18 to July 21, 2017. The results show the network cannot accurately forecast the 4-day-forward boolean impulse value. Co-efficient of Accuracy is 24% - less than 1/3rd, so actually worse than random. This indicates that there is not sufficient information in the dataset (boolean impulse data for 5 days back, across 6 different price series: - SPX, DJIA, BCE, SpotGold( 3pm London fix in US$), Spot_Oil (WTI Cushing Hub US$/bbl) and CM) to make a useful forecast. I had expected results might at least be close to 40 - maybe even 45%, but such is not the case. One can make money trading securities - but forecasting future price levels - even if the data is boolean classified as just higher, same or lower, is not possible here. More data, across a longer time period may improve the network's ability to predict. But this evaluation currently shows the NN-AI has no ability to make accurate predictions of future market direction for the target security.

Field Notes on AI from Lorcalon Farm

Neural-Network Artificial Intelligence: Xerion & the Helper-AI's, APL on an iPAd to "run" the network

GEMESYS Ltd. is the name of my consulting practice.  We do research and analysis in science and technology, with a view to learning, teaching, and helping.  And we look for special economic situations that work.   GEMESYS Ltd was established in 1981, and continues to offer research and consulting services to address unique requirements.  We operate from Lorcalon Farm, in Canada.  (The image at right was made using the laplace partial differentiation simulation example from Google's TensorFlow tutorials. )

Why Do Datascience? & Why use AI?

Since the 1990's, I've done data-science related work under the radar, as it were.  I've even built amplifiers and radios to learn about feedback processes.  (Building and tuning an actual, physical device teaches one so much.  The math of it gets into your fingertips...)   I read George Soro's stuff on "reflexivity" in the markets (circa 1980's), and I think I am beginning to understand why "technical analysis" actually works.  We used to think it was because it captured the behavioural economic features of humans (cf. Amos Tversky, Daniel Kahneman, Richard Thaler et al), but now I think there is more there.  If you need to make money using the markets (ie. to pay your bills), you either go broke, or you end up using some form of technical analysis (or, you become a portfolio manager, take a percentage of the assets, and you don't care what happens, as long as you can keep your clients.)  But now, there is hard-core datascience, which lets many different ideas to be looked at all the time.  Having a good AI helper, with statistically significant results associated with its predictions, I suspect can give one an edge, even if much of the data one encounters is mostly wild randomness.   As a lone-wolf in private practice, you either have a verified edge, or you are quickly carried out, and fall into the abyss.  And it seems AI can give you an edge.  [Mar. 31, 2017.  Well, I guess it's confirmed:  US-based Blackrock, one of the biggest investment funds on the planet now, with $5.1 trillion in assets, has announced that it will sack a bunch of its human stock-pickers, and replace them with *robots* - the term Wall Street uses for AI-driven investment strategies.  Source: Wall Street journal article, Mar. 28, 2017.] 

Blush   As time goes by and markets change, I just keep getting more evidence of how any *model* is going to be successfully gamed by the market.  You don't want a model, you want an old, experienced guy to offer some gentle advice.  Since there is no such guy - a *very* well trained AI might be the next best thing, perhaps?]  

Status Log (Artificial Intelligence/Xerion/Data-Research work) - and most recent; building a CentOS-7.4 64-bit Linux platform (for TensorFlow):

[Feb. 21, 2018] - I think I get the CNN (convolutional neural network) idea now.  I found I could train the Xerion Jumpvector AI down to 91% accuracy, but could not get better than 45% accuracy on the post-training test dataset. Obviously, as I train tighter on the training data, I push the training first towards the signal, then away from it, as I train down to noise.  I ran 13 separate train-then-test exercises - creating 13 different network weight-matricies.  They all perform pretty much the same, despite randomizing the net weights each time.  So I trained part-way (to about 72% accuracy) on the main training data - then loaded in the test data, and trained part-way with it, then re-loaded the main training data, and trained a bit more.  I stopped the training early (used conjugate gradient direction selection, with a line-search step method.  This gives me semi-final results for the 13th network weight matrix of 68.41% accuracy on the primary training data (now running from Feb. 1995 to June 2017), and a level of 58.14% accuracy on the test data set.  If this result holds going forward, then I might have my edge.  The true signal is very weak and fraught with noise, but it looks like it might be there.  This is like tuning a radio circuit on a regenerative radio receiver (not a superhet).  If I understand how the Laplacian heat-transfer calculations work, then I think I might also kind of understand how the CNN idea works - and more importantly - why it works.  Each network node ripples its results out to others nearby - probably like neural state-pontential leakage would actually occur in our own brains ("little grey cells", as M. Poirot would say...)

[Feb. 20, 2018] - Revisited the whole Xerion-AI project again, and I found something I didn't try - which was kind of obvious, actually.  With my third version of network weights, for the 4500 record boolean jump-vector dataset (which only trains to 87 % accuracy), I can now get 41.17% prediction accuracy on my test boolean jumpvec dataset, for July 27 to Feb. 15, 2018.  That is a staggering improvement from the 24% accuracy I was consistantly showing.  If I can push the accuracy up above the 50% level, then any casino gambler will tell you that you might just have an edge, if one can manage the betting very carefully.  Oh, plus, I figured out how to use the "ssh -X userid<at>AI-BOX"  trick, to let me run full X-windows stuff remotely (Xerion is an X application, as it uses WISH, the Tcl/Tk shell).  Plus I use GNUplot to graph "Predicted Values" versus "Actual Values".   I may have been too quick to dismiss the jump-vector approach.  (The AI box running Xerion is in a different room.)  From my CentOS 6.6 box, (on the "bridge", as it were), I can use "ssh -X" to run everything remotely - the Xerion session window and the GNUplot graphs get displayed correctly.  I don't even need to run "startx" or even log into the AI box (which runs an older Fedora Linux).  Plan now, is to hold data constant, and just retrain with the idea I came up with, for a "version 4" of network weights, and see if I can push up the prediction accuracy over 50%, on the post-training test dataset.  If that is possible, then I might have something, as I have updated the TSM price database, and I can now build the boolean jump-vectors with just a button-click.   

[Feb. 19, 2018] - TensorFlow experiments.. I built the MNIST stuff, loaded sample MNIST image datasets, setup a simple network, trained it, and got accuracy of 90.18 %.  The TensorFlow stuff does seem to work, but it is perversely difficult to actually find out how to use it in a practical sense.  I have a boolean dataset set (from the Xerion AI work) which I would like to run in a TensorFlow NN, but there does not seem to be anything that illustrates how to actually read in actual, real datasets, setup example cases and run the training on a standard neural network.  Associates suggest I use PyTorch and avoid TensorFlow.   The MNIST tutorial stuff is cute, but classification of images using the CNN (convolutional NN's) is not the only thing one can do with this technology.  There does not seem to be any stable TensorFlow documentation, and this means it is maybe more of a kids playground than a real tool for doing practical development.  And if one files bug-reports, the TensorFlow authors do not seem to even look at them.   This is all just a bit annoying, and may force me back to using Xerion, where at least I can get something built using real data.  And where I can also have some confidence that the arithmetic is being done correctly.

[Feb. 18, 2018] - Updated the Xerion NN-AI for dataset from June 27, 2017 to Feb. 14, 2018.  Accuracy co-efficient is 23.4 percent - random results with a couple of degrees of freedom, I am assuming.  (Two purely random variable, each with a 50% chance, so we get a consistant percentage of correct predictions around 25 percent.  Not much use, I fear.)  See third screenshot from top.

[Feb. 05, 2018 ] - Ugly mkt action provides opportunity for new positioning.  Been focused on mkt action.  Curious how all the news services completely miss the trigger events, and interview analysts who prattle about US Fed. Reserve and interest rate delta's and 10 Yr US Treasuries at 2.85%.  Ho hum.  No new news there.  Fully discounted, of course.  It is the Bitcoin/NIM meltdown, and the $500 million theft from Coinbase in Japan which is driving this.  (Bitcoin Investment Trust thing in Cda did a 91 for 1 split recently.  Perfect indictor of a market floating on foam and fluff-puff.)  Bitcoin and other cryptocurrencies is a great idea for a transactional tool - but as an investment, it is just another mechanism to prevent compound growth from operating long-term.  Important to keep the world poor and hungry or no one will go to work, will they?   All investment *schemes* must vaporize wealth, or within 300 years every family would have billions of dollars, wouldn't they?   Studying CNN's (convolutional neural networks, from Stanford course:  CS231N

[Jan. 30, 2018]  - resolved the floating-point numeric-divergence issue (between Linux box and MacBook Pro) by recoding the program to use entirely 64-bit floating point variables instead of the 32-bit floats that is was originally using.  Confirmed Macbook Pro running Xcode 7.2.1 / Clang 700.x under MacOS Yosemite 10.10.5 has problem doing floating-point calculations on 32-bit float variables - at least in TensorFlow and Python with Numpy (Numeric Python library).   Once the program was recoded to use dtype=float64 instead of dtype=float32, the simulation ran as expected, up to 57500 iterations, showing evidence of image with complex, chaotic moire-patterns, as per the image at right.  Full details in the bug I filed on the github TensorFlow bug-tracking forum, here:

[Jan. 12-24, 2018] - This "numeric divergence" issue is serious.  I keep getting different numbers on the MacBook (MacOS 10.10.5) (other reports same divergence on MacOS 10.12.x) and the Linux boxes (CentOS-7.4, with current Linux kernel).  Going to first principles, downloaded & converted floating-point test suite: UCBTest, from W. Kahan & Sun Microsystems, circa mid-1990's. (UCB=Univ. Calif. Berkeley).  I now have gFortran and C version of Kahan's PIRATS program producing proven different results on MacBook and Linux 64-bit platforms.  Research continuing - converted entire test suite, and checking it on each machine.  The UCB tests using gFortran PIRATS program (which shows different results on each platform)  factors out TensorFlow, and the C language version of the same program, factors out gFortran as possible causes of the calculational divergence I am seeing.  Actually, TensorFlow could still have an issue with how its convolutional neural network training process works - some users have reported differences between how TensorFlow 1.4 and 1.2 works, with 1.2 running a test example correctly, and 1.4 not doing so.  But my focus is this *difference* between floating-point calculations on the MacBook versus the Linux platforms (CentOS 7.4 and Ubuntu 17, apparently) - all running fully 64-bit compliant O/S's.  The UCBTest suite compiles and runs all from Makefiles, & I've got it converted and running on both platforms, and it is showing different results on each each, in more places than on just the PIRATS program.  I published the PIRATS source for both gFortran and C to TensorFlow Github bug-tracking site.   Details on this issue are provided there.  URL is:

[Jan. 11, 2018] - still running tests.  A helpful fellow on TensorFlow github issues site has tried my program on Ubuntu 17 and a Mac running Sierra (MacOS 10.12.6), and the sim evolves to the moire-pattern image (generating tensor has large postive and negative floating point numbers).  It is only on the Macbook - both on binary installed versions of TensorFlow 1.4.1 with binary installed Python (running unicode=ucs2), and Bazel-built TensorFlow 1.4.1, with locally built-from-source Python (2.7.14 in both cases), show same behaviour - ie. sim evolves to large positive numbers only, a white-image.  No idea why, architecture almost the same (all Intel 64-bit multi-core), Python the same, TensorFlow the same, all Python packages the same, everything appears working ok.  But very different results with MacBook 10.10.5 Yosemite.   MacO/S bug?  TensorFlow bug?   Still unsure at this point.

[Jan. 09, 2018] - Trying to track down why I am getting *very* different behaviour of TensorFlow on Linux (CentOS-7.4) and Macbook (MacOSX Yosemite).  Built TensorFlow from source on MacOS and also installed binary.  Posted this to TensorFlow's issue tracker, and opened question on StackOverflow.  Mystery - but looks related to possible 32 bit overflow happening on Macbook side. (Similar bug was in a library called "bottleneck" that used to be part of pandas data tool package for Python.   A fellow with Ubuntu 17.10 which I think is a supported TensorFlow platform, provided his results, which match what I am seeing on my Linux box.  Something is amiss, looks to be a bug in TensorFlow's math.  Or maybe not.  Results should be the similar on each machine.  Issue and Question URLs below:


[Jan. 06, 2018] - Solved it!  After successful build of Tensorflow 1.4.1 on Macbook, I found it was impossible to "pip install ... " the created wheel file into Python 2.7.14 on the Mac.  Tried a bunch of ideas, and tried both my custom-built and original Python 2.7.14 (you can flip between Python custom-built and the one installed in "...Framework" space, by just putting Python locations (eg: /usr/local/bin/ ...) at beginning of path by editing the ".bash_profile" for your standard login ID on the MacOS, in /users/<your-user-id>.  Both Pythons failed to install the successfully built .whl file - each reports "... is not a supported wheel on this platform.".   Solution was crazy simple - just rename or copy the newly-built wheel file from: "tensorflow-1.4.1-cp27-cp27m-macosx_10_4_x86_64.whl"   to  "tensorflow-1.4.1-py2-none-any.whl", and pip installed it into my locally built version of Python 2.7.14 just fine, no problem, even removing the previous (binary installed) version of Tensorflow 1.4.0.  Confirmed with "" (lists all installed Python modules), and then ran several test programs to confirm that newly-built-from-source TensorFlow-1.4.1 operates exactly same as binary-installed TensorFlow-1.4.0.  Fine result.  See closed issue on github for what is basically now: "How to build Tensorflow on a MacBook From Source" details:

[Jan. 04, 2018] - Just completed successful build of TensorFlow 1.4.1 on the Macbook!  I am surprised - did not think I would be able to get it all fully built on my Mac, which runs Yosemite 10.10.5.   What I did:

  • Started with MacBook Intel-based Core-i5 (4 processor 64-bit machine), running Apple's MacOS Yosemite 10.10.5 (last before they put the SIP stuff in to block root)
  • Had about 4 different Xcode versions - tried to use current (Xcode 6.3x, which I had needed to put my DOSbox stuff on the iPad-1), but had to upgrade to Xcode-7.2.1, the last one that can be run on Yosemite. Had to explicitly create "/Applications/Xcode7.2.1" and copy the Xcode7.2.1.dmg file downloaded from Apple to that subdir, where it becomes "".   You click on that to further install some debug stuff and other things it needs.  You don't need a "Developer" account - used my Apple-ID I had to make when I got the iPad-1.  Note: Once you get it, start an Xterm window, become root, and enter: "xcode-select -s /Applications/Xcode7.2.1/"   This makes it your "current" Xcode. Check with "clang --version".
  • Downloaded - from the Oracle site - the JDK-8 (Java Development Kit) for MacOS and install it as per their instructions.  Bazel needs this..
  • Created dir "/home/Bazel" and download Bazel-0.9.0 (latest as of Jan 3, 2018), checked it with "shasum -a 256" and compared it with the site's sha256 version.  Then, unzipped it by clicking on it.  From within an Xterm shell, as root, you run: "./" and it should build it.  Did it last nite as an experiment, and didn't expect it to fully compile and install, but it did.  Whoo-hoo.
  • I had already built and installed to /usr/local/bin, a custom-built version of Python 2.7.14 (lastest from the 2.7 stream, as of Nov. 2017), and I had installed all the needed Tensorflow packeges.  I already had a binary version of TensorFlow running on the Macbook.  The Tensorflow build from source, needs Python to have six, numpy and wheel. 
  • I had tried and failed to build, with Xcode-6.x, so in the /home/TensorFlow/tensorflow-1.4.1 directory, I did a "bazel clean --expunge", to remove and reset things.  Xcode has to be 7.2.1 for this build to work, I think...
  • the bazel build command, entered at the Xterm window command shell, (as root), was:  "bazel build --config=opt -incompatible_load_argument_is_label=false //tensorflow/tools/pip_package:build_pip_package"
  • this is as far as I am now.  Next step is to try to build the ".whl" or wheel file, which is then used as argument to "pip install ..." so you can load your locally built copy of TensorFlow into your current Python.

This is a big result.  I did not expect to be able to actually do this, without more upgrades.

   Results of the TensorFlow 1.4.1 Build on the MacBook (Yosemite, MacOS 10.10.5): 

       Elapsed Time: 3985.215 s

      Critical Path: 132.83 s

      Build completed successfully, 4044 total actions

Here is link to the Bazel site notes which tell how I built Bazel from source:

First attempts to build TensorFlow were very problematic.  But I found this note below by Google-searching all the earlier build errors I was getting from using Xcode-6.3.x.  A useful note is this one below, because it tells how to use your GPU to speed things up (this is the CUDA stuff, I think?).  This note describes how to built it on a Macbook, and use the CUDA and GPU options...  It was helpful in showing what I had to do to get the Xcode7.2.1 to properly install on the Macbook.  (FIrst attempts simply did nothing.  You have to create by hand, the Xcode7.2.1 subdir in /Applications, and put the .dmg thingy there with the Apple visual copy. Otherwise the O/S won't prompt for authentication, it looks like.  It just does the copy and then you see *nothing* at all..!).  The note below has details: 

Also, here is link to the Apple stuff, where you can download Xcode-7.2.1.  You login using your AppleID (don't need Developer Account, which costs money), and if you get the sparse screen with nothing on it, go to the bottom, and click on "More stuff..." or whatever it is called.  You then get a proper organized table of real software.  Find and download the Apple Xcode-7.2.1.dmg file, to your "Downloads" directory on you Macbook:

Hope this helps.

[Jan. 03, 2018] - Like that old Steve Miller song - "Time keeps on slippin' - slippin' into the future...".  All night (almost) trying to hack TensorFlow1.4+Python2.7 onto the Apple Macbook so it's results (from the image stuff) match the CentOS7.4 Linux-box results.  (The Linux-box stuff is now really working fine. The grief, as usual, is coming from the Apple-side of things...)  The bizzaro initial quasi-fractal image at top of this site, is generated with a modified version of the Laplace PDE example the TensorFlow guys provided in their tutorial.  Turns out to be a good test-thing, since it highlites this problem I am having.  TensorFlow binary installed on the Linux box uses 4-byte unicode character representation internally, but the MacBook version uses 2-byte unicode character representation.

For an image-generation exercise, it means I can build these really interesting, complex images - but *only* in the Linux version, where Python is compiled with "--enable-unicode=ucs4".  This is a big deal.  Why?  Because I am getting *vastly* different results between the Python+TensorFlow I have on Linux, and the Python+TensorFlow I have on the Macbook. 

I first just installed MacOSX Python 2.7.14 from the latest .PKG file from Python - fine stuff, no problem - except it is hard-coded as "--enable-unicode=ucs2" I think.  So, I took my Python tarball for 2.7.14, and - since I already had all the build stuff (gcc and xcode) on the Macbook - built a local version of Python with unicode=ucs4 enabled.  This all worked - except now, the TensorFlow binary for the MacOSX would *not* import successfully into Python 2.7.14.  It could be installed ok, but fully kacked on failures to find yatta-yatta-usc2 stuff in the dynalibs.  Ugh.  And of course, when I backed out the change, and re-built Python 2.7.14 with the "--enable-unicode=ucs2", nothing at all would work, since all the "pip install <yattayatta>' Python packages (numpy, matplotlib, Pillow - and so on) blew up because they were all looking for <varname>usc4 type stuff.  (Thank the Gods of Programming that the developers are using explanatory var-names.  It made it crystal clear wtf was kacking, at least).   I had to "pip uninstall ..." most of the packages, and then re-install them.  Once that was done, TensorFlow could be successfully imported and run on the Macbook.  I spend *hours* on this - and basically aligned *exactly* all the version-numbers of *all* the packages on the Linux-box Python and the MacBook Python.

But here is the rub:  Because the TensorFlow binary is built for unicode=ucs4 in Linux-Land, and unicode=ucs2 in the World-of-MacOSX, running a TF program on one platform can produce ***wildly*** different results between platforms - even if you are running ***exactly*** the same code, and both machines are 64-bit!  For me at least, and the goofy stuff I want to do (I want to *create* images first, and only later, will I try to classify them) , this is a really big deal.  Duh - ya can't have two completely different results being generated on two software-and-hardware identical platforms!  (Actually, you can,  if one platform is using 4-byte character encoding, and the other platform is using 2-byte encoding, FFS!    At least I think this is the issue.  I can't even test this idea, until I can obtain or build a "unicode=usc4" version of TensorFlow for the Macbook.

So, it means I will have to build from source, the TensorFlow thing.  <sigh...>.  I am not really a very clever guy, and thought I could just hand-wave my way thru this (ha ha - like those proofs in advanced math classes - I would be confused, - and even the Prof. would get to the "hand-waving" point, where he could not explain how he got from here to there... Ya just wave your hands around and try to intimidate the dumb-arsed students, no?  We called this the "Hand Waving Proof" approach...).   But it looks like I am going to have to try to build TensorFlow from source - just to get my Linux version and MacBook version actually producing the same results! 

The example is the image at the very top.  It is built on the Linux box.  If I try to build that image on the Macbook - using *exactly* the same code, same packages, same versions of *everything*, I just generate a blank screen!  The generated image on the Linux box (Python, packages, & TensorFlow: unicode=ucs4) is a complex moire-pattern thing, with beautiful fractal nature, and the .jpg file is about 200K.  On the Macbook, (same Python, packages & TensorFlow: unicode=ucs2), I get a competely blank white image of nothing, and a generated .jpg file around 6K...(!?!).  There must be an implied 4 byte to 2 byte conversion going on that is just trashing the fine precision of the numerically-crafted image.   Mad

Like I said, this is a pretty damn big deal, and it is a complete "show stopper" for me, with the only solution to build consistent versions of TensorFlow that match each other.  I just won't have any confidence in the results, unless I can get basic number-crunching to work the same on both platforms.  I am guessing I have to run everything as unicode=ucs4.  I searched for a MacOSX version of TF that is built with the "unicode=ucs4" option, but could not find such a thing.  If I can actually make such a thing, I will put it up on my github page (which only has the Sharp APL interpreter, at the moment, as I physically have the license that allowed (& encouraged) re-distribution of that code.).  As long as you build and install your own Python (with the --enabled-unicode=ucs4 parameter to the ./configure thing), then I notice that all the "pip install..." Python packages seem to be smart enough to toggle themselves to ucs4 from the default ucs2  (as they blow up, if you try to use them after rebuilding Python back to ucs2 from ucs4...).   

So, I am reading about Bazel... the build environment one needs to assemble TensorFlow from source...  (and oh sh*t, I have to involve the JDK 8 giant dog pile?  <ugh> )... I  really don't like the modern trend toward hyper-bloatware.  Python is brilliant (sort of..), and TensorFlow is a cool idea - but looking at what I have to do to get TensorFlow to compile, I am getting that same ill feeling that I had after I ran my car into the ditch up at Healey Lake when I was a  teenager...  Cool

Note: Some info on an Android Camera Demo, that uses TensorFlow or a light-version variant that can run on Android - maybe.  Initial examination tells me I have, sadly *zero* chance of getting any of this working for now.  The use of "gradle" and "bazel" and the bloated complexity they introduce means you need hard-core, domain-specific full-time teams of folks just to do anything now, sadly.  I suspect there is money to be made in creating development tools for real-world AI apps that aren't bloated nightmares of terabytes of cross-dependent, ever-changing, fragile, kidcode.   The new sdk's and dev environments are really awful - so much bloat, for so little gain.  There has to be a better way...  But here is the link.  The demo image is very impressive...

The Android stuff is interesting, but beyond what I can do right now.  I am anxious to try to have some basic image recognition that actually works - but my recognition will be done against synthetic images - sort of like the first one that is shown at page top.  The TensorFlow team have some example code.  Check this page, and scroll down to see the picture there...


[Dec. 31, 2017] - Note: See the "Code" menu-option to see the TensorFlow 1.4 + CentOS-7.4 Linux version of the little Laplace simulation program that creates the "exploding stars" image at right.  The image at right here was created on Macbook, using Tensorflow 0.10.  The minor mods to make it work on TensorFlow 1.4 and Linux are provided in the first example in the "Code" section.

Also: Updated the scribbled-notes to reflect the Python 2.7 build configuration needed ("--enable-unicode=ucs4") and the TensorFlow 1.4.0 install url for use with pip.  Just to confirm, ran the small linear-regression example, and confirmed the Macbook TensorFlow 0.10 version and TensorFlow 1.4.0 version on the CentOS74 box gave same answer. (My regression test is a test regression... and Able was I ere I saw Elba...).   

I am finally back to worrying about data, instead of process. If I can get the Kepler example, than that, with the MINST stuff, should at least let me build an image-classification engine.  Then, I can write some code to construct "market images" (I can bit-fiddle a .jpg or .bmp file now, with Python.  The complex compression sh*te used in .jpg images probably will force me to use bitmaps - but I can convert between bitmaps and jpegs now, again with Python stuff.  And I have Krita and GIMP and other stuff to directly fiddle the images, if I need to make some test-cases or limit-condition type of pictures.   If I do all this AI-Ver.4 stuff, and feed the AI all the market info, and end up with a picture of a cat's face, I will be less than happy.

More thoughts on where my edge is coming from:   I think it might be history.  I've had a good year.  Why?  I've been a history geek (basically, a closet historical-scientist, really.).  I once visited the History Department of a modern University, and inquired about enrolling or applying - and all I will say, it was *not* Waterloo.  (University of Waterloo is the best University in Canada - but I'm not sure if they even do formal "History" now.) 

The experience of just chatting with a few 'History Department" types at this big school, really (I mean *really* !) put me off the idea of wasting any time in the academic cloister as far as formal History study was concerned.  The University History departments are laughingstocks.  They are full of these people who are homosexuals, lefties, and outright Marxists.   (I want to be like Seinfeld, and add "Not that there is anything wrong with that!" - except it is not quite true in this case.   These people with their gay-lefty-Marxist agendas are doing real and lasting damage to the formal study of History.  It is really sad.).  History didn't end, but the study of it maybe has.

And if we don't pay attention to History, then we are all like Bill Murry in "GroundHog Day" - we will all just keep repeating the same mistakes over and over, until Darwinian Evolution deals with the problem of species failure.

The only way to study History is just to read everything that real folks wrote - from Herodotus and Pliny the Elder, to guys like Sydney Homer and his "History of Interest Rates", probably the best book of hard-core historical research I have ever read.    Great discoverers like Liebnitz and Micheal Faraday both read entire libraries of books. (Liebnitz was secretly given a key to the locked King's library, and Faraday had to leave school, and apprentice in a book shop - where he read every book, apparently).   If you want to be a successful investor, you have to pretty much do this too.  And don't just read business books.  Read everything.

Oh, and I have an example:  George Soros fancies himself a Historian and Philosopher, and guess what?  He *really* is.  He seriously is a serious, (and even sometimes wrong, but not very often), scientifically focused analyst of history.  His work on what he calls "Reflexivity" is very good.  Don't just read it because it can make you rich (it can), read it because it is clever, insightful, and wise.  It is a well thought-out and tested idea - which is *vastly* more than most formal "historical" work is.  And here is the thing about Soros.  He will likely die very rich, and that is the metric of success, no?  Most famous, widely-successful investors who make really big money, eventually blow themselves up and are carried out, after losing all their money.  Jesse Livermore, Neiderhoffer, the entire staff of the company with brightest folks in the world at the time (PhDs and Nobel-prize winners), ie. John Merriweather and his Long Term Capital Management guys, (they kept adding to a very big bond position that was going the wrong way... like idiots, until they were out of money),  almost everyone who got rich in the stock market of the 1920's, the tochi-korogashi (Japanese for "snowball investing" - rolling levered deals over and over until you have bigmoney) folks in the 1980's who got rich - and then destroyed - on Japanese property, the Hunt Brothers who tried to "corner" the silver market (and were undone by a simple rule-change on the Chicago Merc.), Nick Leeson (the famous "rogue trader" who took down Barings Bank), etc., etc., etc.  If I sit here and think about it, I can probably name 40 or 50 detailed accounts I have read of super-successful guys who all blew up.   Soros is the one super-successful investor who did not blow up.  It is because he figured something out, and then implemented it right.  He was and is, a scientific historian.

See, no-one except religious lunatics, who believe in idiotic superstitious absurdities like "gods" and "demons" and "angels", and gay people, who want to promote their political/sexual views, care anything about gay stuff or other homosexual people's sexuality.   If Turing was gay, that says nothing about his genius.  It is just sad that social managers and other moralistic governmentalists made his life painful.  History is about the progress he made - not the boys he fucked.  No one really cares about that, as it does not matter.  Yes it matters to some, but it should not.  There is this apocryphal story one of my Economics professors told us, of economist Joan Robinson at Cambridge, in the late 1930s, or early 1940's, running down the hall and into an associate's office, saying "Oh damn. The Americans have just found out that Keynes is a bugger, and we're afraid they're going to repeal the Full Employment Act."   (They didn't... And Keynes got married, so maybe he wasn't even as gay as he is rumored to have been.   His gayness is not the key fact.  The key fact is that his original PhD work, and his degree, were in Statistics, not Economics.  I am pretty sure that this is a key part of why he was a successful investor.  He had a deep understanding of statistical probability, and also understood the gambler's instinct, which he explicitly commented upon in the General Theory and in other documents.  Go find it, if curious.)

And no-one except annoying politicized females who spout feminist rhetoric care anything about the modern women-in-history material.  It is all just political noise now - and the whole point of *study* of anything, is to figure out how to cut thru the noise, and find the tiny kernel of truth - if there is really one there.  Lots of times, there simply isn't anything there.  You peel away all the layers of crap, fraud, blather, hype, deception and nonsense - and you are left with *nothingness* - like going into the cafe to meet Mimi (whom you want to bed, and have arranged to meet there...), and when you get there, the cafe is just full of non-Mimi's, and all you experience is *nothingness". 

Sartre solved the problem of defining "nothingness" just like Renoir solved the problem of painting - they both led with their ...  well, look up what Renoir said.  He was asked once, "How do you paint such amazing pictures?"  and his reply was: "I paint with my prick."  Of course, he was being metaphorical.  But look at his paintings... his "Woman at Bath" type pictures are like looking thru a keyhole at your teen-age fantasy - like Leonard Cohen's and Bob Dylan's songs were all about.   Let's be honest.  History is all about frustrated, clever men, trying to get to something they cannot reach in just one lifetime.  Women are already there.  They don't need to do anything - they need only sit there and wait, and everything will come to them. (Just kidding.  Of course, it is tough for girls.  This is my way of telling them they need to do more than just "lean in", FFS.  They need to get off their backsides, and work hard.  They don't really need to (like all men must), but they still probably should anyway, as they will become better people for doing it).

It is men - like the frogs and worms that always migrate after a warm summer rain - that have to set out on long journey's of discovery.  They have little choice, really.  History and civilization - both are made by men, and always will be.  Women have the luxury to be concerned with bigger and more important things.  They make people.  Men can invent things, and build nations, win wars, and create empires, and create great works of art and literature.  But their accomplishments are nothing, compared to the female-ability to fabricate new people.  This is what history teaches us.  I am quite serious.

And let me be clear.  I dislike "feminism" because it is all about women being strong, right?  Well, that is great.  I like strong women - get your dragon tattoos and kick all the Swedish hornets nests you want to.  But what about others?  Is the strong-woman of feminism supposed to make men weak?  Of course not - men are also supposed to be strong also.  Great.  And quite correct.  But take a hard look at the political movement you are thus creating (and which we have been enduring since the bra-burning marches of the 1970's).  What have you got?  Looks a lot to me like it's just a new fascism - since if everyone has to be strong, then the weak are typically just thrown under the bus - or worse, subjected to the paternalistic policies of toxic, dishonest governmentalists.  Policies whch are often worse than the bus tires.  (I am very Chicago-School on this.  Paternalism is bad.).  History suggests that "feminism" is not a nice thing.  The idea that women are at the "bottom", or subject to "glass ceilings" is absolute utter nonsense.  And political models which suggest that strong, successful females need to be stronger and more successful because men are somehow holding them back (which is absolutely not true), simply risk creating an ugly, vicious and deeply dishonest toxic cult of the "strong".  We have seen this movie before, and it ends badly.  Women are already in control of the production of human beings - and this is the most important political and economic role any group could possibly have.  They already have more effective real power than men, and a much larger range of opportunity as well.  A philosophy which suggests they are "downtrodden" is simply rubbish, and needs to be recognized as such.  Everyone should be strong - and strength should be used wisely, and with good judgement.  Men and women equally, must learn and then act upon this simple truth.  And it annoys me when political movements are crafted to vector people away from this important reality.  There, I can hang up the tinfoil hat, now.   :)

History also teaches us that, for men at least, seeking and dating women, is much like investment success.  (For women, it is *very* different.  To "date" successfully, they need only go to a bar or club, stand at the bar and look pretty, and it will all come to them.  Let's be honest here, ok?).  But for men (the seekers of the Holy Grail, so to speak), different action is needed, no?  You have to go out and actively seek and search.  And the role of randomness is much, much greater than any man would like to admit. 

You probably won the trade, or got the girl (these two actions have very much in common) because of chance. 

Sure, you worked hard and were prepared.  That is a precondition.  But your success in a particular venture is often due to luck.  You won because you were lucky. Not clever, not smart, not the wonderful fellow you think you are - you just got lucky.  Smart guys even call it that.  How was your <date / trade / life>?  Did you get lucky?

Luck really matters.  And here is the secret history teaches us:  Ready?  I'm going to tell you how to get rich, and get the girl you want, and have a really fun life, ok?  Seriously.  No really, I am serious.  I am going to tell you:  Design and carefully implement strategies that enhance and augment your chance of getting lucky.  Keep your costs of each "trial" low, and try to run lots and lots of trials.  Move forward on the ones that seem to be working well, and drop quickly the ones that are not.  Do not become attached to any particular trade, or person.  At least not so attached that you cannot quickly and painlessly disengage.  Don't be the Ant, be the Grasshopper.  The Ant worked hard day after day, and built a huge nest.  The Grasshopper listened to music and practiced flying and dancing all day.  When the weather grew colder, the Grasshopper flew south.  The Ant dug deep into her nest, and her entire colony  was wiped out when the bulldozers came to build the new subdivision for the humans.  That is the true story history teaches us - not the false story about "hard work" we learned as children.

Working hard, and expending effort offers absolutely no assurance of a successful outcome.  It might be necessary, but the key to life and success is to work SMART.  Your outcome will depend on the decisions made, and path you took, much more than on how much effort you expended after the choices were made.  This is what Artificial or Machine Intelligence can give us, if it is done right.  It will augment and enhance our chance of being lucky.   It will help us find where the gold is buried, and where the even more important gemstones of truth are located.  SImple, but effective.  The Kepler Telescope research that used TensorFlow to assist astronomers in the discovery of exoplanets is a fine example of exactly what I am describing.  So is the use of AI classification to improve cancer detection and diagnosis.  No one was put out of work, and no one will be.  The work simply took the results already found and developed by the analytic specialists, and allowed their skill and expertise to be augmented and amplified.   AI should help us achieve beneficial outcomes using this approach of ability augmentation and amplification.  History shows us that this is what humans have *always* done.   In weaponry, it is clear - the club and spear amplify the fist and nails, the gun amplifies the spear and arrow, and the tank amplifies the mounted horseman.   Writing amplifies memory, and libraries augment information management.  Computers and the internet augment and amplify the library and the card catalog.  And AI will amplify our ability to classify and analyize.  And if it is done right, it will not cost much to operate, and it should help us all get a bit more lucky.  Sounds like a good plan, eh?  Cool

[Dec. 30, 2017] - daylight hours - 12:44pm EST:  Pulled a student-style all-nighter - not planned, but you just get pulled forward by results..  If you look at my scribble-notes, you can see the version of TensorFlow that I installed was Ver. 0.10 from last year.  Current version of TensorFlow is Version 1.4.  I got that installed and working on the hybrid CentOS-7.4 box last nite (whoo hoo..).  I ran into bugs in my Python 2.7 version and here is where being a stubborn bugger pays off - I had compiled and linked my own version of Python (CentOS 7.4 provides 2.7.5, but I download the tarball, and built my own to have most recent 2.7.14.  The backports of Python stuff are pretty damn well built. Big (I mean BIG kudos to the folks who have made Python what it is.  The Python stuff really *works*, and so, apparently, does Tensorflow 1.4 now.  Kudos to Google and their team also.  Bloody good work guys, I am gobsmacked-impressed.  This stuff really exceeds expectations.)

Anyway, what I had to do was rebuild Python 2.7.14 with "usc-4" instead of "ucs-2" (which is the default), because TensorFlow "pip install..." binary is built (from bazel, I guess?), using the usc-4 varient of the unicode stuff).  You rebuild Python and give the ./configure step the option: "--enable-unicode=ucs4", and that will fix it all.  Except you *also* have to uninstall and then re-install all the bloody Python libraries... which is a lot of work. But if you are a stubborn guy (and just do it), you can then "pip install <the big long ... .whl>  site-URL of TensorFlow 1.4, and it will install.  I had numerous places where I got bugs while testing - but they were *all* because of that usc-2 instead of usc-4.  I just had to keep uninstalling and re-installing the Python packages until all the bugs were found and purged. 

The original "Laplace" pond-ripple simulation (which I converted into star-formation simulation) provides a good quick test for TensorFlow, as does the simple linear regression model.  TensorFlow has been "new and improved" to make it necessary to explicitly choose active run-session (just using default.session does not work anymore), and so I had to convert the Laplace example to run under TensorFlow 1.4.  I don't know TensorFlow yet, but if Dr. Hinton had a hand in it, it is probably the way to go.  I was *very* impressed by the Kepler Telescope results to find new exoplanets, as it is a perfect example of how machine-learning will augment experts. 

Mark Langdon's predictionTHERE WILL BE INSIGNIFICANT UNEMPLOYMENT CREATED BY MACHINE LEARNING & AI-BASED AUGMENTATION.  MORE JOBS WILL BE CREATED, THAN WILL BE LOST.  I AM ABSOLUTELY CERTAIN OF THIS.   Sure, we have a lot fewer "chimney sweeps" now in London, than in we did in early Victorian times.  But we have a *lot* more electricians. And more of almost every other job, too.  Progress creates opportunity, and very rarely destroys it.  History shows us this.  Learn this truth, people.

So, I converted the Laplace examples, and also ran the Linear Regression example - under both IPython-Jupyter, and under just plain, command-line based Python, and got it to work, same as I had it running on the Apple MacBook, back in March of this year.  Build your version of Python with "--enable-unicode=ucs4", and uninstall and re-install almost all the Python libraries, and you can load TensorFlow 1.4 into CentOS-7.4+Python-2.7.14, with this command:

   pip install

Then, use this little test program (which Google provides on it's TensorFlow "Install" section of it's site:

     # --- test TensorFlow Install, with a "Hello World" example
     import tensorflow as tf
     hello = tf.constant('Hello, TensorFlow!')
     sess = tf.Session()
     # --- done.

You may get warning note about not using all the features avaiable on your CPU, and you should see the "Hello, TensorFlow!" message.  You don't need to start the whole Jupyter web-server thing, just enter, from Linux terminal command line: 


Hope this is useful. (Apologies if the font is f*cked up here on this note.  The editor for my website is not good, and I don't have time to debug why the font is messed up (it is way wrong in my Firefox versions - both on Windows and Linux... :D )

[Dec. 30, 2017] - Just made my deadline, as I wanted to get Fedora/CentOS Linux 64-bit + TensorFlow working on a new platform before 2017 was done.  Top screen-shot shows the final "pip install ..." of TensorFlow for the newly-built CentOS-7.4 platform, which is tweaked to run the latest 4.14.9 Linux kernel  (but I suspect the stock 3.10 Linux kernel that CentOS 7.4 comes with would also work.  That 3.10 kernel does not support the sound-card, only reason I hacked it to use most recent one...).  Standard "pip install tensorflow" fails, with just a "Go away!" error message, but after a lot of reading, I found reference to the correct pip "wheel" file one can use to make it work right.  I will create better notes shortly, but second image is just a copy of my scribbled install notes, which show steps one can take to get the thing running.

[Dec. 29, 2017]  - Just confirmed that the 4.14.9 Linux kernel I am running (downloaded from ELrepo site via a yum update command), is the latest stable Linux kernel.  I had not planned to be this bleeding-edge, but it does seem to work.  Successfully compiling and linking MPLayer (with libdvdcss and libdvdread), and confirming it worked to play a DVD, with sound and in a controlled manner (ie. volume works, subtitles can be toggled off and on with "v" cmd, space-bar pauses playback, etc.), is a comforting result.  If you can play DVD's successfully, then system operation is probably stable.  Just learned about the Linux kernel archive, at:    and another useful site is:   Learning curve, here.   I've tweaked "grub2" to default boot the newer kernel.  Grub, and grub2, are programs that let you select what operating system to boot. Their setup is more complex on 64-bit CentOS 7.4 Linux.  The Pulseaudio hack is pretty extreme also.  Unless I disable it by renaming the executable in /usr/bin, it gets spawned automatically, even if you use root and the process-kill command to kill it. And run from /usr/bin, it will not find the on-board sound card, in either kernel.  But at least in the 4.14.9 kernel, it will work if local started using the "--start" parameter. 

I want to run thru and put all the Python+Jupyter/IPython stuff from L2-AI onto L2-CentTOS74, and try to get TensorFlow to install. Also need to find the Kepler stuff, if it is available yet.   Saw details of a Qcon.AI conference in Cali - San Francisco, actually, which looked interesting.  Might be worth the expensive price, just for the TensorFlow tutorial.  Also want to try PyTorch, and I need to update the price-database.

How to Get the 4.14 Linux kernel - using the ELrepo repository:  These are the  4 steps I used to access the "ELrepo" repository, and get the latest stable kernel.  (Did these as root. Should probably use "sudo" instead...)

1)     rpm --import

2)     rpm -Uvh

3)     yum --enablerepo=elrepo-kernel install kernel-ml

4)     yum --enablerepo=elrepo-kernel install kernel-ml-devel

And to update grub so it would default boot the new kernel, I selected the first (newly installed) O/S in the list (note the list of O/S's that "grub" shows is zero-origin, meaning the first one is numbered "0", not "1", like you might expect...)


       grub2-set-default 0   (or whatever number you want. 0 is first one in list...)

then, rebuild the original grub.cfg file in the boot directory...

      grub2-mkconfig -o /boot/grub2/grub.cfg

This changed the default to the new, 4.14.9 Linux kernel.  The original CentOS 7.4 kernel is still there, and you can selected it with a down-arrow key at boot time.  But it cannot recognize the Intel on-board sound processor.


[Dec. 28, 2017] - CentOS-7.4 build:  Ok, big result.  This thing did not work well at all out of the box, but  I have got most of it running ok.   Things that had to be done:

   1) Make the startup boot show activity, not just a blank graphic screen with a throbber.  Do this from root, with "pymouth-set-default -theme details" and then run "dracut -f" and then reboot.  At this point, I am getting a full hang if I try to reboot. I have to run "shutdown -h now" and halt the machine and then restart from cold.

 2) Get the ethernet card working.  For some reason, despite "chkconfig" showing the network on at runlevel 3, the network was not coming on.  I had to edit /etc/rc.d/rc.local" and put "ifup eno1"  into the rc.local file. The /etc/rc.d/rc.local file also needs to be made to allow execute permission with "chmod +x /etc/rc.d/rc.local".    Once that was done, the network is available by default. (Note: I also set static ip#, using ipv4.  Not sure where systemd puts the config scripts. Did it using "Settings" option in GNOME gui)  Note: This should be a unit in a systemd probably - but for now, the rc.local file still works.

3) As mentioned, I had to disable /usr/bin/pulseaudio  (renamed it to "pulseaudio_off", and start pulseaudio locally, prior to GNOME3 start.  Created two files, "sound" and "vision".  Sound contains "./pulseaudio --start" and is run as a non-root regular user, from local copy of pulseaudio.   It also plays a couple of .wav files using "aplay <wavefilename>" , just to provide confirmation that the sound works.  The vision file just contains "startx"  (not the original "startx &").  This is a kludge - but it got sound working.

4) Got Mplayer 1.2.1 working with DVD's, which was a trick.  Had to completely rebuild Mplayer, because it was not using "libdvdread" library file.  The key is to first build the three libraries (libdvdread, libdvdnav and libdvdcss), and for first two, put their *.pc files into directory /usr/share/pkgconfig.  Then, build MPlayer with "./configure --enable-gui". "make" and "make install".  To get Mplayer to load (which uses, the lib that lets DVD's be read), I had to add "/usr/local/lib" as a line of text in the file "/etc/".  This lets the linkage step of Mplayer find the library, so that it can read DVDs. The MPlayer command to play a DVD is:

   "mplayer -fs -alang en dvd://1 -dvd-device /run/media/<youruserid>/<yourdvdfilmname>/VIDEO_TS"

(The DVD will be automounted to the /run/media/<youruserid> directory.)

5) Confirmed all this works now.  I am editing this note here for the Gemesys Ltd website, using version: "Firefox 52.2.0 (64-bit)" on the CentOS-7.4 64-bit box.   It all seems to work.  It's 3:20 am, Thursday, December 28, 2017.   The CentOS-7.4 box (with the 4.14.9 kernel) is snappy quick, and now has sound and vision. 

[Dec. 27, 2017] - CentOS-7.4 build:   major milestone:  Kernel 3.10 is reported to not work with the default Intel on-board sound card I have.  Fiddled about with "alsamixer" to select the sound card it recognized.  Had to disable - and then re-enable "pulseaudio" (I hate that thing) by rename the executable in /usr/bin, so the "systemd" stuff would recognize the sound card.  Sound is critical, since without sound, videos and video data-links are kinda useless, since I don't speak sign-language (except to one of my dogs, who is deaf).

Went to the "ELRepo" site ("Enterprise Linux"), and tried to download the next kernel up from mine, which is reported to be 3.17, but it offered 4.14  (!!), and I decided to go for it, since this *is* a research platform.   After getting the gpg-keys the yum install-ing the new kernel and the devel-kit, (for it's headers), it turns out the new kernel does not overwrite the old one, and "grub" reports two boot-able Linux kernel's now.    Extensive studying so that I could change the default grub-boot from the old 3.10 to the new 4.14.

This was a *lot* of work, and I will have to document it in a seperate page.... (notes are a mess)... but the new kernel *WORKS* with the sound card, and this is a big result. [UPDATE:  AHAH!  GOT IT!  You just need to add your local <userid> to /etc/group file, after the pulse-access group definition!]  Note: [later update, evening..] not enough.  You also need to localize the startup of Pulseaudio, and remove it from /usr/bin.  Kludgy, but I finally got it to work in Gnome.]

As a preliminary test, I migrated the source for the new MPlayer that works with DVD's, from the L2-AI box over to the new machine, L2-CentOS74, (but now running the new 4.14 kernel), and rebuilt libdvdcss, libdvdnav and libdvdread, and then *all* of MPlayer 1.2.1.  Note: I used "--enable-gui' option on Mplayer, and had to create /usr/local/share/skins/default (with a default skin directory, taken from "Blue"), in order for Mplayer to start.  Also, is put the *.pc files (../pkgconfig) that I copied to /usr/lib/pkgconfig on L2-AI into /usr/share/pkgconfig, probably the place where local-built  *.pc files  (for libdvdnav and libdvdread) should be to be put.  This lets the MPlayer build to know that it should build with DVD-read ability.  Didn't test DVD's last nite, but I confirmed the Mplayer plays *** WITH SOUND ***, and runs full screen.  The build was blisteringly fast, compared to L2-AI (an old 32-bit P4).   This is all a big result, as it looks like I will be able to have a working 64-bit Linux platform.  Documentation to follow.  The site where the fix for the "NO SOUND ON CENTOS with INTEL on-board sound card" was found is:

about halfway down, where "marshallruan" explains his kernel-update process, which is dated: 2014-11-24.   Details on the "ELRepo" site are here:

You need to make: "/usr/local/share/mplayer/skins/default" directory and put the contents of the "Blue" skin into this directory, for Mplayer 1.2.1 to run correctly as a gui - ie. as a clickable desktop icon.  It won't work otherwise, and will just bring up a box saying "Skin not found".  I confirmed you can get the "Blue" default skin (by "Xenomorph" ), from the Debian site.  Get that "...tar.bz2" version, put the file into your MPlayer build directory, and untar it with "tar -xvf mplayer-blue...." to build the "Blue" directory.  Put the contents of that directory into "/usr/local/share/mplayer/skins/default" so that Mplayer can be run from an icon.  This "skins" nonsense might be the most retarded thing I have ever seen in the entire history of software development.  FFS, guys.  Really.  I believe the latest "Mplayer" does not use this silly idea. But if you are using Mplayer-1.2.1, you need to do this, to make it work as a desktop, gui-application.   You can get the default "Blue" skin at:

and again, Mplayer will throw an error box saying "No Skin found" without these little .png files.  Oh, you will also need to put a .ttf font file someone that the Mplayer can find it. 

Update: [Dec. 27, pm] - got it!  Got the sound working..  Here is the bugnote (all the way back from Fedora-8, and the wrong stuff (but very helpful) from Pulseaudio site:  and    For now, it looks like all I needed to do, was PUT YOUR LOCAL NON-ROOT USERID (your main working userid) as a MEMBER OF THE pulse-access GROUP.  DO THIS BY USING vi TO EDIT /etc/group , FIND THE string "pulse-access", and if your user-id is boofus, then just append the string: "boofus" to the end of the line, making "boofus" a member of group "pulse-access", and sound should work, without the authentication error.  This problem appears when root can see the sound card, but your regular userid session cannot see the sound card (using " aplay -l" ).

[Update: Evening: .] I could get the damn sound working, but when I shutdown and restarted, it would always be dead again.  Finally, by hacking the startup of the thing, and making both root and my <localuserid> members of groups "pulse-access" and "pulse-rt", I am able to start a sound-server and then the GNOME desktop, and get sound.  It is a kludge, but what I did was to disable the systemd-started version of Pulseaudio (in /usr/bin) by renaming it to "pulseaudio_off", and then putting a copy of pulseaudio program  in my local directory of my non-root userid. So, in my own directory, I have the pulseaudio executable.  There, I start it *outside* of GNOME, with "./pulseaudio --start", which complains about not having a binary canonical version, but it force-starts it.  You check it with "aplay -l" and see that you have a sound card visible.  Use "aplay <somefilename>.wav" and confirm you have sound.  (you should here it, on whatever you have plugged into the HP headphone jack).  Then, start GNOME with "startx".  I always used "startx &", making a detached GNOME process, so I could Ctrl-ALT-F8 out and see what GNOME/X-Windows was doing and reporting .  But here, you can't do that, else GNOME cannot "see" pulseaudio or the sound card, and the reports no sound card (or a "dummy" non-operational sound card.)  Either way, no sound.  But if you start with just "startx", it looks like you inherit the permissions from the locally force-started version of the thing (ie. you have started a local copy with the "--start" parm).  Before running GNOME, check with "ps ax | grep pulse" to confirm pulseaudio is running, and make sure you have added your local userid to the "pulse-access" group in the /etc/group file.  Now, I can start GNOME with "startx", and have the Intel onboard sound-card work (the box is an HP-7600 small-form factor box, 4 Gb memory, 250 gb disk.   Even though it is only Intel-Core-i3 (4 CPU's), running at 3.04 ghz, it still is very fast.  And with sound, it can render videos correctly (using MPlayer).  Check sound using the "Setup" tools, and run the "Test" option to hear "Left Speaker", "Right Speaker".

Note: One ugly problem. Since moving to using the Linux kernel 4.14, I am now getting a complete "hang" if I try to reboot.  This is a problem reported by many users, in many different Fedora bugtrack reports, back in 2012 for earlier many Fedora versions - kernel 3.3x, if I remember correctly.  It apparently has resurfaced.  The older 3.10 kernel (which cannot see the sound card), reboots without problem. 

[Dec. 26, 2017] - The "Nightmare During Christmas - My Attempts to get CentOS 7.4 to Actually Work...".   Hilariously trying to get the CentOS-7.4 box to work as a useful Linux box, and it has "systemd" as the internal process initiation and control system.  And, ah, how can I put this... nothing seems to work right just yet...  It is comical.  GNOME has been wrecked so you can't easily create a program "launcher" icon, there are *NO* system-configuration utility gui-windows that let you configure system operation, configure a sound-server, or set up your network cards, and there is no facility to configure the SELinux boolean values.  First impressions:  CentOS 7.x is a brutal change.  The GNOME-3 + "systemd" approach seems to have effectively destroyed the "root user" configuration features that have been evident (and very necessary) since the days of Fedora-9, and even before.  To put icons on the desktop, I had to start a command shell, become root, and copy *.desktop files from /usr/share/applications/xxxx.desktop over to /home/<userid>/desktop/xxxx.desktop, where xxxx is the application name.  This is just a bit silly.

[Dec. 21-23, 2017] - I Put Linux and Python/IPython Tck/Tk/Scikit-Image/Pillow (for graphics), and Jupyter (with it's webserver running locally under Linux), plus all the libdvdcss+libdvdread/libdvdnav libs with MPlayer 1.2.1 on a Toshiba 4340 laptop I had that was gathering dust.  The machine is a rugged laptop built on a Pentium III processor, so I did not expect it to run everything - but it does.  It will even play DVD's, (once the proper code in libdvdcss library is installed.).  MPlayer is a nice collection of code, and as it is built on ffmpeg, which has access to all the codecs, it can render many different formats.

<See the "Mplayer: Play a DVD" section for details>

This needs to be said clearly:  Running Linux as your operating system lets you use your computer as a computer again. Otherwise, it remains owned by Microsoft or Apple, and operates only at their pleasure, which is just a bad idea for any person or business.

Having a solid MPlayer is good.  I can actually play all the .MOV files I took with my little Kodak digital camera several years back, as well as videos shot using my Blackberry tablet and my Huawei phone.  The plethora of video formats and related codecs, combined with the hostile American DMCA and the damage it has done, has held back video from being used effectively on the internet.  Copy-protecting and "streaming" video content is quite simply absurd.  The fact that I have to download, compile, link and install dvdlibcss, dvdlibread, dvdlibnav and MPlayer (all excellent products, certainly), just to render a DVD that I have already purchased and paid-for, on a computer that I own, which has been sold with a DVD disk-reader installed, is a form of social-dysfunction.  There is nothing more tragically silly, than writing important books, building large libraries, and then locking them up, so no one but a very-privileged, very-few can read what is in them.  European society did this during the horror-show that was the "Middle Ages", and it is sad to see the same greedy, selfish foolishness being repeated now in the digital age.  I read where Berkeley University just took 20,000 video lectures down, due to some legal dispute involving American "accessability" laws.  (The law apparently was going to require them to make equivalent versions available for "disabled" people.)  So even without the copyright rules and the DMCA, there are now other ugly ways that useful content can be suppressed, using the foolishness of modern American law.   The future of the "open internet" is looking a bit grim, as the forces of cruelty, greed and ignorance continue to gain the upper hand.  Try to stand against this tide, if you can.  Be Canute, and reverse it.  Folks who spout about history forgot that for those who waited a while on the shore with their King, the tide did actually recede, just as Canute had ordered.  He got wet, but the tide went out, didn't it?   Everyone misses the point of the Canute story.  Maybe nothing we do really matters, and we have no power at all over fate - but maybe it does and we do, right?  Our job is to try.  The King had to explain to his people the importance of trying, the need to be patient, and how one can achieve a desired result - even against the most powerful forces of nature.  Canute was not a fool. His Knights who were smart, and patient probably learned the lesson he was trying to teach.  The foolish superstitious ones who expected a "miracle", and were disappointed, would show themselves to be disloyal and useless - the wise Knights who stood in the water with their King, knowing it would recede, would show their strength and loyalty.   And the King would now know to which group each man belonged.  What Canute did was brilliant - especially in an age of ignorance & superstition that was so dominated by the awful foolishness of religion.

I am anxious to replicate the Kepler code, and really want to try to get Tensorflow running on a Linux platform, rather than just the Apple Macbook.  This means setting up a 64-bit Linux machine, probably with CentOS 7.x, given the success of the CentOS 6.6 testbed (which runs a Ruby-on-Rails server, as well as the Python/IPython/Jupyter/Tcl.Tk research environment).  Experiments with "networkx" have been successful, and I am looking at installing and configuring PyTorch (the Python Neural-network based machine-learning framework.).  PyTorch really appeals to me, but so does replicating the Kepler research material using Tensorflow, as a detailed review of their approach should provide a good learning example and operational prototype for what I want my market-intelligence AI to provide.

[Dec. 14, 2017] - Listened to the NASA news conference re. the Kepler Telescope discovery of additional planets around the K-90 star, which made use of TensorFlow machine-learning to indentify lower-intensity light signal changes which gave evidence of existence of two new planets.  The use of a Tensorflow neural-network trained using data from human astronomers is very interesting, and is documented in this about-to-be-published paper:

Very significant discovery (first planetary system found which has as many confirmed planets as our solar system), and important because of the successfull application of the  machine-learning technique employed.  The two researachers, Christopher Shallue and Andrew Vanderburg used a training set of only 15,000 cases, where human astronomers made decisions on what they found, and their network demostrated a 96% accuracy (they held back 10% of the training cases to use as a verification suite.).  I want to see their code.

Also: Last nite, I built a new version of MPlayer, a tool for screening video files - and included the necessary "libdvdcss", "libdvdread" and "libdvdnav" libraries (which I built from source), so that MPlayer could render DVD disks correctly.  I documented the steps I took on an older, 2.6.27 Linux kernel, and confirmed that my older, 32-bit Pentium 4, running with only 2 gb memory, and at 2.40 ghz, could render a commercial DVD from start to end, flawlessly.   I have also built Jupyter-IPython Notebooks for this machine, but have yet to install Tensorflow successfully on it (as it must be assembled from source, if it is to work on a 32-bit machine).    What is interesting, is how surprisingly well this older platform works.  I "git cloned" the latest "libdvdcss" code from github, and downloaded .tar.bz2 tarballs for the "libdvdread" and "libdvdnav" code,  and also compiled and installed them from source.  This let me re-compile and install MPlayer, which then was able to render a commercial DVD successfully, at high-resolution, and without any evident problem.  Better than my "Region-code=0" DVD player, actually.  Interesting result.  I documented the steps in the section on this webpage called: "Mplayer: Play a DVD"

[Dec. 13, 2017] - Took another look at getting TensorFlow to run on the Linux boxes - which are 32-bit.  Just compiling Bazel from source, and installing JDK /Java 8 looks like a dogs-breakfast, so we will just drop some cash on yet another box.  I want to try TensorFlow, but it is a nightmare to build it from source, because of the Bazel stuff, according to anything I can find online about this process.  I really want it running on Linux.  

I had an absolute pain messing around with different versions of Xcode just to get my DOSbox stuff to compile (and not blow up with an Apple-inserted time-bomb), and then deploy to the jailbroken iPad.  I don't like this vendor-restrictive nonsense.

I did finally get the TensorFlow "Laplace" tutorial of pond-ripples (my modified case: exploding stars... as shown, screen right) running on the Apple Macbook, and once I installed "networkx", I got the graph stuff to run with Tcl/Tk display.  I did not realize that it seems to be bundled with Python, so I don't need to install Tck/Tk seperately. The histogram examples in Jupyter+IPython Notebook work also, and render the histogram to a seperate Tck/Tk canvas, which is nice.  I am running Python 2.7.10 on the Macbook at the moment.  The attraction is that the ssh/scp stuff works, as well as the full Tensorflow is installed (but it the version as of this March, 2017 - not the most current 1.4 version.)  At least I can try the MINST tutorial, I am hoping.

Microsoft can be annoying, but Microsoft is like a helpful public utility, compared to Apple.  I was able to install from source, all the stuff I needed for Python and IPython Notebooks+Jupyter, and build "scikit-image" from source, because Microsoft made version 9.0 of their Windows C++ compiler for Python available as a free download.

 That was really good of them to do that.  The scikit-image stuff would not build, until I found a special "stdint.h" include file, and dropped it into the directory of compiler includes, but when I did that, everything could be built - even on my old Windows-XP 32-bit SP3 box, and I have now the same Python 2.7.14 environment (with scikit-image, matplotlib, numpy, scipy and even _tkinter + Tcl/Tk) running on Windows boxes, that I have on my Linux boxes.   But even though I have Python 2.7 running on the iPad, I can't get anything to install there because of the Apple sandbox thing that fires the "kill-9" switch to prevent any compile from running to completion in a build chain.  I have gcc and Python, but it is not possible to "pip install" any of the needed libraries, even with the jailbroken iPad.

Its good to finally get the Jupyter-IPython Notebook stuff installed and working on the Macbook, and run the first tutorial for TensorFlow correctly.  I am also very interested in Google's offering of the TensorFlow "Lite" for operation on Android-style device.  This is what I have been trying to do with the jailbroken iPad, running the APL stuff, which can do the Xerion matrix calcs, to execute the neural-net against immediate data.  The technology worked, but the forecasting of the AI was no good. But this TF-Lite stuff looks useful.

I read with interest the expected announcement re. the NASA Kepler telescope.  The Kepler array has discovered over 2000 confirmed exoplanets, and they look like they used TensorFlow to hack thru the massive telemetry data they have, and think they have found something interesting, which will be announced tomorrow.  Some are suggesting they have found space-aliens on one of the worlds - ie. a signature of electromagnetic variations that suggest an advanced radio-transmitting society might be evident on one of the exoplanets identified.   Or more likely not.  The whole "we have found aliens" story is probably complete fabrication.  Probably NASA has just found evidence for some phenomenon that they will assert needs to be investigated further - always a save bet for a scientific announcement.  Who can argue against that?   What was interesting to me, was that they apparently hacked away at the data with Google AI products, which probably means TensorFlow.  It would be nice to get the f***ing thing to work on something that is sufficiently open that it allows some real work to be done - like some version of Linux.  Using Apple software is like trying to do research physics on the factory-floor of a closed, union-shop with employee work-rules.  Macbook and OSX is a dumbed-down, locked-down journeyman's platform for reporters and lefties. I am seriously thinking about wiping the Apple O/S off the thing, and installing CentOS 7.x on it.  If I knew for certain that the wifi would work, I would do it right now.  At the very least, I wish I could throw away their desktop software and replace it with Gnome or KDE or something that did not make me frustrated when I try to use it.

[Dec. 08, 2017] - Crawling up the curve..  Three runs at forecasting (first on a DECsystem 20/20, then Xerion+Slackware back in the '90's on a P/C, and most recently, Xerion+CentOS/Fedora on the homebrewed Linux-LAN - all have demonstrated that short-range forecasting does not work.  So, where am a I getting my edge?  Thinking about GIbson's "Neuromancer" (and reading the great Wikipedia summary), took me back to my days at SMI.  I had written this Black-Scholes option-calculating stuff, and transcoded a thing called EVS into their research efforts.  The EVS thing was a cool, cross-sectional polymorphic database of everything - all major public company financials in Canada - and we got the kids to maintain it & keep it current.  I tried to get Jim to read Neuromancer, but it was where his ego defeated him - he read a few pages, and said it was not well written.  He was wrong, of course.  It had won all the awards in 1984 - Hugo, Nebula and some others. (Like taking the Pulitzer & the Booker prize, for those of you who read emotion-novels).  Time magazine put it on the list of the top 100 books written in the English language since 1923.  Jim was my client for the EVS thing, and he, more than anyone outside of book-reading, was the one who taught me how to hack the stock market - a useful skill, which has allowed me to pay the bills.   I am grateful to him for his advice & suggestions, and the books he gave me to read.  I had given him "Soul of a New Machine", and he had just loved it.  I was sad he did not want to read Neuromancer, because I knew - in the strange way that I *always* just know some things - that it would cost him something not to read it.  He didn't see that picture of the future we are now embedded within.  He died in a hotel-room in Ulan Bator (now spelled UlaanBaatar in my Rand McNally Atlas), after attempting to negotiate settlement for his mining company that had had its uranium mine siezed by local Government-types.  His company had won their case at the International Court and were trying to collect 100 million USD's they were awarded.  But he died, and I feel some guilt, because I should have insisted he read Neuromancer.  Gibson had painted this absolutely wild picture-of-the-world; a piece of fiction about a violent, complex, dangerous, absurd and supremely fascinating future where technologically-hyper-enabled folks are doing battle to achieve their private objectives.  It's a world not unlike where we are now.  I am a risk-taker.  But even I would not go to UlaanBaatar alone, and try to get 100 million USD's from Russian-enabled Government gangsters who had just siezed a high-value uranium mine, which offered them nuclear independence.  Geopolitically, Mongolia is the meat in the sandwich between an expanding, aggressive China, and a commercially successful and improving Russia, eager to maintain its status in the world.  His death was ruled "natural causes", and maybe it was.  But death is death.  I read everything he gave me, and it changed my direction.  Jim was the one who put me on to Hinton's lectures, where Dr. Hinton and his team were offering Xerion-source to any citizen of Ontario who wanted a copy.  I built this impressive process to forecast currency futures.  It didn't work either.  But I learned a lot, including Slackware-Linux, which I knew would be the future of computing.  The internet was just beginning.  Everything was possible, again. 

And now, I am back to the very first idea I had - reading and processing natural language files, creation of directed-graphs, adjacency-matrix calculations, etc. to attempt to build an AI that replicates what successful investors seem to be able to do.  Expert systems with fuzzy logic, inference-engines, and so on.  If you can't forecast, you must at least be able to create some flight-instruments that can help one fly on IFR thru a cloud-scape that is often trying to kill you.  And I still don't know if I have been smart, or just lucky.  Jim would understand that.  We all want to be Nero Tulip, and score the mega-dollars.  But maybe just being Fat Tony, and eating and living well, is the best that we can take from the markets, and still enjoy our lives.  I know I can't beat Wintermute.  But wisdom comes when you realize you don't have to.  And this wisdom can let you live long and prosper, which of course implies that you also get to avoid premature death - an important executive outcome, no?  (Hey, kokimashta, ne!)

[Dec. 06, 2017] - got the "scikit-image" library installed in Python on the CentOS Linux box and the Windows box.  Was not planning to do Windows/Python configuration, but I started as an experiment, and found it was possible to download "Microsoft Visual C++  9.0 for Python 2.7" directly from Microsoft, as well as the associated runtime libraries for C.  This lets the "pip install scikit-image" command run to completion (it dowloads and compiles a lot of material).  I will post a document on how I did all this.  You need to get a "stdint.h" header file, and copy it into the "include" subdir for MS-Visual C++ 9.0. 

[Dec. 05, 2017] - Quite a project getting Jupyter+IPython setup and running nicely on the Linux boxes and laptops.  But it has been successful.  Really a bit of a learning curve to climb, as there were many utilities that needed to be installed, updated and configured. A modern Firefox browser is needed, because Jupyter (used to run IPython (interactive Python) Notebooks) creates a token-authenticated webserver which communicates with the browser to run.  The gain from this approach is the browser gui-toolsets are used to paint images, ie. the matplotlib can be used to generate impressive graphics from non-trivial datasets.  Example: on a dual-core ACER laptop running a Linux 2.26 kernel, I could generate 100 million pseudo-random variables, run some calcs against them, and plot the results into a stacked-histogram (to see a normal distribution), in roughly 15 seconds.  The Python numpy lib is the old Fortran IMSL routines, which are fast, well-written, and correct.  One just starts a terminal shell in the Gnome/Xwindows desktop, and enters: "jupyter notebook" and **!shazzam!**, Firefox fires up with a Jupyter webserver running in background, and an interactive iPython session ready to go, and you are looking at a directory tree, in gui form, on localhost/8888.  You load up an iPython notebook (an *.ipynb file) from the browser window, as easily as loading an Excel spreadsheet, execpt you can work with literally billions of datapoints, if necessary.  This changes things.  The average research guy can use a computer as computer again, instead of just running it as a clever typewriter with big document storage.

[Nov. 27, 2017] - Learning Python, created some experimental images directly from code.  Other than using AI technology as a tool to assist and augment my trading and investment efforts, I have yet to see a viable role for an AI application that a small-holder can use to make an economic gain.  If the AI tech cannot offer me some form of provable "edge" in short and medium-term trading/investing activity, then I may be at an impass, as other viable avenues for commercial deployment are not immediately evident.  Also, I had an insight:  As the internet becomes dominated by AI harvesters, we can expect the rise of human "ratf(_)kers" who will act to increase both the amount and the dispersion of false data and deliberate inaccuracy.  And this should be seen as an evolutionary adaptive response - not necessarily a bad thing. Its like animals evolving camouflage.  I put an article on LinkedIn about this...

[Nov. 20, 2017] - Spent a chunk of time building a lot of Linux utilities from source (curl, cmake, git, tcl/tk, MPlayer and such) - tried to get Krita artwork-image prgm working on Linux - had to give up and get the .dmg file for MacBook, and install it on that platform.  See the Krita section for details.

[Nov. 17, 2017] - Some milestones for new V2 work:  Got Python and libraries (especially the image, numeric and scientific libraries) working on Linux laptop.  Had to download and build Python from source (using 2.7.14, latest from  Then had to get openssl-devel stuff, (and do a machine reboot! very important), and then could run "python", (after I found it at and downloaded it) which intalled pip, setuptools and wheel.  Then, I could "pip install numpy", and scipy and Pillow. (Note: use Pillow, even if running the Python 2.7.x branch, don't use PIL). Got it all working - and, was able to use Linux machine to access the Huawei phone to migrate the photo of the two machines over.  Had been dependent on Windows to do this, but determined a trick to let the Linux box access the ftp app on the phone.  Also, using updated Firefox on Linux (required updating Gtk and a bunch of other stuff) to write this.  This is first posting to this website that has not used *any* Microsoft Windows technology.  Getting the image off the phone, editing it (used GNU Gimp+gThumb image viewer) and posting here was a new process, but it seems to have worked.  Python + Linux is sort of magical - like that xkcd cartoon.  It's quite liberating.  I am really interested in how it was possible to build the Moire-pattern simulation .jpg image directly.

[Nov. 16, 2017] - Spent some time learning about video stuff on Linux (Mplayer, ffplay, ffmpeg, etc.) and built a home-brewed home-theatre system and a controller using the hacked iPad and a Linux laptop (an Acer Travelmate).  It is a cool hack, as it lets me manage and watch video playlists.   Have also returned to the Macbook, Tensorflow and Python.  Back to learning Python and the Tensorflow framework.  (This may take a while... ).  I have the idea to express the market picture as a, well - PICTURE.  I want to try to use image-processing AI technology to evaluate the image for any possible embedded informational edge.  Quite a different approach.  If you look at the "Code" section, you will see a little Python program that creates simulated Moire patterns. I show a pattern-image, and the Python code that created it.   I am running Python 2.7.10  on a Macbook, under Yosemite (OsX 10.10.5), an old, but stable MacOS version.  At least mine seems to be.  [Update] Later in the afternoon, after a sleep.. :) .. I put Python on the WIndows box a while back, but never tried much.  Just ran the little "" image-generator program (see "Code" section), and it worked on the Windows box also - scipy and numpy were successfully found on the fly, and some Microsoft image-viewing utility for looking at faxes is used to render the image immediately.  Very Cool.  I just used scp to copy the prgm from the Mac to the Windows box, started Python and did an execfile.  Running Python 2.7.10 on the Mac and 2.7.12 on the Windows box.  Python is a well thought-out language and environment.  It lets you actually do things, instead of just drawing dreams on whiteboards.

[Nov. 5, 2017] - Couple of interesting things: Got the GAUSS routines (for matrix math, eg. multipy and inversion, etc.) running nicely on the iPad 1 now.  They are not super-fast, but the numbers are right.  I now have "container" based intercompatibility among Windows, iPad-iOS, Linux and Android using the DOS-emulators..  I can run the *same* code on all these platforms, and do consistant math - so I can multiply and invert tensors and get NN output in (GO / NoGO / Don'tKnow) trinary logic, hopefully.  I have a couple of different flavours of Linux - Fedora9 and CentOS. The  DOSemu stuff on CentOS would not work on "term" only (ie. without Xwindows). After research, learned had to install the S-lang development lib and the GMP development stuff (ie. basically just header-files so the DOSemu compile would run to completion).  Got it to work.  Now, both CentOS and Fedora boxes can run DOSemu without running X, so I can log in remotely, pass data in with a simple "scp" command, and so run on my own private "cloud" if I need to.  Another checkmark in a long list of tickboxes...  

The other track is the video stuff.  I compiled "ffmpeg" from source on the CentOS box, and can run videos there now, using ffplay instead of mplayer/gmplayer, which reports that my box is too slow.  (Comical. Using "ffplay", I can render any .flv or .mp4 video smoothly now on the CentOS box in full-screen, except they render a tad fast - there is minor "chimpmunking" of the audio stream.  Anyone know why???)  Same videos, with same Mplayer source, from same tarball running on Fedora9 Linux works flawlessly - good enough to operate as a "video jukebox" that I configured for fun this weekend, and patched thru from a Linux laptop to the big-screen TV.    The idea is that I could ffmpeg market and news data-info into summary images - process the math-rendering of the images in real-time using an AI-built parameter tensor (ie. transform them and then do the matrix math), and then have an indicator calculator that will give me a Go/NoGo/Don'tKnow output, which will be my edge.

It is cool just getting the ffplay stuff to work right.  The "ffplay" is a light-weight (well, sort of light weight, but not really) video player, that runs I think using SDL (Simple Direct Media Layer) stuff, into Xwindows, and is quite efficient, compared to "Mplayer", which grinds and is choppy and just too slow.  Mplayer just cannot render hi-res videos in real-time without delay, choppy-rendering, and serious fram-dropping, whereas "ffplay" can give a smooth, full-screen video+audio output experience on the Linux boxes.    I think sound+vision is the key to the future in many product areas - even with market-calling AI's.

[Nov. 1st, 2017] - Got the DOSPAD-Gsys stuff working correctly, and put a Fortran 5.1 compiler testbed on the iPad 1.  I hacked this all together last year, and got it working on an iPad 2, but the Apple Xcode compiler has various restrictions and time-fail code build into it, the test app on the iPad-1 would not work at all, and the DOSPAD version on the iPad 2 failed to operate after a short time, as per the restrictive practices of Apple Corporation product design.  I was able to get a version called  "DOSPAD-Gsys" -  an implementation of the DOSbox code - running, by various methods on the iPad 1.  After some effort, I have been able to get the original IBM/Microsoft Fortran 5.1 compiler, running under this DOSPAD-Gsys app, which of course, requires a jail-broken iPad.   It produces results in both single and double-precision, which match results from Windows "Cmd" shell, and Linux "DOSemu" emulator.   This means I can use Fortran matrix-math routines to evaluate tensors produced by any NN-AI, so data-evaluation can be carried out on the fly, based on real-time data harvested from the Internet, using Lynx, which I also have running on the iPad 1.  CLick on the "DOSbox - on iPad" menu-bar option to read details.

[Oct. 29, 2017] - The post-training evaluation of the Xerion neural-network based market forecasting tool demonstrates a co-efficient of accuracy of around 0.24, roughly 25 percent.

  In thinking about this results - which seems to be consistent over time - I think I have a picture now of what is happening.  Basically, I have confirmed the current approach does not work, but why 25%?   If it was pure random, I expected to get co-efficient of accuracy somewhere around 33%.  But my understanding of the probabilities here was wrong.  My working hypothesis is that what I am dealing with is two sequential random events.  First, the dataset is created, and examined, and we train to that.  Then, the trained network is used to predict the outcome 5 days ahead.  (It is five, because the closing prices of the current day are not known.  On day-t, we are only using data up to yesterday, so it is five days ahead of yesterday, or 4 days ahead of today.).   What I believe is happening is simply this:  In selecting data from a group of series, and along 5 day time vector, I am basically sampling randomness.  I am looking to see if I have an up or a down trending market.  If I am dealing with pure randomness, then I have a 50% chance of even making a correct decision here. (Eg. I may see lots of UPs, but the true-trend is actually DOWN).   It's basically a coin-toss whether I have grabbed the useful, predictive data or not.  Then, in using the data to try to predict a future event, if I am dealing with pure randomness, I have a 50% chance of making a correct up versus down prediction. (I have to have a +1 or -1 to trip the counter that calculates the co-efficient of accuracy).  So again, if we really are dealing with pure randomness, and I get a trend signal either up or down, I still have to interpret that signal, and make a choice of UP or DOWN, which if the predictor is just flipping a coin to decide, implies a probability of 50/50.  So the 25% co-efficient of accuracy is just what would be expected, if the driving mechanism is one of sampling from a purely random phenomenon, ie. 0.5 x 0.5 = 0.25.

So, the 0.24 resulting co-efficient of accuracy that I am consistantly getting, seems to be a pretty good indicator suggesting that I am sampling data that is in a domain charactized by a purely random, unbiased process.   Basically, in schematic:  random data in => 50% chance of getting an up or down signal correctly => run signal thru the prediction network => outputs a signal of +1, 0 or -1.   But I am only counting as "Accurate", events were I get a correctly predicted UP or DOWN signal.  So again, if the process is purely random, I am right half the time = prob. of 50%.   So, the probablilty of getting a correct hit is: .5 times .5 = .25, which is very close to the experimental results I am seeing.  

If any live human being is looking at this, I would be interested in comments.  (I fear almost all hits to this site are from spiders and robots).  I had expected to get accurate hits, if all was pure random, at around .33, but the number is consistantly .23 to .24, and in thinking about why, I believe I have hit on the reason - ie. there are *two* sequential events, each with a 50% chance of being right, that are at play here, hence the number of accurate hits the network generates is going to orbit around 25%.

Two Facts:  1)  Every successful trade requires two successful decisions.  You have to buy (or sell-short) at the right time, and then sell (or buy-cover) at the right time.  Just on that simple observation, one can quickly realize that the edge-less probablility of being successful, drops to 25%.  That means, without some form of what is now called "advantage play", you are pretty much assured of losses, if you are an active trader.  It also explains the attraction of the old "buy and hold" approach, where most cash gain is extracted as only dividends or interest payments. In a long-term, real-time experiment, involving two real portfolios, my non-traded portfolio has done significantly better than my actively traded portfolio, despite the actively traded portfolio doing not too badly, considering the market environment of the last 14 years.

2) One of the pitfalls that active traders fall into, is the folly of "win maximization" behaviour, versus "gain maximization" behaviour.  Bad trading will be characterized by a long series of small wins, followed by one or two big losses, versus a long series of small losses, followed by a big win.  It is the later approach that creates gain.  Our own, human neuro-biology defeats us, as detailed behavioural studies show that most commodity traders engage in win-maximizing behaviour, and virtually *all* consistantly lose money over time.

The advantage of automating the trading and investment processes flows from these two key facts described above.  The idea of using the NN is right.  It is just my current implementation that is not yet correct.   I need to find the true signal, and then, I need to determine how best to use that signal.

[Oct. 27, 2017] - Maybe all Copyright Law is bogus.  Read this piece, tell me what you think:

What if an AI creates "artwork"?  Who owns the copyright?

[Oct. 26, 2017] - Never assume anything.  Always check.  I thought my Linux CentOS Firefox was running HTML5 WebM by default, which it is, but the IBM Cloud Ustream product falls back to using Flash - which of course works flawlessly.    I disabled the Flash plugin, and watched as all the video stuff stopped working.  <Sigh...>   The mish-mash of video standards and the security issues they present is one of great failure points of the modern internet.  Quicktime on the iPad worked (and still works) very well, as it is integrated with the Safari product - which is now unable to render the Yahoo stock quotes page.  Modern browser technology is entirely focused on delivering advert interuptions, and really little else.  Tools like Skype are no longer reliable or trustable, and even simple products like spreadsheet technology have been corrupted with an idiot blizzard of incompatable variants.  (Got messed over with a .xlsx file recently.  Annoying diddling designed to force another unnecessary upgrade cycle on commercial and academic users, who just want to be able to share data tables.)  And yesterday, my Samsung Tab-A wants to destroy my APL apps by dropping a bucked of "Nougat 7.1" on me.  The "continuous deployment" approach of constantly changing software means constant and purposeful instability of operation.   This is starting to look like a giant industry-sanctioned scam.   It's perhaps time it ended.

[Oct. 25, 2017] - Updated the "Firefox+Video How-to" section, with explicit instructions on how to use the Adobe "Primetime Content Decryption Module" to render H.264 (basically, .mp4 video files) within Firefox browser, in my case, a Firefox-47 version on an older WinXP/SP3 box.  The "Primetime..." thing is for DRM nastiness, which we avoid.  But it also works for non-DRM videos, and is a method that lets Firefox render .mp4 videos.  SInce Youtube has dropped all Adobe Flash support, rendering .mp4 files is now a critical requirement for any web browser.  Newer verions of Firefox monitor and transmit browser activity, using various methods, and all support for "plugins" as well as operation on Windows XP/SP3 will be dropped or disabled.  We've been experimenting with K-meleon and other browsers, and we hope to move entirely to Linux soon, as that is where the AI stuff is located.  With WINE, we find critical Windows programs (our APL stuff, Xerion NN,  TSM and Lynx data-harvesters, for example), can operate satifactorally on LInux.  But it has been useful to bring Youtube back online for some of the older XP-based equipment, and explicit details are provided in the Firefox+Video HowTo section.

[Oct. 21, 2017] - Just an update on the video stuff...  The version of Mplayer/GMplayer I compiled from source does not list an audio option for PulseAudio, and I found the x11/xv option works best for video, in the gui version (GMplayer).  I found when using SDL for video rendering, I would get slight droppouts in the .MP4 files (sound and image video file) as they played.  But using x11 and the ALSA option for audio (Advanced Linux Sound Architecture) driver options (selected when running GMplayer - the on-screen gui version of Mplayer), I do not get any dropouts or spurious pauses in the rendered video.

[Oct. 12, 2017] - Completely "back to the drawing board" on the AI work.  Since AI's do image classification well, thought I would re-frame the basic question into something along that line of inquiry.  Plan: take a market "picture", (maybe still using boolean jumps), and then assemble longer time-series, combined with fundamental data (div. rate, EPS, book value, trend-estimate, turtle-N, Williams MFI, etc...), (all data that TSM calc's now), and then look much further ahead (maybe 6 to 18 months), and take price picture to calc a ROR (rate of return).  Then, use a backpropagating neural network with gradient-descent training to classify the various market pictures based on 6, 12 and 18 month actual outcomes.  I should also include better interest-rate information - ie. short, medium and long rates, across both investment grade and speculative (ie. junk) bonds.   Some info on central bank balance sheets would also be useful.  What is funny, is how much better I do with a longer time horizon.  My personal portfolio is thumping along fine, and the ones I manage and monitor, (and basically don't trade), are just hammering along and also throwing off cash.  The 5-day ahead NN-AI experiment has demonstrated a co-efficient of accuracy that is stable, holding around 24%, basically showing a completely random result.  The recent past does not give us any hint of what the near-future will be.  Confirms work I did for a Treasury Ministry, using a DECsystem 20/20, back in the 1980's.   Science sort of works.  And maybe finance and econometrics is almost science.  Almost.

I am also looking more at image stuff.  I got Firefox 34 running on my older Fedora Linux platforms (they are stable as turntables on granite blocks), and have built a reasonably current version of Mplayer, version 1.2.1, (which uses ffmpeg and ffplay).   Had to fiddle some of the c code in ffmpeg subdir libavformat, but then got a clean compile.  If you are compiling Mplayer for Linux, make sure to do your ./configure with the  --enable-gui option, to get the graphic user interface (gui), so you can run it from a Gnome (or other) desktop.  You also have to setup the "skin" (default is Blue), for the gui to work.  You have to put all the "skins" stuff from ../Blue subdir, you get by untaring Blue-1.12.tar, into /usr/local/share/mplayer/skins/default so the gui will work.  This works on my custom-built Fedora kernel (circa Fedora-9), and on CentOS 6.6, Linux Kernel 2.6.32-504.el6.i686 running GNOME 2.28.2. In fact, it works so well, that I am surprised at the awesome quality I am getting on these older platforms.  Check out the 4K example video below.

And get this.  Running Mplayer gives me a message saying "Your System is too SLOW to play this!" on both my old ACER laptop (running the hacked Fedora-9 Linux) , which has a 2.0 Ghz Intel Centrino-Duo processor, and my CentOS 6.6 running a 2.4 Ghz Pentium-4, with 2 Gb memory.   This "Too SLOW.." message is not accurate.  Using the command "mplayer -vo sdl" to run Mplayer with the video output set to sdl (Simple Directmedia Layer), it runs full-screen, full-motion hi-res video perfectly, and even has sound, despite my Fedora version using an early PulseAudio implementation that is sometimes problematic.  Note: Here is the help/troubleshoot FAQ for PulseAudio:  

With this Mplayer, I can view all video formats, if I have downloaded the file. (You can even fire up Livna, and get the thingy for dee-v D's, if you want). 

Just for the purists, and in the interests of full-disclosure: The ACER laptop is a TM6460-6572, and the processor is a 32-bit Intel Core 2 Duo Processer T7200 (2.0 Ghz, 667 Mhz FSB, 4 MB L2 cache).  This older platform has 2 Gb DDR2 memory.  But the Mplayer can play a full-screen wonderful fluid-motion 4K video of this amazing northern aurora I downloaded from Youtube using the iPad.  The hi-res .mp4 aurora video is from Ron Murry Photography. Here is the link to it on Youtube.  It is a great test video to confirm your video software is rendering 4k video nicely.

You will want to download this file as an .mp4 file, of course.  I use the hacked iPad to do this, since I regularly get buffering interuptions using Youtube or any other streaming technology.  All non-live video should just be downloaded and localized.   Streaming a static file is silly, but of course, the money made by Google and Netflix is not, and given the DMCA, a broken, low-quality solution is better, I suppose, than no internet video at all. 

[Oct. 2, 2017] - Sad news. Condolences to families of Las Vegas victims.  Looks like a terror attack & ISIS has claimed responsibility, but that looks to be a bogus claim...   But is it possible a 64-year old white guy, who had a pilot's license & owned two airplanes, and had a nice little retirement home, could really spend 30 minutes shooting at country music fans from a hotel window, using automatic weapons?  Why do this?  Had he lost all his money and then his girlfriend left him, and he fell into complete clinical insanity?  Is this what the future will continue to look like? 

There is a 1969 book called "Stand on Zanzibar", by John Brunner, and I think it won the Hugo.  It was set around now, (2010, actually) and describes an overcrowded, competitive world, where people fear "muckers" (not muggers) - as in sane folks who suddenly run "amok", and start attacking and killing those around them, for no apparent reason.

What I remember also, is the supercomputer in the story, which is basically a big AI, called "Shalmanezer", if I remember correctly.  Part of the plot involves a big trans-national company basically purchasing a small West-African country (Beninia? - ie. based on Benin), and getting permission to do this, on the promise that it would completely run the small nation's economy and make everyone reasonably prosperous - but this would involve programming and managing every economic detail, right down to the allowance and pocket change each child would have.  I don't think even Shalmanezer would be able to do it, but some of the other predictions in this dystopian novel seem to have come true.  We now have well north of 7 billion people on this planet (as the novel predicted), and there do seem to be bio-safeguards built into living systems to self-correct hyper-crowding.  I was more expecting rapid fall-offs in fecundity rates, and not so much a rising tide of mass-killings.   Brunner's book, IIRC, was more disturbing than Orwell's "1984", which described a future so awful it  was difficult to take seriously.  But Brunner's book had this demographic inevitability that made me quite uncomfortable.  We *cannot* continue to increase human population geometrically, and remain on this small wet sphere, without we all at some point reach a dramatic transitional event - either economic or ecologic, or perhaps a combination of both.

[Sept. 21, 2017] - Excellent harvest this fall, second of what looks to be three harvests of hay and grass this year, bound up in rolls, picked up and stored by days end (see first picture).  Maybe the "Physiocrats" (cf. Francois Quesnay), and their "Tableau Economique" were not quite so quaint and silly after all...   (See the "Economics 2017" section for a quick explanation.) 

Federal reserve announces offically that it will begin trying to reducing its bloated 4 trillion dollar "balance sheet".   As they push the bonds they bought back into the marketplace, they will drive *down* bond prices, and force long rates up.  There is also likely to be another administered short rate rise in the US before year end, and at least three in 2018.  This will prevent economic collapse, but will also likely ride us down the other side of this runaway bull market that has been in operation. 

Only bank-stocks and other spread-driven financial-service providers will benefit.  Most real operations will face higher costs, rising debt-service rates, and rising inflation (my model correlates inflation with interest rate rises, as both are seen as a cost by those who generate economic surplus.  We know rising rates are only dis-inflationary when they rise high enough to cause consumers to defer consumption, and switch to investment. Rates have to go to 15 to 20% to cause that switch.  If rates stay in the middle-zone, (3 to 9%) they just get passed forward as a rising cost of business).  Francois Quesnay was not stupid, and he was not a fool.

[Sept. 16, 2017] - Designing another approach, continuing to evaluate existing network. New approach involves a "classifier" network, got the idea from the CT-scan approach.  Forecasting future values is perhaps not best idea.  Perhaps, I just trinary classify the current most-recent-data-vector of series under inspection as: 1 = positive trending, 2 = stationary, or 3) negative trending, and ditch the idea of making any estimates of expected future values.  This could provide better and more actionable information, in much the same way image classification does.  Simple algo:  Stay long, if pos. trend, execute well understood mean-reversion stat-arb strategies if 2, ie. mean-reversion seems to be happening, or 3) either exit the long and/or consider taking a short position (or at least pay for a couple of puts perhaps).   This is what I was doing years back with rescaled-range analysis (Hurst Exponents), which my TSM database utility can already calculate (along with Turtle N-values, Williams Market Facilitation Index (MFI), etc.   I can produce a blizzard of stats - what I need to know is if I should take the bloody trade or not = ie. some sort of probability estimate, so I can make this game have a positive expected payoff.  it may be the whole NN-AI approach should be crafted to just to estimate something simple, like the "probability of success" for a long postion in target, where success is defined as a positive future outcome that exceeds the risk-free interest rate at a given future time point, or something like that.  Looking at the success of the CT-scan lung-cancer image classify NN's (and then getting a CT-scan of my noisy lungs) has really been an eye-opener.

[Sept. 15, 2017] - NN AI technology is very good at image processing, and apparently, NN techniques are being actively used to detect tumor growth in lungs by inspecting CT-scan tomographic image-sets.  As of two days ago, a company, Matrix Analytics, has indicated it is beginning validation trials.  This is of interest to me, as I had a CT scan last week, and am still awaiting results.  It is one thing to experiment with this technology, and another to be at the pointy edge of it, and having it rain down on oneself as low-intensity (but high-energy) x-rays from a big, rotating scanner, with one's bloodstream full of radio-opaque iodine compound that is causing all your fingers and toes to feel like they are being dipped in hot water.   The tomographic image resolution is so much better with the radio-opaque iodine compound, that one can certainly see why it is used.  But you can also feel like you have wet your pants (which I did not, thank heavens...).   Apparently, NN AI methods are working *very* well at reading and interpreting the CT-scan images, so much so that the technology is rapidly being commercialized.

[Sept. 12, 2017 - FD: The two most critical drivers that I did not include in the NN input suite, and that I now know are important to my NN's predictive ability are: 1) exchange-rate/ currency valuations, especially for the currency of the target, and 2) analysts revisions to price targets.  Both of these can be shown to have important impact on market price, and both can be sourced, but the analysts re-pricing stuff is a bit tough to include - although if it is translated to booleans, it should slot in nicely once I can determine the most effective way to do this.  It's no secret that the my target price is the currently most undervalued of the Cdn banks - trading at roughly a 12% to 15% discount to the rest of the group - and it throws off a big dividend that lets me keep the lights on at the farm.  (Hey, buy a farm, if you have some money.  Then make sure you have a source of income, that does *not* come from the farm.  That way, you can keep farming!  I read about a guy who won a lottery.  The newspaper asked him what he would do with the money.  He replied:  "Well, I like living here.  I'm going to keep running my farm, until the money is all gone...").  

People love to whine and complain about banks.  And I have tech-associates who don't want banking-sector clients, because they detest working for banks, for many reasons.  But here is a secret:  Want to make money?  Don't buy shares in companies you like.  Bad idea.  Buy shares in companies that you *hate* - but still do business with, anyway (said the owner of several iPads and a MacBook Pro.)  If you hate a company and their products - yet you still do business with them (think airline, oil-company, auto-company and tech-company stocks, not just bank/insurance co.s), then that company has a lock on something, and will likely not explode in your face like a hand-grenade, (Lehman Bros.) or wither and die, like so many pretty things did during the first dot-com bubble.  On the other hand, I know a guy who bought Carnival Cruise Lines stock - and made serious money - and also took lots of cruises with them, and loved the company - so there are exceptions to the rule.  But I liked Nortel, and even did some work for them.  When they were $120/shr, my analysis suggested a price target of $20 was about right.  But I could never keep a short on for more than an overnite trade, as the thing would just get bid up too easily.   Until it exploded and died, of course.

PS: I agree with the TD analyst, who has a $120 target on CIBC, and I remain in my long position.   (Gotta keep farming!).   You can check out the video of the TD bank analyst at the url below.  FD:  I also personally have TD stock, and run a private portfolio which has a significant position in, and exposure to, TD stock.  Also, other than being a customer (without a yacht), I have *no* connection to, or with TD, or any other Canadian Bank or Canadian public company.  And anything I write or discuss here is for analytic & educational purposes, primarily for assessment of my neural-network artificial intelligence/machine-learning experiments, and is not to be taken as or construed as investment advice. (My lawyer said I should say this.  And it is true, too). You should do your own analysis and make your own decisions, or turn all your funds over to a professional, that you can completely trust.  (Not Bernie Madoff, or any of his family, ok?  Do background checks. Seriously, do this.  When I worked free-lance for a small brokerage firm, any time they were talking with company people about a possible stock flotation, they would *always* do background checks of the company officers, and see if anyone had been a discharged "bankrupt", or had a criminal record.  Scam-puppies are as common as Barnum's "suckers" now.  There are whole litters born every few minutes...).  That is why you must do your own research, and make your own decisions.  It is the only way to really learn, and you *really* have to be careful now.  See, you have to invest.  Even buying gold, and burying it, is an investment of sorts.  (That trade worked very, very well in Germany and Austria, in the 1920's).

Ok, here is link to TD bank-analyst, chatting about Cdn-bank-stock Q3 results...

Send me a note if this link does not work...

[Sept. 7, 2017] - Just discovered "Blender", the codebase and application suite used to produce "Big Buck Bunny", the animated short film used as a test suite for video rendering by many.  Very cool.  Here is a good AI project:  Take all the market data - in real-time, of course - and lash it up like an old breadboarded circuit, to a bunch of 3-D imaging software, giving a high-res, fast picture of how market action is unfolding.  (Hint: Morgan Stanley or somebody in NY did this years ago, but in flat 2D, using APL I seem to recall.  It worked for a while..).  Maybe time to take another run at this idea, as the human brain is very good at shape & space recognition.  Maybe use VR glasses to watch it (and initiate trades), in real time.  Probably already being done, I suspect.

- posted details on how to fix Firefox so you can see my posted .MP4 (H.264+AAC) videos for Bimbo and Betty Boop.  These are great pieces of American history, and deserve to be more widely known.  To hell with those who would obfuscate and deny our shared history.  Seriously, I mean this.  The copyright rules and DRM stuff and aggressive IP foolishness are damaging the US and the world.  Our shared cultural history belongs to all of us.  Fraudsters that want to block access to our knowledge-bases, and tear down our public monuments to fallen figures of history, are fascist criminals of the worst kind. I feel strongly about this.  History - true history, not the radical-leftist fraud-talk that is popular in the left-liberal schools - is important, as it provides a clear map to the future.  We should detest violence, yet also remember that war works.   War is often the painful price of freedom.  It is a high price to pay, but like the price of most valuable things, it is often worth paying.   No-one remains free and safe or has any real security, when bad things are allowed to be done in the name of good ideas, and evil is allowed to flourish.  Remember this, people.

I posted the FIrefox parameter stuff so folks can see how it can be configured to work properly, and show all HTML5 video formats correctly.  The idiotic blizzard of video standards is perhaps the price we have to pay for fast innovation.  It took me *days* to figure out how to make something that was working correctly in 1997, start working again, in 2017.  WTF? is about all I can say.  Also, if you are in one of those seriously non-free places (oh, I am thinking somewhere in the East maybe?), make sure you learn about and use TOR.

WRT to the NN-network project, I have located a good source for some of the additional data I need to fix the poor forecasting ability of the current model.   In fact, what I have discovered looks like it might be quite useful, AI network or no AI network.  Key for me is to keep on, here.  I am scheduled for a CT-scan tomorrow, as per my doctor's suggestion. (My doctor is pretty cool... he is a very large black dude from Africa, who reminds me of Hunter Thompson's attorney in "Fear and Loathing...").   He and I took a look at a quick chest x-ray, and in later consulations with another fellow at the clinic, he scheduled this quick CT imaging for tomorrow. The urgency here is surprising to me.  Lends a certain focus to my AI work efforts.  If I am to get any benefits from this exercise, best if they come sooner, rather than later...   I need a new pickup truck, and they cost $70,000 here.  If I want to have a bit of time to motor around in it, best if I can achieve results in a timely manner, before Mr. D. comes to visit, and knocks his boney fingers on my little front door!   :D

[Sept. 1, 2017] - Max Fleischer was an amazing genius, very far ahead of his time.  His wild, surreal "Talkartoons" were full of both modern, sophisticated jokes, and clever classical references.  How did Fleischer Studios not survive to be bigger than Disney?  In searching for some other technical material, I ran into a reference to "Bimbo, in The Robot", a 1932 Betty Boop (Fleischer Studios) cartoon.  The word "Robot" had only entered the English language 10 years earlier, from Czech writer Karel ńĆapek's "R.U.R", (which stands for "Rossom's Universal Robots"), a play about "Blade Runner"-style replicants who have taken over the world - but it was written in 1921!  In the "Talkartoon", Bimbo is an inventor who has a two-way "Television" he uses to talk to his girlfriend Betty Boop, and he builds a strength-enhancing Robot so he can win a $5000 prize-fight and get his girl.  What a classic story-line!  As I watched this impressive old American-genius anime, it really hit me: THIS ... this is what we need - not any sort of prediction device - but an active, constantly learning, assistive augmenter, that helps us overcome otherwise impossible-to-succeed scenarios.   Two Fleischer Brothers clips: First is "The Robot", second is Betty Boop closing a show in NYC, and then flying her own airplane to Japan, and doing a show in Tokyo, where she sings in Japanese.  Apparently, Osamu Tezuka, who authored and developed the "Astro Boy" series, (about an atomic powered boy-robot, which was a wildly popular anime TV show in post-war Japan) watched Fleischer Brothers anime in pre-war Japan when he was a young boy, and was very impressed by it. Tezuka created hundreds of anime publications.  I particularly like his "Black Jack" series.


[Aug. 31, 2017] - I might have to defer to Prof. Andrew Ng.  Attempting to forecast actions of banks and bankers, and associated equity values and resulting market prices, by watching their reported numbers, and related economic data series, looks to be not-doable.  The Bank of Canada has some serious series at its disposal, and a *lot* of wise people, as well as significant economic power and authority.  They need not simply forecast, they can alter what occurs by open-market operations.  Yet even they could not come close to simply forecasting 3-month second quarter Cdn GDP change.  The consensus number was just above 3.0 percent.  But Q2 Canadian GDP came in at a robust 4.5% annual change for the April to June 2017 period.   This is a boom-time GDP delta.  I was expecting a lower number - in the 2.5 to 2.9 range (ie. below the GDP delta for first three months of the year.)   So, hell, this just demonstrates what my little Treasury group learned back when we were young pups out of school - even the best of the best, with the most accurate, current data, cannot forecast worth shit.  Let's be clear about this. You cannot forecast the future any better than the null-forecast.  The Null-Forecast is "It will be tomorrow, what it is today."  In other words, the best estimate of the future value of a stationary price series, is the current price today, ceteris paribus.  (Ceteris paribus is economist weasel-talk, which means "everything else being equal", which, of course, it never actually is. )

So, if you are trading, forget about trying to forecast.  You are best to make reactive decisions to observed events, and be agnostic about the future.  Let the market tell you, and don't waste time and effort trying to forecast future values.   Simply position yourself and your holdings for what seems most appropriate at the current time.   I have my trading portfolio, and a similar sized long-term classical investment portfolio, which I deliberately do not trade.  The "not traded" portfolio is absolutely beating my trading portfolio, by a very large percentage now.   It's percent-change sign is nicely positive, and my trading portfolio has a big negative percent change sign.  

The investing game is unique.  It is different from other human actions, in that often, the less you do, the *better* you do.  The "Warren Buffet" portfolio, where the holding period is "forever", does better than almost all actively traded portfolios.  For a keen, clever, hard-working guy like me, this is a very hard lesson to learn.  

As an investor, long-term, I have actually done quite well.  But since the Trump election in the US, I have managed to get almost perfectly wrongly positioned, cashing out and missing the run-up, repositioning at a local market top, and now riding a couple of big positions into the toilet.  It's a  neophyte mistake, making me more angry at myself for this  time-waste exercise on machine learning.  There is a real chance that neural-networks are possibly complete useless here, as they have to be trained on *historical* data, and it is the nexus point of the *right-now*, as it moves forward thru time, that matters.  It is as if a bullet in flight is more like a rocket with fins, than a bullet on a trajectory - a tiny perturbation of the trailing control surface (the fins), can cause a massive redirection of the flight-path.  As such, any examination of the historical actions of the trajectory is basically a complete waste of time, as it has so little bearing on the future "point of impact".

Curiously, the fellow I know who uses older "expert systems" with fuzzy-logic, said pretty much this about neural networks in market contexts.  He thought they were completely useless, and I am thinking he was perhaps right.

Although my trading activity would show multiple runs of successful trades, sometimes 5 or 6 wins in a row, of roughly $1000 each, on balance, I have to admit I would have been much further ahead, if I had simply avoided *all* statistical-arbitrage style trading, and just taken positions and held them, until I found something better.   And I even have a detailed academic paper on this very topic somewhere, which did this formal assessment of long-term commodity *investors*, virtually *all* of whom lost money over time.  There were basically *no* long-term "winners" in the study, yet the punters kept participating, often for years.  Almost all were wealthy business-owners, with significant surplus funds available for their "investing" (trading) activity.  They all lost money, but kept playing.  The study showed they engaged in "win-maximizing" behaviour, maximizing the number of "wins" they could have - not maximizing their possible profit.  They played, simple because of the neural-technical characteristics associated with "random re-enforcement", a powerful psychological training technique.

In Grade 8, when other kids were playing outside, I was repeating B. F. Skinner's experiments with rats in a "Skinner Box", programming them to have a "conditioned response".  (The bell rings, and the rat would jump over to the other side of the box, without even thinking about it. )   I realize now, the market does the same things to trader/investors.  It teaches them to hold bad postions, and rewards them for making unwise, short-term trades.  I am the rat in the box, and as the prices change, and I jump in and out.  Not good.

If you want to be a very successful investor, you have to be the guy ringing the bell, not the poor programmed rat doing the jumping.  Zen-like enlightenment, satori desu.  Prajna.  I have been the rat, and my entire approach using the boolean neural networks here is not just unsuccessful, it looks to be plain wrong. 

It is like the "caterpillar --> butterfly" problem.  You have to watch the process unfold long enough to see the caterpillar transform into the butterfly.  And your investment horizon has to be long enough to capture that entire transformation.  Or, you must trade at nano-second intervals, and capture rapid (but very predictable) small, very short term changes.  Try to mess around in the middle-zone, and you will just be the guy supplying the capital to the game.  Perhaps I will fly to the Zimbabwe for the Harare International Carnival, and watch Zodwa Wabantu do a modern version of Josephine Baker's "Danse Sauvage".  Those who are offended by Ms. Wabantu's radical sexualized dance style, should watch Ms. Baker's 1927 Paris performance, which was recorded at the Folies Bergère.  Fashion, art, dance and fame are like the markets.  The more they change, the more they remain the same.

[Aug. 23, 2017] - More research on deception/fraud in banking..  Learning about how bad the threat scenarios created by modern malware really are.  As an author of Android apps, which I have available in the Google Play Store, I was particularly surprised by the sophistication of the "BankBot" malware that made it into the Android-based Google Play Store, and has been used to enable fraudulent bank transactions.  

It works as follows: A user downloads a bogus app (a "flashlight" app, or an app that purports to show funny videos or something like that), and once this seemingly benign app loads, it then downloads a malware APK (application package) and side-loads this excrement-pile of toxic code to overlay fake screens when you make legitimate access to your online bank accounts.   The app watches for your access to the bank's website, and then overlays a fake screen to capture your login credentials, which are then transmitted to the criminal's device.  This defeats two-factor identification, and the "BankBot" malware even blocks the bank's SMS confirmational message, and sends it to the criminal's device, so that SMS-based confirmation of transaction can be faked.  In this way, the "BankBot" code is using spycraft-style data exfiltration - your SMS messages are read, and re-sent to the criminal, so he can craft a successful fraudulent reply, as he is creating a cash-transfer transaction that will empty your bank account.   Finally, the "BankBot" app will lock your device to prevent access, so that your bank cannot even SMS or phone you.  It will present a fake notification screen saying it is updating, and remain unusable.   To remedy this, users will reset their device to factory settings, and thereby typically destroy all forensic evidence of the "BankBot" code.

Further details, including MD5 hash-codes of the bogus Android APK's, are here, on a SecurityIntelligence website, which is operated by IBM.  This information is from July 27th, so we can expect all these examples of "BankBot" apps will have been removed.  What is interesting here, is the level of sophistication that this malware shows, as well as the note that it does not operate at all, if the targeted user is seen to be geo-located in a CIS country.  Note that this does not prove the authors are Russian.  They could be Polish, Romanian, or British, and cleverly seek to vector attention away from themselves.

[Aug. 22, 2017] - I get hit by several attempts per week to drop payloads of badcode onto my little cluster of toybox machines.  I actually had someone get thru to discussions with me using some fraud via LinkedIn.  (I am reminded of a trick by M....d operatives to get close to an Iraqi n-scientist.  They had a pretty girl in a car pull up to where he was waiting for his ride, and pretend to be interested in talking to him.  The target told his wife about it in the evening, and she immediately said "You idiot!  That was the M....d.  No woman would want to talk to you in the street like that!"  Of course, the wife was spot-on correct.

Once you even just stick your nose even a tiny bit into the darkworld, there are all manner of impressive honeytraps.  I remember once in Osaka, a pretty J-girl tried to vector me to some badplace - she just came up and started chatting me up in front of a shop window.  I even spotted her handlers across the street.  She grabbed my arm, tried to walk me away from where I was headed.  I literally had to physically remove her grip, and sprint into my client's office. 

Once you start really looking at how banking was done in the past, and is now done today, there is a *very* large rabbit-hole, once the topic of deception is engaged.   My, my, but it is large.  From the Renaissance Medici Bank, I had to check out the modern scam of the "Bank Medici", an Austrian operation which lost over $2 billion (US) in the early 2000's via the Madoff fraud.  The success of the BitCoin block-chain approach, with the public distributed-ledger concept is obvious - secrecy is pretty much always used to hide a toxic reality.   Dig further in to bank secrecy and associated modern issues, and there truly be dragons, for you sail right off the map of truth, into the blackhat world of hyperfraud.  Madoff raised money successfully, because he paid his money-raisers big fat fees, and was able to troll in cash because he promoted the lie that he had built a "Dutch Book" on the Nasdaq, using some options trickery that operated on the Index ETF's.  This was of course discovered when Harry Markopolos tried to replicate what Madoff said he was doing, and confirmed by detailed inspection, that there were insufficient trades in SPX derivatives to account for the volumes Madoff was claiming.   Markopolos tried to report this to the New York SEC, and was rebuffed, as Madoff had cultural connections with the New York regulators which appear to have offered him protection.   Nothing really changes.  I recall Markopolos wrote a 40 or 50 page paper on why Madoff's strategy could not possibly work, and submitted it to Massachusetts regulators.   What Madoff did so successfully, was to harvest funds from rich folks, ponzi-scheme style.   His large returns were paid from the funds harvested from new clients, in classic ponzi-scheme fashion.   There is a risk in any attractive high-yield investment, that you are simply being repaid with your own money, and that your principal has already been used for other purposes.  Has it been lost?  You never really know until you attempt to obtain its return.  This focus on return *of* capital, as opposed to return *on* capital, is of critical importance.   The history of the investing shows that most investments consume capital, and only rarely add to it.

In the modern world, there are new risks.  I read how earlier this month, a man of many hats (black, grey and white?). was arrested by the FBI as he attempted to return to the UK.  He is Marcus Hutchins, famous for being the white-hat (good guy) hacker that was able to shut down the "WannaCry" attack that targeted National Health Service computers in the UK.  He apparently assisted the GCHQ (the Brits version of the USA's NSA), in vectoring the WannaCry attack into a DNS sinkhole.  Details here:

What is interesting for me, is that his arrest is related to the Kronos malware.  He is alleged to have created part of it, and been involved in its deployment.  Kronos is a very impressive trojan.   It operated between 2014 and 2015, and typically installed via spam or bogus downloads.  It could lift banking information from an infected machine, and drain an online bank account successfully, if it could find any banking credentials.  Copies of the code were marketed on the darkweb.  Hutchins is alleged to have authored part of the code, but analysis of the malware in detail, suggests this is unlikely.  Not impossible, just unlikely.

And even more interesting, is the fact that GCHQ apparently knew the FBI was going to arrest him, and that he was arrested at the end of the DEF CON hacker convention in Las Vegas, as he was boarding his return flight to the UK. 

The banks assert that online banking is secure.  The Kronos trojan shows that this was absolutely *not* the case, and the FBI is probably under extreme pressure to bring a prosecution.   It would appear that deception, mis-direction and outright lies are still the stock in trade for financiers.   In Canada, we do a *very* good job at keeping our banks honest, and well capitalized.  (Hey Jeremy!  Nice work!  Don't stop. Carry on!).  But in the rest of the big bad world, this is not always the case.

For me, hacking is all about *increasing* and *enhancing* security, as unless you have *COMPLETE* access to *ALL* internals of your machine, you are simply relying upon what others have promised you - you have no real knowledge at all about whether your systems are secure and trustable, at any level.  It is what the courts call "hear-say evidence", and it is not even allowed to be entered as evidence, is it?   Same with the modern black-box products that Microsoft and Apple ask us to use.  We are fools if we take them at their word, and simply trust the assertions of others.  Only by having fully *open-source*, is there any hope of creating trustable, secure software products.

Three things come out of today's analysis:  1)  Block-chain, with it's open, visible-to-all distributed ledger (no "libro segrato"  nonsense) is probably the future of finance.   2) Hacking your own computer to obtain, at the very least, full "root access" - ie. complete access to all code that controls your financial-critical software - is necessary, in order to have any security whatsoever.   3) Secrecy, deception and obfuscation are the hallmarks of corruption, fraud and criminality.   Publically funded agencies - like the NSA, the GCHQ and our own CRE should be tasked with actively assisting open-source developers in *hardening* modern operating systems - not in exploiting discovered weakness to dropkick tracking and monitoring payloads onto everyone.  

Modern technology is at a turning point.  Since the 1920's, technology has made our world better.  The process accelerated after the Second World War, and massive economic improvements have resulted in extreme cost reductions for advanced processing ability.  But AI - the next wave of innovation -  will not be positive or beneficial, if we do not deal with the deception+fraud problem.   AI's can be misdirected by bad data. Weaponized AI may have extreme negative consequences.   It won't be "killer robots", it is more likely to be like Orwell's "1984", mass wire-tapping of all citizen information, and wars fought not with guns, but with poisoned food and water, computer-controlled bio-weapons, and social breakdown engineered by design.

We are at a point where the technology can and is being used to monitor, track, hurt, degrade and impoverish, almost as often as it is used to assist, benefit and improve the lives of people.   What history shows is that technology is always weaponized.  It is foolish to expect this process to be limited by legal statues.

There is one chance here:  Sunlight.  We can and should open-source all code and modern AI methods, so that everyone - and especially those who are technically skilled - can act as auditors and analysts, and really see what is being done.  This causes the degrees of gain from fraud, obfuscation and deception to be held down at a low level.   

This will not just keep us safer, it will also improve the operation of our markets and our financial institutions, so that the new technologies can be used to confer positive life benefits rather than higher survival costs.

For the technically curious, here is a link to a detailed assessment from Malwarebytes Labs, of the internals of the Kronos trojan.  The conclusion they reach, is that this was a product of a sophisticated development effort by a skilled software team, not the experimental work of a young lad with AS.  Either way, it looks to be impressive work, despite its criminal intent.  I've looked at this link safely with a current Firefox browser, but I do not download anything without I triple-verify the hash-code of the file.  Another good idea, is to only use email software that only processes messages as plaintext, or HTML, and cannot even be set to execute code.

If you don't read any other articles on malware or security issues this year, please read this one from malwarebytes.  I was way down the hole when I found this, and it is good.  The Kronos trogan is still in active use, still being distributed, still in operation as of August 18th, 2017.  It is now typically used to drop additional virus payloads on machines.  I had not realized the level of sophistication this stuff had reached.  The modern machine (Windows 7, 8, and 10, Firefox xx.x ) has reached a level of active integration where all sorts of automatic code is being run for everything you do.  It is just bad, bad design, from the point of view of the user who wants to have local control.   Run a modern O/S, and a modern web-browser, and you are already pwned, as you are then not even in control of your own technical environment.   

[Aug. 21, 2017] - Read with interest the details of letter sent to UN, by a group of influential tech types, asking for a ban on weaponized AI (CNBC reports: "Elon Musk joins more than 100 tech bosses calling for ban on killer robots"...  gotta love the MSM...).  I am pretty sure weaponized AI is already deployed.  Drones are already being used to launch missle attacks that have killed hundreds - possibly thousands, according to some estimates. What happens if the radio link to the Killer Drone platform is lost?  The drone operates autonomously, of couse.  So "killer robots" are already with us right now, and are being used.  Asking the UN to ban weaponized AI is like asking men to only have intimate relations with their wives.  Perhaps a noble idea, but I can't see it being effectively operationalized.

WRT the project, I am in the weeds on the data issue.  The data I need is not available to me.  And I've been studying in some detail exactly how banks operate internally - looking at both history and current data.  What an amazing learning curve.   All really useful data is either unavailable, or highly obfuscated (best example I ever saw, the financial statements from Enron Corporation, before its collapse, with the quarterly filings of Lehman Bros. coming in a close second... ).   

And if one examines history, it gets even better - the famous Medici Banking empire (1370's to 1499) explicitly kept a second (accurate) set of books, known as the "libro segreto" (literally: "book that is secret"), which kept the true (as opposed to the public) records of partnership details on various ventures, debits, credits, deposits, and true value and accounts of ventures that the bank owned a direct interest in - silk making, shipping, wool processing, the alum trade, etc.  (Alum was a critical industrial input used to de-grease wool, so fine wool textiles could be made.  One needs to realize the textile trade was the 15th century equivalent of the auto industry.)  

The Medici bank often ended up owning a big part, or even all, of a business, as it was often given to them in lieu of loan re-payment.  I am reminded of Laidlaw Inc., a failed transportation business in Canada, which ended up being owned and run by its bankers, once Laidlaw's shares fell to zero, and it defaulted on its bank loans.

Basically, what history and current events are telling me, (rubbing my nose in, really), is that public data - even today (perhaps *especially* today) -  does *not* provide the best or accurate picture of what is really happening.  So any exercise to use machine intelligence to determine what is really happening and then make a forecast, is unlikely to be successful, if it is not sourced with accurate data that drives the process.  If the data one is using is not only perturbed by randomness, but also generated *by design* to paint a false or misleading image of what the true financial and commercial state of events really is, then one's effort is better directed at obtaining the "libro segreto" information, rather than messing about with deceptive and obfuscated public material.   This is so obvious, of course, is it not?      The bottom line here, is that perhaps I am just wasting my time on this particular AI exercise.  I need - somehow - to obtain the modern equivalent of the "libro segreto", or I am just programming failure into the forecasting process.

[Aug. 15, 2017] - Revisited design, and revised.  Need a lot more data, but I am pretty sure I can make the NN-AI work *much* better.  I am missing two very key data-streams.  Surprised about how much AI talk/design is focusing on "customer experience management", as opposed to offering anything real.

A recent survey says >85% of companies want to install/acquire/utilize AI to manage customer contacts.  Of course - what org. would say that it does not want an advantage?  But be careful with AI that is focused at manipulating customers "experience".  Most customer/clients already feel so messed-over by the clever tricks coming from modern neural science and behavioural economics, that they are ready to light torches and march in parades. I'm quite serious.

Most AI will not offer *any* benefits at all to customers - it is designed to use their data, and get them to open their wallets further (viz. the awful Windows-10 experience). Most current use of AI by companies borders on toxic. What AI *can* be used for, is to augment and assist folks directly - like night-vision targeting goggles, or HUD (Head-Up Display) technology in fighter aircraft. This type of AI is controlled and used by the *customer/client* directly, and may in fact make life more difficult for dishonest, manipulative commercial and government entities.

For example:  Imagine an AI "databot" that harvests company-specific info from obscure SEC/Edgar filings, and interprets the probability of financial distress for counterparties - sort of a combo real-time shopping advisor/ stock-market investment analyst.  It could *score* a company, review past customer comments and legal case results, and give you a real-time feedback of whether you should do business with the entity.

Direct augmentation of client decision process:  This is where the real payback from AI will come - direct assistance to people's decision process, so you can make better, more profitable decisions as you navigate your day. The last thing you want to rely on is the disinfo that companies and government entities want to download on you. You don't want a bigger filter bubble - you want to use your AI to *escape* the web-of-lies that is your current filter bubble.  Who wants further limits, restrictions and programmed-direction of their analysis/search/decision efforts?  Let's see... ah, no one at all, probably, right?

[Aug. 11, 2017] - I now know what I am missing in the network - possibly a key reason why it was not predicting with much accuracy.  Of course, the dataset is very small, but I am also missing a very key data series, which is probably critical.  It will be a bit of a research project to determine how to get the data, as it is not available on the internet anywhere, as near as I can tell.

[Aug. 9, 2017 - PM] - This website has been an interesting experiment, and has let me stay focused to create ver. 1.0 of the product I want to make.   Need to scale up the dataset, and the network, and re-think how it provides its results.   I will need to spend some money on books and probably a cleaner datastream (a Bloomberg?) or something like that.  There has been some viewing of this site, but not a single lead or question of any kind, via email.  So, it looks like it is just robots and web-spiders crawling the site.  <sigh>   I found a good series of papers, from a conference in 1985:  "Maximum Entropy and Bayesian Methods in Inverse Problems".  Sadly the book is $400.  For a single book.  Blink  Faraday was lucky he worked in a bookstore.  Liebnitz had a library.  Newton had Oxbridge and the mint.  I will check out Univ. of Waterloo library, and see if they have any suggestions.

[Aug. 9, 2017] - Down another rabbit hole... Reviewed Brian Randell's 2013 presentation at the Bletchley Park Museum, on the rebuild of the Colossus I.  Amazing achievement.  As I drilled further into the characteristics of the vaccum-tube powered Colossus, searching for a copy of the Horwood Report (only hard-copies from the Archives at Kew, apparently), learned about Donald Michie, who sadly was killed in a car crash driving from Cambridge to London, 10 years ago.  He and Turing were friends at Bletchley, and Prof. Michie was one of the founders of AI research in the UK.    Michie was working on really interesting ideas, really early on.   Here is a summary from an interview he gave, which describes early efforts:

Prof. Michie's CV is still online, as is his publications list.

His obit was a full page in Nature, exactly 10 year ago, August 2007.   I should like to read several of his articles.  He and Turing really believed machine intelligence was doable.  And apparently, Turing wrote these great papers on probability as it relates to codebreaking, while at Bletchley.  It would be great to read some of this stuff. But it is so difficult to access any publications now - everything is behind paywalls, or only available to those at Universities doing research.  I think of Faraday, who had to work as a servant at the Royal Society, just to have access to a lab.   "Big Science" and "Big Government"....  Blush

Learning about war.  WWI gave us modern political and economic systems, while WWII gave us modern technology. (If I am to have any hope building my "Trading AI",  it will likely have to incorporate a Weiner filter of some kind. (Or should I call it a Weiner-Kolmogorov filter, eh?).  I remember doing the Durbin-Watson statistic calcs for some times-series stuff in economics school.  But the Weiner filter was made into a real device, and attached to gunsites and used to shoot down incoming German V1 rocket-planes (buzz-bombs, they were called).  The Weiner filter made the targeting work much better.   Levinson wrote his paper on Weiner RMS predicition in 1947, just after the war. [Levinson, N. (1947). "The Wiener RMS error criterion in filter design and prediction." J. Math. Phys., v. 25, pp. 261–278. ].  

There is this massive body of knowledge on spectral analysis and probability that has been applied to time series analysis - mostly with the hope of just predicting what the bloody thing will do as it evolves thru time.  Folks who study seismic data and astronomers looking at radio telescope data use the principal of maximum entropy and a bunch of laplace math to attempt to reconstruct a signal that has been badly corrupted with noise.  Thru tracking down Levinson and Durbin, I stumbled upon this book from 1981 - conference procedings from a University of Wyoming conference on maximum entropy deconvolution - but applied to a bunch of different fields.   Great chunks of the book are hidden - but the Google preview lets several articles thru, including the first one, which is a math-heavy (but well written) summary.  The book is called: "Maximum-Entropy and Bayesian Methods in Inverse Problems", and it is a collection of papers.    In some sense, this is what the neural network I've built is trying to do - extract a "signal", and then predict it's future value a few days hence.  And of course, this assumes there really *is* a signal.  What the network is telling me is that there is *not* a signal - it is all noise.  Is this really the truth?  Or do I just have (seriously) incomplete data?  

Do I have to go all the way back to Michie and Turing and try to build Turing's "baby machine" that can learn?   If stock-market price series are random, then successful traders are just lucky.   But the evidence says otherwise.  The "Turtles" (Richard Denis) showed that trading can be taught, like a skill.  The objective was to trend-follow, and pyramid up your position into the trend, while at the same time observing harsh capital protection rules.  I've had some success doing the opposite - playing a statistical arbitrage game, looking for extrema, and betting mean-reversion (as long as the Hurst exponent for the series suggests that the series is either random or mean-reverting).   The beauty of the NN approach, is you let the data tell the network which is the truth - and it may be both or neither, depending on various factors, which maybe the network can "see".   Or maybe, it cannot see, as the evolving process really is random.  (Which I do *not* believe it is.).     I must look deeper into the deconvolution approach using principal of maximum entropy - as selecting for maximum entropy on the input vs the output, seems to be the new, best-practice way of training a neural network.  And cleaning noise from signal has been successfully used for fixing high-noise speech transmissions, and cleaning up digital images, quite successfully.

[Aug. 8, 2017] - Well, it's official:  We go to "T+2" from the old "T+3", as of beginning of September.  Shortening the settlement cycle is overdue, but at least some action is now happening.  About bloody time.  Future comes slowly, on little cat feet.   But I keep seeing Tesla's all over town.  It's interesting, as the Tesla is pretty much the *only* concrete example of positive change I ever actually see.  I think that's why Tesla stock is so crazy valued - just because it has actually been built.  The world has been pumped up like an over-inflated beach-ball with hype, lies, fraud, horror and nonsense.  Talk is so cheap now, that is pretty much has negative value.  I use the internet more than I ever have, but I like it the least I ever have.  Is it all fraud now?   At least the Tesla is real. 

The only other cool tech that is off-the-shelf-available is the Toyota Mirai.  It is hydrogen fuel-cell electric, but we have only a few hydrogen stations in Canada, and the economics of the Mirai are awful.  It seems that unless you have a Steve Jobs, or an Elon Musk, your product ends up being a committee-built compromise with most of the real innovation effectively gated by the lawyers and accountants.  Everyone loves to talk innovation - but what gets effectively delivered is chrome + tracking software so that the product can replicate Madison Avenue + TV Networks of the 1960's.  The two great cycles of innovation were in the 1920's and the 1960's.   Other than small, cheap computers, there has been very little new created since the 1970's.  We are embedded in a growing cluster of derivatives of derivatives and enhancements of upgrades that yield no real benefits to the end-user.

I had this idea that Artificial Intelligence (AI) technology might yield a whole new class of products.   But I also realize that this might not happen.   It might just be weaponized, and used to amplify and enhance the human capacity for control and cruelty.  As Colin James so eloquently put it: "There's only three things worth of living for and that's
Chicks, and Cars and the Third World War...".  The thing about a big war, is that it drives change.  Real change, not fake change.  The First World War re-programmed Europe, destroying all the monarchy-states, and replacing them with democratic political models. These did not work well, as there was no tradition of democracy in Europe.  But WW1 made the changes happen, and re-drew the maps.  And eventually, democracy won out, because it is better for society to fight using ballot-boxes, than in the streets, using clubs, knives, firebombs and guns.

Almost all the practical scientific products we use came out of warfare and conflict.  The slide rule was invented by Napolean's guys to aim their cannon quicker (the guy who gets the math right first, blows up his advisary first), and it was the British in Bletchley Park breaking code, and the US Navy enhancing their aiming calculators, that built the first electronic computers.  The First World War took the automobile from a quaint "horse-less" carriage to a heavy-truck for troop and material transport.  The airplane morphed from a motorized kite built of wires, wood and fabric, into a lethal heavy bomber and a high-powered flying machine gun.  Chemistry advanced quickly to create industrial-level chemical weapons, and radio changed from being sputtering sparks on a ship, to an electronic device powered by vaccum tubes allowing for remote command and control.  The technical jump brought battlefield death-levels into the hundreds of thousands, and the massive improvement in global transport allowed the "Spanish Flu" to migrate rapidly around the world, killing between 50 and 100 million people after the war ended.  It was the First World War that created the modern world, scientifically, economically, and politically.

If AI is to have the impact that some think it will have, is it not also likely to be weaponized, and used to destroy the enemy (and their cities) more effectively?  I have trouble coming up with a scenario where this will *not* happen.

[Aug. 7, 2017] - Folks nowadays have short memories.  The "fake-bad-data" issue I mentioned in previous note offered the LIBOR rate-rigging scandal as an example of deliberately corrupted critical market-data.  I note tonite with interest that Citigroup has agreed to pay $130 million US-dollars to settle a private lawsuit brought by LIBOR-users - fund and investment managers such as City of Baltimore and Yale University.    


Memo to the market-makers:  Please guys, keep your data clean and your noses will follow.  Better for everyone to have accurate data, and cheaper for you to run your business!  Big Grin

[Aug, 4, 2017] - Reviewed a bunch of stuff on the internet re. AI.  Lots of hype and nonsense, but some good stuff also. (A lecture on pathfinding and dithering in games, using vector dot-products and such, and the Djikstra algo and A* and such to do searching was useful.  My world is not 2D, but the concepts generalize...).  Also, watched a Sloan lecture from Stanford by Andrew Ng, one of the big names in AI, very good, interesting and useful, despite it being more for GSB types. URL:

He had some useful insights on the data problem.  Data is the key - and with HPC (high performance computing), lots and lots of data can be given to NN-AI's now, and the HPC approach allows improvements to go beyond the previous thresholds where the supervised learning reached its limit.   I've already spec'ed out a bigger network, more layers, using lots more data.  

Andrew Ng's lecture was very good, but he did not talk about Fintech.  What is not mentioned in Fintech AI apps, is just how much motivation there is for *deliberately* corrupting up the data, to present a market picture that is false.  (Imagine the self-driving car having not just to deal with trucks and people jumping into its path - but actually deal with other cars that have been programmed to *try* to hit you!)  That is one of the factors the market-oriented AI has to deal with.  The trickery played by London-based traders re. the LIBOR rate-rigging, and the fiddling of the gold price fixings are examples of data-tweaking.   There is lots of data - but has it been fiddled to create an advantage for data-generator?  Lots of time the answer to that question is simply "Well, sure, yes, of course. Absolutely!". 

This "facked data" issue, (as in the Irish expression: "Oh, Fack!) is one of the biggest problems AI faces in the real world.  The entire so-called "financial crisis" of 2008-2009 resulted from fiddled appraisal values on residential homes in the USA, and faked income data on the part of the buyers, which let them qualify for massive mortgages they had no hope of ever paying down.  And then the MBS-makers on Wall Street further generated fake-data on the risks their institutions were taking on, by faking up their risk-models to show *vastly* lower risk than was the case.  And this "bad model" problem meant that the fundamental economic data of the banks and other agencies (ie. Fanny Mae and Freddie Mac) were bogus, bad and false.

If your deep-learning AI is trained on this fake data, its results will not just be wrong, they may in fact, be quite pathological.  If the AI's results are relied upon, and enter into an automated action-process, the outcome may be *massively* destructive to economic value.  I'm reminded of an old adage: "To err is human.  But if you want your error to create a major disaster, use a computer." 

The Stock-Broker's "Conduct and Practices Handbook" says you should not collude with other traders to "high-close" your stock, even if you are the market-maker.  But "banging the close" (to uplift the close price to artificial levels) is an obvious strategy, which benefits so many players that it cannot really be prevented.  It is stat-arbitrage that limits this trick, not the market policemen.

Reverse-engineering the other guy's trading algo (by watching when and where he places his trades), and then having your algo trade against his trades is a well understood strategy, and has the added benefit of not being illegal.  Trading algorithm design is probably a better approach to take, rather than trying to predict anything.  I'm probably better to just lash-up some heurisitc response based on the NN's output, rather than trying to say anything about what the world will look like 5 days forward.  This approach is different, and probably requires that there be re-enforcement built into the process.  The network learns and gets smarter and generates profit, as new data is created.  The obvious problem with this, however, is that you get the "nickels in front of the steamroller" problem... Your algo runs fine, until it makes one error which compounds, and you find yourself on the wrong side of a run with a leverage-magnified position that is going wrong at an increasing rate.  (This is what did in the very bright boys of Long Term Capital Management, for example. And many others, to numerous to mention...)  Shocked

Another thing Prof. Ng avoided speaking of, was the use of AI's by government agencies to carry out mass-monitoring of citizen activities to very effectively limit political communication and political activity.  No one seems to be talking much about AI tech in this task of mass data-collecting and content-monitoring.  The AI's watching the communications grid can extract meaning from text and detect patterns in the linkage metadata, and zero in on folks to shutdown for speaking about the need for political change, and the requirements of human freedom.  This just happened in China.  Suppose you simply communicate a statement such as: "The Chinese Communist Party is an anti-democratic, illegal political entity that has usurped control of the Chinese State by force.  It has no mandate from the people to govern China, anymore than a group of criminal gangsters has.  In fact, its actions are very similar to gangsters, and its cruel repression of non-violent dissidents and political activists who argue for freedom, is deeply wrong, and culpable." 

The act of simply communicating such a statement as above, could earn you a jail-sentance in China.  And a good AI, (assuming you are foolishly communicating in plain-text), should be able to recognize the "political" nature of such a statement, and indentify who was the sender and the receiver.  Apple was forced to remove its VPN (virtual private network) products from the iStore in China, so the Chinese AI's that are already monitoring the internet in China, can continue to function effectively.

Those who choose to keep silent on this particular threat posed by AI technology, are not being honest.  There is zero risk that "evil AI's" will take over the world, or attack humanity.  That is pure nonsense - Hollywood fiction.  But there is real risk that AI technology - particularly the illegal mass-wiretapping technology already in operation - will be used by humans to hurt, punish and subjugate other humans.  That is the real risk.  VPN's and encryption technology are vital to the future of human freedom, otherwise we all run the risk of ending up like 2010 Nobel Peace Prize winner Liu Xiaobo - rotting in a government prison for speaking our minds, until our deaths can be engineered.  Not a nice outcome. 

We should use the new AI technology to help people, and engineer positive outcomes that enhance human freedom and expand opportunities.  And we must all work to prevent AI technology from becoming yet another instrument of social repression, and an amplifier of human cruelty.

[August 3, 2017] - Researching non-neural-net approaches to AI.. pathfinding, graph-theory, and more annoying gamestuff. (I don't like computer games.  Reality is much more fun.)  

Anyway, we finally are having summer-like weather, and the hot days here are lovely.  I have about 25 ideas to improve the NN-AI's operation - but most involve sourcing more data, which is looking difficult.  May have to buy a data-feed, as way too much on the internet is either fake, wrong, broken or deliberately obfuscated.

Did a weird thing.  Bought a new Windows-10 laptop, and hacked about with it to make it look sane, and be useable.  What an unbelievably difficult and annoying exercise!   The little machine came with "Windows-10 Home Edition", a deliberately crippled product (no GPedit.msc, for example), but via numerous registry hacks, and by turning off most of the Microsoft junk (does anyone anywhere actually want "Cortana"?), it is almost usable. (The "right click" feature on the "Start" icon in bottom left corner, (gets a sane menu for access Windows features, instead of the hyper-stupid "tiles" crap)  and the WIn+R option to bring up a "run" box (type in "regedit.exe" for example) really helps.  Managed to get original Excel and MS-Word installed, but it took *days* just to get the thing to operate in a sane manner.  If I get time, I will document what I did.  (Eg: Used "icacls" cmd to remove restrictions on the WindowsApps directory, so I could seen exactly what bloatware and other gunk was pre-installed).  I made extensive use of Google search.  (Everyone everywhere has had the same problems, and a lot of doc exists online about how to correct the damage Microsoft has done to their old Windows-NT product.)   Modern hardware is nice, but the commercial software is comically awful, and seems to be locked into a strange death-spiral of "kick the customer" madness... but perhaps that is just because I've seen better, and done many things  (like the old Queen song by Freddie Mercury - "I had a million dinners brought to me on silver trays...."  In my case, maybe "I've had a million problems brought to me... Consulting pays!" ).  Windows-10 reminds me of using datacenter-restricted IBM 370's running MVS, from the ancient awful mainframe world I first encountered as a tiny child.  We seem to have come full circle.

FInally got the little laptop working nicely, and our spreadsheet expert shut it down, except it has now spent over half-an-hour saying "Preparing Windows - Do not turn off the Computer", which means we are getting "updated", (again - it just did *all* its updates yesterday!), and this despite me turning off the "Windows Update" service using services.msc.  (Note: Later, I rebooted, and confirmed "Windows Update" has been turned on again, so even if using the Administrator account, Windows-10 does *not* honour the configuration setting in "Services" menu.)  FF-sakes guys.  A computer that does not honour its admin-set configuration settings is a broken machine.  Or it is a *corrupted* machine.  Why does Microsoft *hate* its customers so much???  I can't figure out why the whole Windows experience has been made so amazingly toxic and awful.  Is there an internal faction working to destroy Microsoft from within the company???  Sure looks like it. Big Grin  At least we got our expenditure and FX spreadsheets working again.  (for now...)

[July 27-28, 2017] - I'm down a rabbit-hole on Bayesian inference. The current Wikipedia page on this topic is not bad:  (until it changes...)   Also had lunch with a bright guy who suggested training the network to a specific probability, rather than just attempting to forecast a signed boolean.  And of course, there are a multitude of reasons why it (the NN-AI) is not working, with insufficent data being an obvious one. I am seeking to do the undoable, I suspect, and have to consider that a) my early work at Treasury, where we looked at numerous forecasting techniques formally, and never found any ability to forecast that improved upon the null-forecast (it will be in future, what it is today)  and b) this failure of the NN-AI to make accurate predictions => implies a high probability that there simply is insufficient data in the input stream to generate the outputs I have trained the net to see - ie. the direction of 4-day ahead significant (ie. greater than 1%) price change in a specific target price series.  

Knowing past price series and interest rates does not seem to let one improve upon chance when it comes to even getting a sense of future direction of price.   Why then can I do it by "gut feel"?   I've found if you watch and review everything, for years, and do so each day with care in how you observe, and limit your focus to a single, or a very few, target series, one seems to be able to train one's "necktop" neural net, to be able to make profitable bets on future outcomes - at least better than is possible by chance.   I wouldn't be here, writing this, and still able to pay my bills, if this were not true.   I also have a trivial simulator, that uses some really simple decision rules, that has long runs of losing trades, but manages to capture big moves, and continues to make money.  It annoys me that I see these results.   I believe we have entered a dangerous "new era" again, where advanced AI techniques are being used by the pros, and this is making for a very dangerous market where *everyone* will rush to the same side of the boat, at exactly the same time - provoking a monumental and rapid valuation re-adjustment (a warp-speed flash-crash perhaps).   Two things: just because I cannot derive an *edge* here, using the NN and boolean jumps, this does not mean that others have not.  (I believe others have, since I see the tripwires getting hit, and the very rapid reversals now all the time), and second: I've always been uncomfortable with the "frequentist" approach to probability (but I still use it), and Bayesian updating also just seems wrong. But it probably is not - we really have no choice, if we are to operate without certainty.   (I was reviewing the "Dutch Book" argument, or can you really create a "lock"?, and have just discovered the works of Ian Hacking (what a great name this man has! If you google for "bayesian inference Hacking"... well, you get my point). 

I've had failures and I've had successes - and in trying to do an objective analysis about what differentiates them, it seems the successes  were based on an ability to sense the course of future events, and then to have taken action.  (The failures involve mostly seeing the future event-space also quite clearly, but *failing* to take action, and then just watching my "movie-of-what-will-happen" that I saw in my mind, play out in reality, but without me having a position on.)  And sure, some of time I am just stupid wrong - but then I reverse - but never quick enough.  My worst errors are from listening to comments or beliefs of others, or from betting too big when I was really young and stupid (as opposed to now, where I am apparently old and stupid... :).   

Perhaps one has to move completely away from any attempt to "forecast" or "predict" the future, and just build a machine that is driven by the data-vectors of current events (those great 500mb Hadoop dataset chunks that Spark uses?), and makes immediate decisions which are then rapidly updated using a Bayesian approach, and a new probability is generated, which drives the next revision, which steps you forward from beginning of day to end of day.   To me, the way prices move now appears to be pathelogical.   Trading and investing seem to have taken on a rather toxic nature - and I attribute this to the fact that something like 70 to 80% of all transactions now in the major markets are machine-driven trades.   If a naive human trader participates, he is almost certain to lose now, as the market will run to his "puke point",  and take out his trade, no matter how he crafts his position.   This ugly behaviour of the equity markets is part of the reason that extremely low yields are accepted in the bond market.  See, something changed last year.  I can't put my finger on exactly what - but part of the post-Trump run, was due to this, not related to Trump at all.  

My sense is, that for the risk you take on holding equities, each of us should be getting *a LOT MORE* dividend yield than is currently the case.  And the market has a way of adjusting this parameter.  It just downfalls 20 or 30%, and then the dividend yields become attractive again.  What is interesting, is just how not-very-good, dividends are at characterizing the attractiveess of equity investments.   They are almost viewed as a badge-of-shame, indicating a mature, not-growing-much business that is unattractive, and I think that is wrong.  A good business makes money, and a good investment has a nice fat yield.  These crazy times of high-rates of technological change, are not normal.   And much of the change now, is not very good, and is not very nice.  When the printing press made books cheap, that was really great.  When the railways and steamships defeated time and space, that was just wonderful, and when the A/C electric grid was introduced, it made everyone's lives much better.  But now, the modern tech is just used to jerk people around, and take their money without really offering them much in return.   Modern technology just seems to be about creating the illusion of value, rather than actually offering anything that it better or more helpful.  Facebook destroys face-to-face human relationships, Amazon ends the existence of your local merchant's storefronts, and Google harvests all your data on everything you do, so it can end-run Madison Avenue, and assist the NSA in their illegal mass-wiretapping exercise to monitor and control civilian activity.   None of this technology is really very helpful to people, and none of these companies pay dividends - the attractive and economically useful way of returning investment profits back into the economy to be used to drive further business activity.  The smartphones are fun - but they further degrade face-to-face human interaction, and also seem to be creating an unhealthy culture of dependence.  The best phone I ever had, was a little Sony-Ericsson flip-phone.  When it broke, I replaced it with a very cool and slick Huawei running Android 6, but I really miss the little Sony phone. (FD: I also have a very nice Samsung Galaxy, which is small, and runs Kitkat, that last really good Android O/S).  But the Sony phone was better and nicer to use, in so many ways, that it is really rather funny.  Yet the world is hooked now on these annoying flat-screen things that function rather badly as communication handsets, and yet are too small to be nice tablets, or proper computer, despite the power they have.   And I just read a few days ago, about a company which offered to put security microchips surgically into peoples hands, to make it easier for them to move about the offices and buy food in the cafeterias.  The employees apparently have enthusiastically agreed to this.  What can I say?  "Get off my lawn"? Cool

[July 25, 2017] - Picture above shows Network Evaluation results for May 18 to July 21 period.  The neural-network cannot predict with any useful accuracy - results are basically slightly worse than random.  The little Tcl/Tk evaluation program is provided in the "Code" section.  I believe the NN-AI approach is useful and effective, and what it has shown here, is that there is not sufficient information in the data to forecast even the direction of change 4 days hence.  This actually confirms what myself and others discovered in a project done for a Government Treasury operation, back in the 1980's.   Reviews and analytic efforts directed at current data-series are of no value in predicting near-future price levels in an active marketplace, and it is not even possible to catch turning-points or the direction of future changes.  It seems it is only by possessing specific, market-moving information, ahead of other market participants, that any "edge" can be obtained.  (Of course, if you can see the order flow come in, and act before these orders hit the market, that is essentially the same thing as acting with prior-knowledge.)  What is interesting, is that the "null forecast" (ie. "It will be tomorrow, what it has been today"), always beats any active attempt to forecast.  I thought this might be different here, but for now, no joy.

Also, doing a crash course on Apache Spark (with side-detours into Scala and Hadoop).  Can't believe this stuff. Worse than TensorFlow - which looks great, but is runnable only after downloading and installing terabytes of related Java, Python and other such material.  Looked at some OpenText stuff which uses Apache Spark.  The code-bloat here is just off the scale.  Dig deep into the stuff, and you get down to JDK, SQL and R like everything else.  This is the same gunk that hasn't changed in years.   I've been considering calling this a wrap, shutting down the website, and going back to just making money by some really traditional methods that have always worked for me.  AI and machine learning seem to have a dangerously high bullshyte component (to use Neil S.'s great word from Anathem).  I know AI can work, but it's all about recognition, and hammering away with machine-clusters on great "data-lakes" of unstructured material, is not going to make anyone but the regulators and the software merchants, any money.  OpenText seems to have the right idea, in that they use Spark to sift thru gobs of crap-data that companies create that can leak PII (personally identifiable information) out into the public space (think SIN's, credit-card #'s, etc.), and help stop this leakage so the company does not get f**ked over by new European data privacy laws.   But a lot of the other AI promises look to be nonsense.  The data has to be structured (and clean!) if it is to be of any use.  (That's why AI only really works in games, where reality can be tightly bounded so that Talib's "ludic fallacy" can be realized).  But what I have learned from this project is that I need a lot more data, before I have any real chance to make accurate forecasts.   And I've also realized that I can code (into booleans) a whole lot more than just price-changes.  If you believe in "efficient markets", then everything should already be in the price - and so price change should be enough to get a good handle on the future.  But all the research shows that markets are not even close to efficient - and it is in the nature of the inefficiences that the money resides.  BMO just completed a 4 million share repurchase effort, with shares repurchased for cancellation.   Nice move.  Be a nice trade to step in front of, no?  But I only hear about it by reading the newswires after it has been completed.  "Information" is not homogenous - most info is useless blather and flatulent noise - but some is, or can be, critically useful.   Get that data, code it up as boolean strings, feed it to the NN for training, and your AI might be able to become smart enough to make a difference to your results. 

I posted the tiny Tck/Tk program into the "Code" section, that is used to evaluate the boolean table generated by the network.  (Creates the evaluation table shown above).  It calculates a simple "co-efficient of accuracy" by just counting evaluation training cases where the network got the forecast correct.  It counts anything less than or equal to absolute value of .8 as a zero. (The network has to provide an output value less or greater than .8 to have it counted as a minus one or plus one.  The three possible target values are -1, 0 or +1, so any result in the -.8 to +.8 range gets counted as a zero.  The co-efficient of accuracy is running around 23 to 27 percent, so I conclude the network is just not able to forecast at all.  What is interesting, is that if I forget to load the weights, and run the evaluation on a random network (where the network node weights are all just random values), the co-efficient of accuracy jumps to around 65% typically, as most of the forecast target values are zero, and most of the random-produced output values fall within the -.8 to +.8 "evaluate as a zero" range.  I think this is absolutely hilarious.  My trained AI only gets it right 1/4 of the time - but the "null forecast" (ie. nothing really changes - or any change is less than 1%) is evident about 2/3rd of the time!  This result jives exactly with previous research I did for a government department years ago.  We found the "null forecast" (ie. it will be in the future, what it is now), *always* beat any forecast provided by professional forecasters and economic soothsayers.  This is actually pretty interesting.    I have a suspicion that there might be something actionable here using Baysian probabilities, if I could just improve the network forecast to getting it right 40 to 45% of the time - still less than half, which would seem to provide no edge at all.  But if you know that 2/3rd's of the time, there will be no significant change, when you do get an indication of an expected price jump, if the costs and payoffs of the bet are sufficiently asymetric, it still might work over time to make a bit of money. 

[July 24, 2017] - I updated the data, generated the boolean-impulse casefile, ran the neural-net model, and looked at the forecast vs actuals for last couple of weeks.  The network just does not predict well. What does work, looks to be serial-autocorrelation strategies.  The target trends quite strongly.

[July 20, 2017] - Interestingly, the inability of the trained network to make accurate predictions for the 5-day ahead point in time is almost certainly due to the fact that there is not sufficient information in each training case, to make such a prediction. In other words, even the direction of change in the near future, cannot be known with any accuracy.  This is useful information.  It tells us that if we are to have investment success, we must target time-frames where we can effectively use current information to advantage.  That may well mean time-frames of hours and minutes, (we know that works) or months and years (Graham and Dodd show how that can work, too).  Throughout this exercise, I remained in a long position on the target security, which is now today trading at 109.47/shr.  Much of the percentage price improvement (which was not caught by the network), is the result of a recognition that a confluence of factors is at work - the improving position of the commodity-driven Cdn dollar (oil and gold cannot and will not stay cheap forever),  the slow but inevitable rise in the general level of interest rates (the recent quarter-point increase in the Bank of Canada rate is certainly only the beginning of the process of rate normalization), and the various fundamental indications that the valuation of our target security, (against baseline financial ratio metrics, as well as its peers), remains attractive.  With an attractive payout ratio above 40%, and a dividend rate that remains close to 5%, and a long historical dataset of dividend consistency, it is not difficult for an objective analyst to put a target price of $140 to $150 per share (Cdn$) on the target.  

I have a better understanding of why the "robot" selected portfolios are so attractive now to investment professionals.  In the same way that neural-networks can always "see" the image if it is in fact see-able by humans, it is probably true this technology - when applied to datasets that actually contain sufficient information to make an effective selection, and over a sufficient time-frame, will achieve accurate recognition, and make profitable choices. 

What this means in practice, is that I need to lengthen the time-frame significantly, and broaden the scope of the data to include fundamental information on market tone and target financial characteristics.  The 5-day time range is basically all noise - if you train to noise, you cannot get anything meaningful as a prediction.  But if you look out several years, and train your network to select for characteristics that are known (and must) have significant effect on ultimate target price, then you will almost certainly substantially enhance the network's effectiveness.  I am also pretty sure you can *shrink* the time-frame down to minutes, and basically have the network trade the order flow - and profit from essentially scalping the bid and offer range.  This is how the old floor traders made their livings - a few ticks on each trade, based on their reading of the marketplace.  Many reports suggest, for example, that just the volume-level of shouting in the room was a useful and actionable indicator.  One needs very high-speed tick-by-tick data, and the ability to execute rapidly, to even begin to test these sorts of network-driven strategies (the so-called "flash" trading models), and there is a lot of evidence that *many* groups are already doing this effectively.

From this work, I am now of the opinion that it is only by trading over multi-year time-frames, that the average, non-professional investor can significantly profit in modern securities markets.   The very-short-term remains the domain of the very well funded professionals, who have access to substantial capital and advanced-technology linkages, while the multi-year timeframe provides the non-professional investor real opportunity for investment success - if investment selections are made wisely, and monitored carefully.  The intermediate ranges - weeks to months - seem to be characterized by what I term "reactive noise", where occasionlly statistical arbitrage is possible, but catching the weeks-to-months intermediate market swings remains a process which is characterized by a high "noise" component, which makes predictability difficult.    What this means in practice is that if you are swing-trading and trying to catch local ups and downs, you are unlikely to make money over time, and in fact, run a high risk of being knocked out of an attractive position, at the worst possible time. 

Bottom line: The neural-network generated several sell-signals, but I elected to remain fully-invested (for reasons indicated above), as the target security advanced from the 104+ level to the 109+ level where it trades today.  On a 2300 share position, this $5/shr move has generated an $11,500 gain, over the evaluation period covered by the experiment.  Should the valuation of the target security move closer to it's peers (particularly it's US-based peers), then substantial price improvement would seem to be possible.  Given that the company in question has made a signifincant US-acquisition, it is not unreasonable that the market may, over time, assign a valuation to the target that aligns closer to its US peers.

[July 15, 2017] - The current experiment to use boolean delta-jumps as a predictive strategy has not yielded a particularly effective forecasting tool, but it does allow one to characterize the market, based on a particular picture-of-the-world that has prevailed, and as such, it provides a formal instrumentation of the current market situation. The formalism and methodology are sound, and an enhanced dataset (more than just 6 data series) can be expected to yield better, more fine-grained results. What I've done here is to develop a working proof-of-concept neural-network based AI product, which can provide market characterization, base on choices that can be made by each client. It's possible for a taylored, custom AI product to be quickly designed and implemented, specific to the views of a single client, which would incorporate a client-specific data selection. As we know, the major investors in New York are already doing this, and I believe the opportunity now exists for smaller firms and individuals to deploy AI methods. I suspect this may even up things for investors, and that a more level field will make a fairer and more effective market for everyone.

[July 12, 2017] - Formal evaluation of results:  Two networks were trained on 4361 cases, where each case was a 30 element signed boolean vector, derived by looking at price jumps of several different securities and commodities, training to a price jump in a target security 5 days hence.  Nets are V2 and V5.  On training data (the 4361 observations),  Net_V2 got 3893 out of 4361 cases correct (= .892685), Net_V5 got 3849/4361 => coefficient of accuracy of 0,882596.  Net_v2 seems to be the best network so far.   (Coefficient of accuracy on training data: 89.3% versus 88.3% for net_v5).  On the evaluation cases, so far, the networks are not performing well.  Their results appear to be worse than what could be expected from randomness.  On the data from May 11 to July 11, Net_v2 is posting 9/34 accurate forecasts, and Net_v5 is posting 7/34 accurate forecasts.  (Coefficients of accuracy: 0.2647 for Net_v2, versus 0.2058 for Net_v5).  I suspect the issue is that the boolean price jump data being used to train the networks does not contain sufficient information to know what the target price jump will be in week,  If a linkage could be established, I suspect the network training would have found such a relationship.  But what these results suggest is that knowing the price jump history for several days back, and across several different price series, is not sufficient to predict a future price jump - even if that future is only 5 days hence.   It suggests we need more data, across a greater number of independent components, if we are to have a better than even chance of predicting future price jumps.  A nice methodology, but no "edge" for now.

[July 8-9, 2017] - rebuilt Xerion completely on a Linux laptop from source, kept notes this time. The original build was experimental, and back in mid-March on AI box, and I did not keep notes.  You need the varargs.h file, and each of the "configure" files need to be fixed (they report syntax errors that suggest tcl.h and uts.h includes are not being found).  The fonts.dir file in the /usr/share/X11/fonts/100dpi directory has to be altered, so the "-adobe-courier-bold...70..."
 font can be found when the "bp-wish" program, in xerion/tkbp-4.1p2, is run (it brings up the Xerion gui screen).   You edit an existing reference of "-adobe-courier-bold .... 90..." to become: "-adobe-courier ...70 ..." (literally change the "90" to a "70").  This does not seem to impair any existing apps, and allows Xerion to pop up it's window, assuming you are running an X11 desktop of some kind.  Also, before trying to build Xerion components, you need to build and install tcl7.3 and its associated tk3.6, itcl extensions and tclX, all four of which are provided in the UofToronto's Xerion source tarballs.  Successfully built tcl/tk, and Xerion and its components and associated utilities on Fedora Linux laptop.   (See site top image which shows Xerion running on a Linux laptop & training against the initial boolean dataset.)

[July 7, 2017] - Last two days, retrained a different network on same 4361 observation dataset, where each day is a 30 element jump-delta vector from various market prices.  Interestingly, despite having the sumsquare error driven down to roughly same reported level (318 for V3 network, versus the 311 for the V2 network (from starting error level of typically around 3000),  Network V2 - the production version under active evaluation appears to do a better job.  The V3 network provides remarkably different results for the May 11 to July6th test range versus the V2 net.  The orginal V2 net seems to be much better in that it seems to be more accurate in its forecasts.  (V1 first network was not good - so original is V2, newer trained version is V3).  Montage of both results from "compareMarketNet" is shown in last screen display of "Code" section.

[July 6, 2017] - (Afternoon) Updated the "Code" section, to provide the tcl code that creates the example network I have been using, and loads the training cases, and shows how the iPad can be used to take the Xerion network weights and structure, and run boolean jump-delta vectors made from market price data, right on the iPad to get a go-nogo trading decision information.  This now provides a working prototype of a neural-network driven portable AI that can be built and trained using a large amount of real market data, but run on an iPad in real time, to provide immediate, actionable market decision suggestions. 

[July 6, 2017] - Experimenting with different back-prop methods (conjugate gradient, delta-bar-delta, momentum descent...) and different step-methods (fixed step with various epsilons, line search, slop search) to see which gives smallest error.  I'm interesting in interpreting the net's output as a gaussian that I can use for result-evaluation, and still not sure best way to do this.  The day-to-day results appear to be good enough to trade with, and it looks like this approach is offering a small, but viable edge.  This is key.    Oh, also a big tech result:  I downloaded newer versions of gtk, gdk, and glib, and compiled and built everything from source, on three older Linux platforms (two laptops and the AI box - need modern Firefox to find data...). Then, I downloaded the Firefox that is current for CentOS 6.6, which is Firefox-34.  Once you have Ffox v34 running, you can access modern JSON websites and such, and also jump to version 44, using the FIrefox upgrader.  Here is an interesting caveat.  Despite running a "./configure, make, make install" on the glib and gtk+2 sources, the rpm (package manager) was still reporting the old versions, and my binary-only version of Firefox34 would not load (error was: gtk_widget_set_can_focus symbol not found).  The solution was simple, and I stumbled upon it myself because I am stubborn, and confirmed that the gtk_widget stuff was being compiled.  Just nav to the dir where you ran the gtk compile, and run "ldconfig" to let Firefox find the libraries at runtime.     Modern Linux has dynamic libs (they load at run time), so even using yum to update "xulrunner" and "nprs" did not get the Firefox binaries running.
Oh, and this is critical: Compile your new glib first (I used an older glib ver. 2.26.1), and after the "make install" step, run "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" and then run your  "/sbin/ldconfig" to configure the dynamic linker runtime bindings for the graphics stuff, otherwise the ./configure step for the gtk+2 stuff will not run.  Can't remember where I found that, maybe on a StackOverflow post?  The default glib install puts the glib libs in /usr/local/lib (which is probably what you want to do, so as not to degrade your production gnome desktops..  Yes, this is a tad kludgy, but my stuff all just works.

[June 30, 2017] - Results for network run pre-market are another +1, so we now have three positive boolean one's in a row.  Market tone is weak and soft.  Target price was up, then down, in choppy action.  Network says to buy now, clear strong signal, three +1's in a row.   See the first image in "Economics-2017" to see output screen.  I also show the full Hinton Diagram as generated by Xerion display utility, for case June 29, 2017, the most recent observation.  The single white square on top in "Unit: Output" is the +1 boolean target value.  Minus one is a pure black square, and a near grey square is a zero.  Note the inputs and network output are signed booleans, ( "trinary data" ), but the internal network values can vary between -1 and +1, as shown by the Hinton Diagrams in the middle row of boxes in "Unit: Output".

[June 28, 2017] - Sourced the data, built boolean table, ran the network.  It toggled...negative to positive output, from -1.0 to .9996895.  So, that means price upshifts?  Price delta of target is already +0.82 of a dollar, by 9:39AM as I write this.  SInce I am only using retail-level trading software, I have zero chance of even putting on a position. Price will probably retrace.  But the methodology seems curiously solid, and with proper software, there might be opportunity here.   [1:30pm update]  Tweaked the AI box, and got everything working there, including Probablility Calculator and other modules, which can be driven from .PTB format data written by TSM.  Linkages between packages are file-based, but *everything* can now run on Linux.  Currently using older Fedora kernel, but CentOS 6.6 and 7.x look like they work ok with everything.  Wine compiled and installed fine on all machines, and TSM and MAKECASE run fine on my CentOS 6.6 testbed. Updated top picture, showing AI box running Xerion with Hinton Diagrams of unit values for June 27, 2017 datacase, TSM and a data-driven OHLC price-chart of target, cmd-line Xerion "bp->", running the GNUplot display of NN actual vs. predicted, and the Probability Calculator, (running in a DOSbox) which also provides risk-driven recommendation for position size.  The same module which runs the Prob. Calc, also calculates Hurst exponents, and a series of moving-average market characterizations and related graphic displays.  Having it all running on one platform makes data-management much easier and allows results to be obtained faster.

[June 26, 2017] - Determined I had a bug in last-date processing of raw price numbers into boolean data, and built a fix.  This gave me a proper result for Friday - one more data record on "tcasetab.txt" boolean exampleSet file.  The correct network output for most recent data (Friday, June 23rd)  was -0.999966, (Thursday was -0.533085) and I expected this only to flag the shift in price resulting from target going ex-dividend, but it seems the network did better, and caught a serious >1% downtick in market price, from the 106.11 level to 104.90 range, by noon on Monday, June 26th.  This could all just be randomness, of course I realize, but this technical approach is showing surprising, unambiguous ability to forecast future market price direction. 

[June 25, 2017] - Latest results, with data to June 23, 2017.   The network under test is a trivially small neural-network model, but the results are interesting.  See the "Economics-2017" section.  Target security goes ex-dividend tomorrow by 1.27, so we know open price will be 106.11, ceteris paribus, and will be down enough to trip a boolean in the jump-delta MAKECASE table.

[June 22, 2017] - The NN-AI (Neural-Network based Artificial Intelligence) device described here, looks as though it might be useful.  This page has become too long, so I put some of today's preliminary results in the "Economics-2017" section.

[June 19, 2017] - Put MAKECASEBOOL program inside of Linux version of my Time Series Manager (with it's nice Window's GUI), and built a bunch of little modal window routines to make it work as a full graphic user interface (GUI).  This makes it easy and quick to generate a boolean jump-delta table, and hand it over to Xerion, to have the network run against it.  Also, built (yet again!) an entire new data-sourcing subsystem, to merge/load yet another completely different data source into the TSM database, so that my time series data can stay current.   Information suppliers seem to change their formats every few months now.   The Lynx browser is used to pull data from various internet sources, while .csv format files can be downloaded from sources such as the St. Louis Federal Reserve.   Putting everything into a stable data management product (my custom-built TSM, in my case), and ensuring that the data is accurate, is the first, and most critical step in any data-driven research and analysis exercise.  Many research efforts and analytic toolsets use SQL variants to maintain time-indexed data, but SQL does not lend itself to maintaining and manipulating time-series data very well.  My TSM thing lets time-indexed tables and vectors be manipulated as single entities, and so lends itself to facilitating the training-dataset construction that NN-based machine learning requires as a starting point. Cool

[June 17, 2017] - Got Lynx Browser running - WITH OpenSSL (needed for "https:" pages, of course) - on Linux boxes *AND* natively, on the iPad (?! yes, really. Ran the configure and the make right on the iPad, and built a working, SSL-enabled Web-browser right on the tablet itself, no awful glop-bucket of Eclipse or Apple dev-goo with timebombs in it... Big Grin{#smileys123.tonqueout})  Lynx works pretty good, and will be useful (see the top line "GNUgcc & Lynx Browser" for details.  Also, re-wrote all the data-get routines in Time Series Manager, so I can get data again, and slotted in the stub for the boolean delta-jump table-builder, called MAKECASE.  Just need build into TSM some nice modal boxes to pick up the boolean table-build parms, and I have a cobbled-togther, hacketty-hacked (but real, and actionable!) prototype AI product. 

[June 15, 2017] - Massive powerfail at the lab.. A large tree fell on our powerline, snapped a power pole as the wires broke, and we went dark.  Within an hour, I had our electrics guy here with a new pole, and a utility crew removing+replacing the blown transformer by the garage.  (This actually happened on Monday, the 11th.)   All recovered within one day, but got me thinking about disasters.  Here is another:  Reading about Intel ME, and the "Silent Bob is Silent" exploit.  Bad stuff already in the wild, being used, it appears.  Two of my boxes have Intel ME, and today, I shutdown, and then re-booted a *powered off* machine, from the hacked iPad, via only WiFi access, just using Safari browser on the iPad logging into to port 16992 on a Win7 box.  The Intel AMT software is firmware, running on an ARC chip on the motherboard, and runs completely seperate from whatever software you have put as your O/S on the box.  Folks have disassembled Intel AMT, and the "Silent Bob" exploit lets you login and access the Intel-ME webserver even if your machine is plugged in, but powered off - and without entering the admin password.    The IntelME thing can be used as a packet-sniffer, and to access memory on the Intel box while it is running.  It's basically the "Clipper Chip", an ugly idea shot down over 20 years ago.   Read the tech details about it at this URL:   There are experimental "ME-Disable" routines, which flash part of the firmware with hexFF, but try to keep the BIOS BUP (boot-up) stuff:  but they can brick the Intel main-board, in some cases.  It's an ancient paradigm: we must take risks, to be safe... a lot like investment activity.   Training target swung from 104.70 to close at 106 even, as Cdn$ showed some firmness.  With ex-div approaching, and summer vactions being taken, things will likely get a bit twitchy.Blush Unsure 

[June 11-14, 2017] - Lots of volatility again.  But also, done some cool techie stuff.. Installed the latest stable version of "Wine" for Linux on the Linux boxes. "Wine" (WINdows Emulation) program suite lets Windows programs run on the Linux machines.  Big result, as MAKECASE is written for WIndows, as is the TimeSeries price database.  Both are now converted to run on Linux - along with WGNUplot, so my whole data-management app now can run on Linux.  Also downloaded the "openssl-devel" stuff, and rebuilt the Lynx programs on Fedora Linux and CentOS to use ssl (secure socket layer), so Lynx can run with "https:" access.  This was critical, as most financial datasites are ssl (ie. "https:") now, and Lynx is a text-mode browser than is used to pull in the data.  Seeing all my old code and graphics from Windows, run on the Linux boxes is quite surreal, as it all works well.  I used stable-release: "Wine" source from:     Note, the SHA256 and MD5 checksum hashes for the wine-2.0.1.tar.xz file are in photo near page bottom.  If you have Windows code you want to run on Linux, this is snappier than building a virtual Windows box, it looks like.  Image of my Time Series Manager (TSM) application with 12,362 row by 6 col. series (spot gold prices, 1968 to June 9, 2017), with linear chart and least-squares regresison line, via GNUplot at bottom.  The TSM product avoids spreadsheet stuff, and lets data series be manipulated easily and directly as single tensors.  Last image shows windows .EXE's, running directly on a CentOS 6.6 Linux kernel, using Wine 2.0.1

[June 9, 2017 - Friday] - The training target is up over 2% today, providing initial positive results to the real-time experiment this development project has become.  (Training target, and other financial equities are basically in a "run" mode.  Attempts to add to my existing position would now require bids roughly 3% above where initial +1 sequence began appearing, in the jump-delta current example set (the current May 11th to June 7th "TCASETAB.TXT" file of booleans, which the trained NN-AI has been interpreting).  It is quite possible that this favourable outcome is due to random chance.   (Training target is now up over 2.20%, just as I have typed this note.)   I suspect that the semi-strange market behaviour we now typically observe (ie. curiously uneven patterns of volatility - ie. no volatility for long stretches, followed by rapid spikes and retracements in volatility) , is due to the widespread use of AI and other algorithmic methods to augment trading and investment activity.  We may still be being fooled by randomness, but we are also much less randomly fooled, it would appear.  I have a strange sense that this modern market may exceed the excesses we observed during the 1920 to 1935 period.  If this is true, then DJIA at 35,000 to 40,000 range within 3 to 5 years, is not at all unreasonable or unlikely.  Rising rates will be associated with rising returns on capital, as is often observed in the historical record.  And the AI tools - as they augment ability - will also likely enhance the risk-preference profile of most participants.  The equity market may be the mechanism that puts more income into the wallets of consumers, so that consumption and investment can be given the demand-push that many folks think it needs to have.  What is curious, of course, is the low rate of indicated inflation.  But I think I know the reason for this also, and discussion of that phenomenon is well beyond the scope of this observational comment... Cool

[June 8, 2017] - Re-ran the NN-AI (Neural-Network AI) prgm with two more days data.  Enhanced the MAKECASE and MAKECASEBOOL utilities to allow the TCASETAB.TXT file of boolean jump-delta vectors to be more easily generated.  Mkt action suggests *many* other participants are already actively using AI methods.  What this suggests is that this methodology probably needs to be in everyone's toolbox.  Although a bit technically complex to pull together, if there is some predictive ability, it may be useful.  Certainly, the NN-AI approach is probably the best tool for trying to catch a turning point.  I recall a formal exercise, carried out by a Ministry of Treasury - in which I did the computer programming - failed to find *any* method that could successfully even indicate upcoming interest rate moves (and subsequent changes in bond prices).  We literally tried *all* known methods, and they all were ineffective at even catching major turns before they happened, much less actually predicting anything.    But this was before NN-AI based methods.  If the data is prepared properly, it appears there might some effectiveness to this NN-AI approach described here.  (FD:  I was not filled yesterday in my order.  Today, the target has advanced 0.60%, as I write this.  This approach looks promising.).   The first image is the screen-display for today's forecast: (Orange screen, top right, with boolean results for last 4 days, all +1.  As a real-time experiment, this suggests a long position in the target is indicated.)

[June 7, 2017] - Fixed a bug in MAKECASE program which was not handling the end-of-data construction correctly, simply branching away when it could not create the target (which is 5 days forward).  Fixed the program to provide valid training case data, with -999 as indicator that training target could not be constructed.  This lets me run the MAKECASE program for small subset of data (ie. the last 20 or 30 days), and produce correct boolean jump-delta case vectors right up to end of data, despite not having training target.  Obviously, this is needed in order to run "compareMarketNet" and see what the values the network generates, as these most recent values have the most useful, predictive power.  Network still says uptrend is predicted, as do previous curve-fitting prgms.  (Full disclosure: I put a small bid in just off the mkt, for a small increment to existing position..) [Update: 9:40 pm EDT: I did not get filled, which is traditionally a positive sign. Almost always, if I get filled in a stat-arb stink bid, I regret it.  Today, not being filled, suggests NN-model might be working.]

[June 6, 2017] - Top first image shows most recent results:  I spent time updating data to June 5 (previous day), and ran MAKECASE from mid-May to present, to generate current dataset to give to network.  Specifically, here is process to have neural network evaluate data: (start bp_wish, ie. Xerion)

How to Restart & Reload Weights & run a Xerion Network Against New Data...

BashShell > bp_wish          (start bp_wish [Xerion] from command line shell
> source     (this program just sets up the network, and
> set precision 17              defines the neural network structure, and loads
                                       the "tcasetab.txt" training case data into the
                                       variable MNTraining, and sets "exampleSet" variable
                                       to the string: "MNTraining" ...)
> set tcl_precision 17        (tcl_precision has to be set to avoid losing info )
> source compareMarketNet.tcl    (check results: "Actual vs Predicted" ability...)
> source plotValuesSML.tcl           (source the smaller "plotValues" tcl program)
> MNTraining size                         (check that exampleSet training loaded ok, 12 obs.)
> bp_groupType MarketNet.Output     (confirm nodes are correct configuration...)

> uts_presentExample MarketNet MNTraining 0         (present first example case)
> uts_activateNet MarketNet                                 (activate (ie. "run" the net))
> compareMarketNet                       (attempt to compare actual vs predicted. No good..)
                                                    (forgot to load the network Weights ! )
[ the results are random ]

> uts_loadWeights MarketNet MNnet40_v2.wtb    (load the highest-precision weights)
                                                                    (from binary format file...)
> compareMarketNet                       (this time, when we run this, we get sane results...)

[ the results as shown on the screens in first image ]

> plotValues MarketNet MNTraining    (creates Actual vs Predicted chart (see screen))
                                                     (Note that this "plotValues" is from the .tcl )
                                                     (program "plotValuesSML.tcl", sourced above... )
Hit Return to quit...

The results suggest uptrend in target value.


[June 4, 2017] - Light, clarity, perspective and focus - what we seek to have when dealing with complex situations where knowledge is obfuscated and obscured.  To see clearly the full panorama is often a luxury we do not always have.  Should we try to develop one process, which is slightly faulty, but which can operate successfully in most situations, or is it better to devise a more complex mechanism, which can adapt rapidly to a variety of situatons, but is more likely to be fooled by crafted countermeasures?  I spent the weekend at the Lake, mulling over these design questions...

[May 30, 2017] - Developed sAPL functions "Estab^marketnet" and "Actnet2", and after some headbanging, got the numbers right(!).. Wild Really quite a result. It is doable.  The AI-Augmenter is doable.  You can build a simple (but sufficiently complex to solve a real-world task), neural-network on a Linux desktop box, using Xerion, and then take the weights file and establish the same network structure in sAPL, and then activate the network, and get the same results as Xerion gives.  The function "Estab^marketnet" reads the weights file, establishes the network structure, and the fn "Actnet2"  runs the network (against training cases in var Example), and (as long as I remember to switch the default node transfer-activation function from logistic equation to hyperbolic tangent!), I can get the same numbers, running the net on the iPad, under sAPL - all in a less than 400K workspace.  It's primitive - but it works.   It also offers the possibility to design and develop a toolset that is unique to each researcher.  No information need be stored or maintained on any internet server.  If you use this AI methodscape, you can retain and ensure local operational integrity, regardless of what happens in the "cloud".  (Ever seen a thunderstorm up real close..?  That is what the future holds for us all, I suspect... You don't want to be dependent on an internet connection for your machine intelligence.  A little wee package can still have a useful little brain.  Just watch a mosquito.)

[May 29, 2017] - Developed sAPL functions "readfile" and "procwt" to read Xerion's .WTT file (the network weights), into sAPL.  Also wrote "tanh" to provide a hyperbolic-tangent transfer function, so I can activate (ie. "run") the trained network, on the iPad. Put the APL code in the "Code" section, for those who might be interested.

[May 26, 2017] - Included more iPad examples of what visualization graphics might look like for AI-Augmenter, as well as a bit of background info on attributes a network's training target should have.  Note: the full source code for Xerion is available at:  and the documentation is at:   You want to use the Xerion 4.1 version, the Xor2 network is trivial, but is a better "Hello World" exercise than the OCR digit recognition stuff TensorFlow suggests.  Note that the first url (the ftp.cs.toronto site) has all the Tcl/Tk stuff plus the Tcl extras, that you need also.  I may try and pull all my modified code together, and put it on the Github account.  Xerion runs under X-Windows, and seems to work fine under Fedora's Gnome desktop.  This is older code, but it is not burdened with a complex sack of dependencies (beyond the usual Linux stuff, of course).  

[May 25, 2017] - site cleanup - re-orged topline stuff, put economics images into Econ-2017, last year's market forecast ("Sept 2016 - Why the Stock Market May Move Higher...")  into Econ-2016, and the "APL on iPad" details in its own section.  If the new signed-boolean stuff has forward accuracy, I can create a preliminary version of "AI-Helper/Augmenter" on the iPad, using sAPL.  

[May 24, 2017 (pm)] - Re-ran with "quickProp" method, developed by S. Fahlman (see notes on picture).  Runs better (smaller error), and faster (less than 19,000 evaluations), and fits better.  (Actually, the fit is surprisingly good).   You can see I saved the network weights as both binary and text values ("uts_dumpWeights MarketNet MNnet40_v2.wtb" and "uts_saveWeights MarketNet MNnet_v2.wtt").    The website is bloated now, and I have to re-organize this page (I am getting red-flag warning messages telling me the site will load too slowly now...)   Apologies if it loads like a slug.   But the "quickProp" result on the signed boolean data, using a line-search instead of the typical fixed-step (epsilon of 1), shows surprisingly good correspondence between training data, and network forecast.  I wanted to get this posted, so people can see what is possible.  For me, this is basically a "Hello World!" exercise.  It is a simple network (30 input, 40 hidden, one node output), but even a simple structure like this, can yield effective, actionable information..  

[May 24, 2017] - Happy Birthday, Queen Victoria!  Re-designed the network, now running with twice the hidden nodes.  You can see the Xerion code I use to create and define the network in left-side window, cyan-coloured display, new pic..  Switched to using Xerion GUI version, which gives 1-button operation to some operations.  Running training now.  Total network error falls quickly, and ability of net to match input target looks better.  The 32-bit Intel box that Fedora+Gnome is running on works fine for this.   The tcl/tk interpreter is calling C programs (for the Minimizer), for the conjugate gradient evaluation and for the line-search.  It ticks along reasonably snappy.    Equity markets in Canada are choppy - analysts were not impressed by BMO earnings this AM.  ( much more money to the Cdn banks have to make, to impress people?  They are each earning at least $1 billion / *qtr*, and BMO just raised its dividend to 0.90/shr.  Fat profits and almost a 50% payout rate.  This is not good enough for you guys?  (BMO fell $3.00/shr in AM).   Crazy times.  "Money for Nothin', and Your Sticks for Free!", like Mark Knopfler and Snoopy used to say...

[May 21 afternoon, 2017] - Results...  Looks good.  This is a bit of a black art, it appears.  Using conjugate gradient, the training is faster.  But you want to use a line-search, rather than just moving fixed epsilon in the steepest direction, because directions can change a lot.  But eventually, the line-search fails, and one can go no further.  But then, you can switch the minimizer to using direction "steepest", and a very small fixed step, epsilon (0.001 or 0.0001), and just creep along the surface, like a blind man in the dark.   Not sure if this will really improve training, but I am still running with the overlapped data, each case only one day ahead, but with 5 day lookback for each series.  A good NN should be able to train to pure noise, if you let it run long enough, so the early line-search failures after only a few thousand iterations led me to suspect inconsistant data.  But perhaps the network can deal with the rolling overlaps.   The length of the gradient vector, |g|, is just hovering above 1, and training is continuing on the AI box, an old 32-bit Pentium running Fedora.  The screenshot above showing the last 360 "Actual vs. Predicted" cases for my boolean jumpdelta dataset, was generated just by imaging the Gnome Xwindows display screen with a little Samsung Tab-3 (SM-T310) running Android 4.4.2  (the old Dalvik VM).  Android 6.01 on a Tab-A runs better, and battery-life is vastly better, but the old Tab-3 running 4.4.2 is a fine piece also.

[May 20-21, 2017] - Update:  Got plotValues.tcl working.  Built trained network.  Shows Actual, vs "Predicted" booleans.  (see picture above).   Was not setting "tcl_precision" to max value of 17. (Default was 6).  Better training results now..  So, I have a trainable dataset now.  My Oxford Dictionary defines "naive" as "artless, amusingly simple".  Probably right.  In my naivety, I had thought I could use raw price data as input (despite scaling the Dmark data, years back in my first trials with this technology...).   Wrong.  Your input data has to be between zero and one (if using logistic activation functions), or (I hope), between  -1 and 1, if using hyperbolic tangent activation
 functions.   My attempts to train on raw price data, using an exponential transfer function on the final output node, failed.  Just doesn't work. The whole dataset would train to one value across all cases.  So, I had an idea.  I modified the MAKECASE function to create signed boolean vectors where -1 is down significantly, 0 is no significant change, and +1 is up signifincantly.  It runs with a filter-parameter that defines what "significantly" is - eg, 1%, 2%, etc.  Xerion lets me define the transfer (ie. activation) function as TANH, instead of the default LOGISTIC.   Tried this for both Hidden and Output groups.   The network outputs a result between -1 and +1 now, for each case.  Used "uts_groupType <netname>.Output {OUTPUT TANH SUMSQUARE} to config the final output node, and built a training case set as signed booleans.  (Xerion also allows "CROSSENTROPY" instead of SUMSQUARE, and also lets me create a cost.Model.)  The network now trains to a single signed boolean (trinary output).   Converted MAKECASE into MAKECASEBOOL, and wrote TRANSFORMBOOL fn to convert raw prices into a table of signed booleans.   This dataset can be trained, and looks promising.  But what I discovered, after only a fews thousand iterations (line search, steepest, very small fixed epsilon), is that I cannot train this data very well.  I cannot even get the sign consistantly right, before the "function is wobbly" message appears.  Now this is interesting, as it indicates the data is perhaps inconsistant.  (Using scaled price data, you can train right down to the noise, if you run your back-prop long enough.)   So, I thought about it and realized I am rolling ahead 1 day, and then taking previous 5 days of historical data, to create each training case for the Xerion "exampleSet".  In Edgar Peter's Chaos books, a similar problem was encountered with re-scaled range analysis (Hurst exponents).  You don't want overlap in the data, as it blurs the trials, and the overlap messes up the statistical property of independent exclusive trials, that I am pretty sure one needs.   If I am looking back x days in each series, I probably need to roll forward x days for each training sample.  I will try this idea.  I've tried several different network structures.  Just checked the AI box.   Training this time looks better.  I get long runs of several months, where the signs are at least right.  Much further work needed - but I suspect now that this approach has merit.  Typically, markets are *almost* random - but often exhibit periods of non-random behaviour for various time periods, when serious money can be made, just by taking a position, and then doing nothing. Jessie Livermore (pseudonym Larry Livingstone) was very clear in "Confessions of a Stock Operator", that he made the most money by "just sitting".  This seems to have worked for Warren Buffet as well.   I had a CP/M Z-80, when Bill Gates was starting Microsoft, and my first serious app for my new IBM P/C was written in MASM assembler.  But for some reason, I never bought Microsoft stock (too expensive?), despite telling folks that Mr. Gates would probably sell MS-DOS to every literate person on the Earth. (I did not foresee Windows.  Missed the class on the "Lilith" box at school.  If curious:   Buy-and-hold can work pretty good.  Best trick is to start when you are really young.  Have a good portfolio when you are still in your 20's.   You don't need "artificial" intelligence for that.  Just don't be unwise.   Anyway, this particular AI approach looks like it can perhaps identify (ie. "characterize") current market nature, and suggest when one might try to establish a position.  You might be able to use the old time-series serial autocorrelation stuff we learned in economics school to achieve similar results.  It works not bad for the bond markets, (they have high degree of serial auto-correlation), but I could never get any useful results for stocks, and it was dangerous as hell for commodities, given their characteristics of extreme reversals.  With commodities, you can make money for *years*, and then lose it all in a couple of ugly weeks when chaotic phase jumps happen.  (viz. the forward markets for crude oil, for example).  Even if you are right, you can still get killed if you act too soon.  Short oil at 120, knowing it is stupid-too high priced, (based on cost-of-production) only to be stopped out, at 130.  Do it again, and lose all your money on the final run to 140/bbl, before the massive reversal begins.  The best training for commodity markets is Vegas and Monte Carlo, as your key objective is to participate without suffering "gambler's ruin". (But that is a different model...)  

[May 17-18, 2017] - All nighters, days at Starbucks with the laptop... May is here, the apple blossoms are ou, and I am here, writing this...  Mkt is providing lots of thrills and chills - like an old Lou Reed song.   I built MAKECASE to construct the training cases, and have been trying to train down to a t0+4 price-point on a specific series, from a sequence of segmented series.  These combine cross-sectional and time series elements (basically 5 days history, across several different series), but reduced to a vector, for a specifc time point (one day).  I am now *certain* this process is driving markets in many areas.  This is dangerous, but mine is not to reason why.   It is difficult to train to a price target (I'm trying an "exponential" transfer function for network output - looks like a stupid idea, but I wanted to try it.)  I want to avoid working with "scaled" data, as I just find it annoying to use in realtime.   I have a simple network defined, (30 input units, 20 hidden, one output) in Xerion, and I can run a few thousand iterations, before the line-search fails.  But it does not want to work with un-scaled data.  I have only 4360 training cases - tiny by modern standards - this is really almost a "back of the envelope" exercise - but I found that simple stuff actually is pretty robust. (If you are bulletproof, you don't have to drive fast, right?).  

Anyway, I wanted to see if I could use the exponential transfer function to just train to a future price, but it just does not work well.  The exponential transfer function is typically used for "softmax" training (training to a 0 or 1), and also with "cross entropy" minimization, instead of minimizing the sum of the squared errors.  These options are configurable on Xerion.  My network is called "MarketNet", and one can use the command "uts_show {uts_net[0]} to view the details.  In the bp_sh (the back-propogation shell), you have all these command options (eg: to randomize the net:  "uts_randomizeNet MarketNet" will populate the network with random values before beginning training.)  You select the minimizer, give it a short name, config the search methods and step-sizes or types (the epsilon), and you can run training.  I wrote a trivial .tcl function, which can be sourced, to view the "target" from the training cases, versus the "output" of the network.  In "bp_sh"  (the Xerion/tcl cmd shell), you can then enter: "compareMarketNet", and get a quick picture of how well the current training attempt has worked.  i post some code and examples somewhere later, once I get this working right.

For the old stuff I did years back, I scaled the data between zero and one.  But you have to unscale it to use it, of course.  But I had this idea.  You really want probablilities anyway, so, I will modify my MAKECASE program to generate binary values:  0 => forward mkt value does not change much either way, -1 => forward mkt is down significantly, and 1 => forward mkt is up significantly. Then, the network doing this "softmax" training should basically give me a probability estimate of what is likely to happen to the specific price series I am using as my training target.  Looks like the trick is to use a hyperbolic tangent activation function, (values between -1 and +1), although exponential (values between 1 and infinity) is what is typically recommend for softmax-type training.

Oh, a little note on MAKECASE.  What a pain!  Initially, one thinks, "oh just build a big matrix, and slice it row-wise" to get the series day-segments.  But of course, all the series have *different* holidays and other off-days, so they don't line up.  MAKECASE has to select one series (in my case, I use the SPX), and then conform all obs to those active day values.  The logic requires that, for any given day, you look back a specified number of days, and a collection of these day-segments forms your training-case for that day, along with the target you are training to.  Turns out that is tricky, but doable.  But you have to process each series carefully, and check for missing data, and such.  What is interesting about this approach, is it should obviously scale, and be applicable in other areas.  One uses Hurst exponents (re-scaled range analysis) to deterimine if the data is trending, random, or mean-reverting.  It's surprising how many Hurst exponents are right around 0.5 now (its on the Bloomberg, has been for many years...).  But just because the series looks pure-random wrt to itself, does not mean that it's cross-elasticity is not a factor wrt other data vectors.   (The danger is of course, the illusion of linkage, when none really is present.  But the flip-side is worse, no?  You have a pretty clear linkage, and you miss it, leaving all the money to be hoovered up by flash traders.  Cool)

[May 11, 2017] -Still messing about with what to train to.  I don't want to just forecast, I want a more subtle picture of the future, where the AI can suggest the nature of conditions.  I am thinking I probably need to train to a generated boolean vector which can be interpreted in some sort of quasi-probabalistic way.   Playing around with ideas in APL...

[May 7-8, 2017] - Enough data-cleaning to have a simple prototype soon,  I hope - by tomorrow or the next day.   I read this Issac Asimov short story when I was very young, about a group of scientists working on force-field technology, and they started having mental breakdowns.  Once scientist suggested that humans were just lab test creatures, and that in the same way we ring-fence dangerous bacteria cultures with a circle of antibiotic (penicillin - C9H11N2O4S), humans were ring-fenced by those running the experiment, and the problems the team was facing was due to the potential effectiveness of the force-field technology they were working on.   The technology would allow protection from nuclear weapons.  The lab-rats-in-an-experiment was the idea of the lead scientist on the project, and his "psychological penicillin ring" theory was accepted to keep this key guy working, despite his delusional state.  It was a great great story, because it contained a unique theory of evolutionary human development that linked technological progress with progressive social jumps.  I searched thru my old books, and found the story, and the paperback cover is shown above in the ISS HDEV picture.  It was "Breeds There A Man...?", first published in 1951 in Astounding Science Fiction (now Analog).   Sometimes, I feel like similar things are occuring on this AI project.  I am beset by curious events, which constantly prevent me from making progress.   Rain, which fell for several days, and flooded the fields.  Trees, which were uprooted by winds, and hung at 30-degree angles over the power lines into the lab here.  (I took them down myself, with winches, a tractor, a series of ropes and pulleys, and a chainsaw..)  And yesterday, the machine running the Xerion Dmark demo crashed as I was cleaning a wad dust from its front (I touched the boot switch?).  And the awful mess of the data - full of missing observations, many more than I realized.   But, I rebooted the Xerion demo box, and ran the network to train down to an old sample segmented time-series,  got GNUplot and GS (Ghostscript) working right, and confirmed I can build my training-case file, and run a "compareNet" and generate a visual of actual vs network training target.   I compared "fixed-step" (using an epsilon of 0.1, versus a line-search (in Xerion, "Ray's Line Search"), and the training times (in both cases, using conjugate gradient direction method), and the training drops from roughly 70,000 iterations to around 400.  The heuristic algo seems to be run line search on conjugate gradient for the first 300 or 400 iterations, then switch to a fixed-step, and you can train right down to noise, if you want to.  This technology works.  I suspect TensorFlow has all these kinds of intrinsics probably just built-in.  This is why I am stepping thru the process using the older Xerion code, so I can try to get a "through the glass, clearly" feel on how it works.  The original quote is biblical, is it not?  Something about "through a glass, darkly?" [Edit: yes, it's first Corinthians, verse 13:12. And it's also a great 1961 Bergman film.. ]

[May 4, 2017] - Still doing data-cleaning... Also, I download all the "Mplayer/GMplayer" code, and built "MPlayer" (and the desktop GUI version, called "GMPlayer") for my CentOS Linux box from source.  You can get the code I used here:  This version is from 2016-01-24, and includes FFmpeg 2.8.5 in the tarball. To build MPlayer, you can create a source directory /usr/local/src/mplayer, download the tarball to that directory (I used MPlayer-1.2.1 as it looked quite stable), run gunzip to unpack the zipped file, then "tar -xvf" to untar the ball and create MPlayer-1.2.1 source directory structure. Then, you just cd to it and do the usual "./configure", then "make", and then "make install" from a command line shell.  Make sure to include the "--enable-gui" parameter to "./configure", or you only get a CLI (command line interface) version of mplayer.  When I tried to configure, I got a message saying I needed "yasm", which turns out to be an open-source assembler that mplayer uses for some of its lower-level stuff.  So, you go get "Yasm", do the same exercise - create /usr/local/src/yasm directory, download the tarball there, unzip with gunzip, untar with tar -xvf, and run the three cmds, ./configure, make, make install.  That should install a working version of yasm.  Check it by entering "yasm --version" at command shell.  Here is Yasm url:  Having an open-source assembler might turn out to be useful here.  MPlayer, of couse, is used to watch video files, or listen to music files.  The program "gmplayer" pops-up an on-screen controller, which can be used to choose files to play, and/or create playlists.  You have to setup a default "skin" to see the gmplayer controller, which involves another download of a tarball into /usr/local/share/mplayer/Skin (I got Blue-1.12, at this url: , and used "bunzip2" to unzip the ball.  Then, I had to copy the the contents of the "Blue" directory that was created, into subdir called /usr/local/share/mplayer/skins/default, in order for gmplayer to actually work.   This process builds executables mplayer and gmplayer in /user/local/bin.  Create a launcher icon on your desktop to run "/usr/local/bin/gmplayer", and you will have one-click sound and vision!  There is method to my video-madness:  Ideally, I would like to have my neural-net take input from a real-time market feed, and output a real-time video display which would augment one's our own ability to develop a market "picture". Cool

[Apr. 30, 2017] - (Doing this edit on my CentOS box, running Linux.  Works good.  Same box as I run my Rails webserver on, which keeps track of news-stories in a little SQLite database. Using Linux feels like being let out of that Apple-Microsoft jail..."Free! Free at last!" )  So, I built the MAKECASE program, to run thru my little database of time-series tables, and build a single table where each row contains a vector of data observations (mostly prices) for a given date.   MAKECASE takes a single vector of series numbers, and returns one big table, where each row is a date, followed by a bunch of observations, one from each series.  For the old Dmark stuff, I scaled the series-segmented data to fit between 0 and 1 (trains better, given the sigmoid transfer function), but now, TensorFlow can use logit, which has faster rise-time, which might be better.  Will try a first version on Xerion, without scaling.  Then will attempt to replicate same training using TensorFlow - as my first attempt to use it for something real.   MAKECASE still does not create the training target, which will be a "market characterization vector".   I'm thinking maybe take one key portfolio element, and cast its direction, intesity and dispersion, and try to train to that.  Or maybe a percent delta of price beyond a noise-filtering threshold?   The real key here is keeping the data clean.  And I should have *two* datasets, so I can see if I have just trained down to noise (you know this, if you train fine on the first, but executing the 'net on the second set does not show any success beyond randomness.)    Or maybe I should just reduce the training attempt to a simple binary value: 0 = do nothing, and 1 = take a long position for a specific time window.  How far should MAKECASE try to look ahead to code its target?    I suppose ideally, you could let the network look at *everything* by *every time lookahead", but I want to narrow down to something specific, so I can evaluate its effectiveness, and value.  Collapse the "market characterization vector" down to a single riskoff/riskon binary value?   That way, I am not trying to forecast and I may get something useful.

[Apr. 27, 2017] - A data-provider I use to keep a database current, disabled their traditional .CSV access methods, and replaced this simple tool, with an interactive process that creates .GZ files for download.  So, I had to re-write the data-retrieval method I use, creating my own little script-driven robot to access the data and unzip the .gz files as required.   Everything works again, and I can move forward on the AI neural net tools.  Will create a first-pass of the database inversion tool, to prepare the cross-sectional training cases, which will train to a characterization vector, created from near-future events.  In this way, I hope to sift out true-trends from the market noise.

[Apr. 09, 2017] - Google's "DeepMind Technologies" group in London have just open-sourced their "Sonnet" product.  This might be a big deal.  Sonnet sits on top of TensorFlow, and lets it be used to create complex neural networks more easily.  I am interested in trying it.   I've had a large tooth removed, have more dental work scheduled next week, and have to do a lot of tax work to file personal and corporate income tax and HST forms for farm and firm. Dealing now with pain...  [Update:]  Just went thru the *DeepMind* website, quick scan of their Github stuff, & read their paper on "Learning to Learn".  Imagine if US rocket-pioneer Robert Goddard was transported to a 1990's launch of the space shuttle - that's how I feel after this quick scan. These guys look like they own the AI field now, especially since they have the resources of Google behind them now.  They look to have infinite power, both in CPU cycles and cash!  Oh my... Crying

My only chance here is these guys like chess I *hate* chess with a passion - as I detest most closed-environment gamey stuff.  Game-playing is time wasted.  All the interesting stuff and the stuff that matters - that makes a difference to the future, and drives humanity forward - lies in the open, *unbounded* realm of the pure real - the place where neural networks often collapse and fail badly, typically.   But you can use NN technology to *augment* human intelligence - like lenses can help your eyes see better, amplifiers can let you hear better, and computers can let you organize and process information better. (And yes, like a M1911 .45 can be used to punch a hole thru your advisary better than your fist can - let's be honest.)  In a formal system that is tightly-bounded by rulesets, and distributions are known, a well-built AI will *always* win.  What about open scenarios, where there are no formal rules, and the rate and intensity of change itself is also dynamic?  Can an AI help?   I am pretty sure it can.  And I think I know what it has to be able to do.  The AI does not replace or overwrite the human agent, it augments his ability, and lets him make better decisions, quicker, and with less of the errors that behavioural economics shows us *really* do occur.   I'm not in this for the money.  I want to prove a point, more than anything, and build a device.  We need AI technology like soldiers need rifles.  This technology could aid us all by letting us make fewer mistakes, and avoid the "Wee-Too-Low! / Bang-Ding-Ow!" outcomes that are become increasingly common in our modern world.  Perhaps I still have a chance... Blush (I put a picture of my primitive Analyzer tool output, essentially a first cut of the Augmenter I envision , running on a Samsung Tab-A, under Android 6.01, at screen bottom.  It shows the M-wave Analyzer output, calculated and displayed on the Samsung tablet, and an estimated probability density, which suggests trade size for a given risk level.  It essentially suggests how big you should bet, given the risk level you want to accept, and shows it all as a picture, so you can see exactly what you are dealing with, given the data-range you believe is appropriate for the current picture-of-the-world your necktop neural network tells you is now in play.  You can see where I am going with this, yes?)

[Mar. 31, 2017] - Got Xerion running with original late 1990's data (Dmark segmented time-series network).  Ran with many different types of training - confirmed it all works.  Xerion looks to be predecessor product to TensorFlow in many ways.  Using simple steepest  descent (standard backpropagation), with fixed step and epsilon of 0.1 it can take about 90,000 itereations to train down to the noise in a segmented timeseries. But use a line-search, and conjugate gradient with restarts, and you can get to the same level of training (essentially, just overfitting a timeseries to check limiting case of training algorithm), and Xerion will fit to the curve in about 300 to 400 iterations.  It's a pretty dramatic difference.  My original approach was quite wrong (using a single time series, segmented into cross-sectional training cases).  I have a new idea, based on current practioner methodologies, that looks to be much better.   I'm having arguments with a PhD type, who thinks NN tech is useless for market phenomenon (he is a "random walk" believer, it seems), but given modern state of the NN art, I am pretty sure my new approach can be useful.   I note with interest that Dr. G. Hinton (Xerion & TensorFlow AI academic guru), and Edmund Clark (former CEO of TD-Bank in Canada), will be setting up a new gov't funded "Artificial Intelligence" Institute in Ontario, based in Toronto.   Two new charts at page bottom - as Ghostscript image of the original Xerion-driven DMark series (raw price data scaled to fit between 0 and 1) training versus network output, and today's Cdn dollar chart - showing the complete NON-RANDOMNESS of the modern markets.    Markets are not random, they are chaotic.  The "random walk" picture of the world, where you believe in stable distributions, and build models that use distribution-tails to estimate your risk is wrong.  It has already given us the 2007-2008 financial meltdown.   Today, the Cdn-dollar chart looks like the output from a square-wave generator.  It's not random.  It is just one example of many that you can see *every day* in the markets. 

I've been stepping thru backpropagation by hand, using basic partial differentiation calculus, and the chain-rule, just so I can clearly understand the original idea.  I learned some C++ also.  Downloaded Alan Wolfe's NN sample code, only to find it won't run on my Linux CentOS boxes, with gcc 4.4, because of some new loop-construct recently invented and slotted into Clang or LLVM or whatever the heck the kids are now using - something from C++ 11 or 17 or Apple's lab.  More reading to do. This project is taking on a life of its own.

[Mar. 24, 2017] -  Completed prototype of neural network definition and activation routines in APL on iPad.  Great having a working spec - trivial Xor2 net - can train it on Xerion, and activate/execute the net on iPad using APL (which is great for matrix stuff).  See page bottom for picture.  Numbers match, Xerion in Linux, iPad using APL, for trivial toy case of Xor2 network.

[Mar. 17-20, 2017] -  Working on "cross entropy" idea, which drives how artificial neural-networks are trained.  The idea is that the initial (actual) probablility distribution is mapped, by the artificial neurons in the network, out to a posterior target distribution - and that there are different entropy characteristics across the various possible target distributions.  One seeks to minimize the "Kullback-Leibler divergence" or the entropy difference between the initial and the posterior distributions.  This sounds quite complex, but if you are using "one-hot" encoding (for example, trying to identify written digits), and your initial disribution is simply "0 0 0 1 0 0 0 0 0 0" - ie. your number is a "3", then the cross-entropy summation of the initial probability distribution values times the posterior generated distribution - boils down to taking a single natural logarithm of the sigmoid or logit value (ie. the probability-like number between 0 and 1)  that the network generated.    You can use a gradient descent search to drive your back-propagation, but the "stopping point" of the network training will be when all the cross-entropy values between the initial and posterior probability distributions are as small as possible.    It should be possible to make your network "recognize" with a high level of accuracy.  This recognition can extend to more than just written digits.   One should be able to create an artifical "Helper", that has superior recognition ability, for whatever you train it for, given you can "show" it enough accurate raw data - what we used to call "training cases".   I suspect "Helper AI" technology might become a must-have tool as we move into this brave new world.  (I really wanted to get a TensorFlow AI running on my iPad.  My vision for this was Issac Asimov's "Foundation" series - where Hari Seldon had this "probability calculator" at the first chapter, set on Trantor.  I can't get Numpy to load thru to Python yet on the iPad, but looks like Xerion might work...)  I am thinking of asking a Japan company to design a special Hyper-tablet device for me - but running *pure* Linux, no Android or iOS stuff in the way... 

[Mar. 14-15, 2017] - Fell down a big rabbit hole. Decided to look at my old Xerion stuff, and got obsessive about it and decided to convert 20 year old Uts/Xerion to run on a modern Linux box.  Xerion was the U of Toronto product built by Drew Van Camp and others, offered by Dr. Hinton's group to Canadian industry, as it was funded by a gov't grant process.  I took it and ran, and built a Linux box using Slackware Linux just to get Xerion running, and build some neural-nets to investigate time-series data.   As I dug deeper into TensorFlow/Python, I realized it looked a lot like UTS-Xerion/Tcl/Tk+itcl+Tclx - which I know well.   Learning is all about jumping from one level to another.  Getting Xerion running on a modern Linux has been a bit of work. (Just getting a clean compile of the code using a modern gcc was non-trivial) .  But I can run the original Xor2 example and it all seems to work well.   Having Xerion running will be very useful, as I can verify TensorFlow builds against original Xerion efforts.  Xerion is not convolutional, but it did offer a number of alternatives to basic gradient descent, which - in the example of training a boolean net like the Xor2 example - can be shown to be useful.  It's also a good learning tool, with nice visualization.  (Screen shot of Uts/Xerion is below..)  (Mar.15:  Fixed a bug - Network Node Unit & Link Display not working, fixed.  Built Xerhack, a visualizer toolkit uses Tk Canvas.)

[Mar. 8, 2017] - Got image hacking stuff working in Python on both Mac OSX and Windows.  Took the Ripples-in-Pond Tensorflow example, and made it look more like exploding stars in a dark star-field.  Runs *without* IPython, Jupyter and Python Notebooks (displays 5 images in sequenece as .jpg files, uses SCIPY and Pillow version of PIL (the famous Python Image Library)).   Images are interesting - like a star-field evolving over giga-years (see picture above.)   Here is part of the code:  (Click "Code" in top menubar for the rest of it...  Big Grin)

    # --- the Tensorflow LaPlace Image example (Uses PIL, and scipy.misc)
    # --- Modified: Mar 7, 2017 - by MCL, to just use image file display
    # ---                                       instead of Python Notebooks, IPython, etc.,
    # ---                                       with negative damping and darker image backgrd.
    # ---                                       (Instead of ripples in a pond, we have
    # ---                                       exploding stars ... )
    # --- Produces Initial image, 3 intermediated images, and the final image
    #     as .jpg files. Requires only: tensorflow, numpy, scipy and Pillow
    #     and Python 2.7.10.
    # --- This example taken from Tensorflow Site:
    # ---                           
    # --- and provides a nifty example of manipulating n-dimensional tensors.
    # ---
    # --- For Python newbies (me!):   1) invoke Python in terminal shell
    # ---                             2) >>> execfile("")
    # --- focus on understanding exactly how Tensorflow is reshaping tensors
    # ------------------------------------------------------------------------------------------
    # --- Import libraries for simulation
    import tensorflow as tf
    import numpy as np

    import scipy.misc

 <<< The rest of the code is in the "Code" section. Just click on "Code" on top menubar >>>



[Mar. 1, 2017 ] - As mentioned previous, I have Tensorflow + Numpy running on Python on the MacBook OSX now, and have got TensorBoard to show node names finally. This is the first trivial W = m * x + b (Linear Regression) program one can run, using gradient descent method to do the least-squares regression line. I've updated the two pics showing TensorBoard's display of a process graph for linear regression (now with variable Names!), and the Python+Tensorflow code example.  I've also posted these to the GEMESYS Facebook site.  Next, I want to 1) create a very simple neural network, and 2) read a real data data file of training cases, and produce some real output to a file. There is a lot of useful information on StackOverflow and various websites built by clever folks.  I've learned a bit just reading the StackOverflow queries.  I was sold on the NN methodology in the 1990's.  Xerion used Tcl/Tk to provide visualiztions, which I used to develop in (and still use!), but I typically ran my networks in background mode, and used GNUplot and APL to chart the prediction curves.  I have these old C programs I used to chop up data series, and I am itching to drop some of the old training files into a modern Tensorflow net.

[Feb. 24, 2017]  - Tensorflow is a bit more involved than Xerion, Prof. Hinton's U of Toronto product from many years back.  Here is my first hack, getting the basic tutorial running, with a trivial linear regression, and viewing the graph in TensorBoard, which one does using a browser session to localhost, port 6006.  To get the graphic working,  you slot in the statement "writer = tf.summary.FileWriter('/Path/to/logfiles', sess.graph)", before you run your training.  This writes event log data for model structure to TensorBoard log file directory, and the visual image of your model to be generated.  Very, very cool.  I put two images at *very* bottom of page, one showing the program text for my modified version of the TensorFlow "Getting Started" tutorial with simple linear regression model Y = m * X + b, and the generated TensorBoard model structure image, which is viewed using Firefox browser on the Macbook.

[Feb. 21, 2017]  - Ok, got it. Finally got TensorFlow installed and working. Gave up on the Linux box, as it runs some production stuff on news-articles that I need.  Used the Apple MacBook Pro with Yosemite (OS X 10.10.5), which had Python 2.7.10.  Was a complex project, but got it running.  Apple had Python 2.6 running by default, and I had installed Python 2.7 with "numpy" (the scientific numeric package for Python - its just the old Fortran math libraries, which I used to use at Treasury for bond-math calcs and econ-research).  Had to get the Python "Pip" program working, and first install of TensorFlow with Pip smashed everything, due to a flaw in pyparser stuff.  Had to manually fix a Python prgm called "" in directory /System/Library/Frameworks/... tree, as well as disable the original "Frameworks" located "numpy" and "six" modules.  This was critical.  The TensorFlow Python-pip install caused pip, easy_install, and the lot, to kack fail bad.  And the Frameworks directory tree Python modules (some Apple standard?) caused Python to always load the old Numpy 1.6 and six 1.4 versions - and TensorFlow needs 1.12 Numpy and Six version 1.10 or higher.   Until I fixed the "" parser stuff, and disabled the Apple-located default numpy and six, TensorFlow complained about wrong versions. What is silly, is that "Pip" (the Python Install Program), drops the updated modules in other dir, and until the ones earlier up the path are removed (Eg. from numpy to  numpy_old), Python keeps loading the old ones, even after one has run pip and/or easy_install, to load in the new ones.  I put a note on StackOverflow and posted bug and the fix, on Github/Tensorflow, search for Gemesys.  Bottom-line, is I was able to run the baseline TensorFlow tutorial, and make it print 'Hello TensorFlow!'

[Feb. 19, 2017] - I hate Linux dependency issues. Tensorflow requires glibc 2.14 and my CentOS 6.6 box has glibc 2.12, etc. etc...  TensorFlow wants Python 2.7 (or 3.5), but CentOS 6.6 is default Python 2.6.6, which "yum" needs to work, so I have to try virtualenv, or whatthef*ckever.   I've tried several tricks to get TensorFlow running, but no luck even on the Linux box.     I had hoped to put some datascience stuff on the iPad.  I have APL running, and GNUplot can do non-linear regression, but I was hoping to make a neural-net that could be trained on a GPU-Nvidia type Tensorflow box, and then just run on the iPad.  So far, no go.

[Jan. 27, 2017 - Started working with Tensor Flow, trying to doing some gradient descents across a custom phase-space.   I attended Jeffery Hinton's Xerion lectures at UofT back in the 1990's, and I built some neural nets using Xerion NNS to backtest commodity markets.  They worked, actually, and I had planned to publish a page on Xerion and Tensor Flow...  but I got very ill - some kind of flu thing which involved a 'cytokine storm'.   I'm recovered now, but it was touch and go.  Wanted to publish a page with a running Xerion net (or Tensor Flow example) being back-propegated, on the iPad.  Apple is a serious monopoly, and AI is real and perhaps dangerous.  The idea is to have a hand-held device that can provide real-time decision-support, but is not connected to any data link - what used to be called "air gap" security.  [Note: It is estimated that more than 70% of all trades on equity markets now are algorithmically driven.  If built right, they provide a real edge. ]  For info on air-gap security, read Bruce Schneier's piece here:    The Dow 20,000 thing is a bit of a concern.  There may be too much digital cash floating around.  Historically, the markets have been very effective at removing excess wealth.  If interest rates move up quickly, equity markets could fall 20%.  That is DOW 16,000, and it may happen at "internet speed".  The current stability may be a dangerous illusion, as powerful forces pull our world and its markets in divergent directions simultaneously.   ]

[ Dec. 13, 2016 - Got "DOSpad Math" compiled and deployed successfully to iPad 2, using Xcode 6.2.3.  Insane work. Also, updated "Time Travel" page with Harlan Ellison montage. (Click "More" button on top line right to show "Time Travel Research" page) ]

[ Dec. 7, 2016 - OpenWatcom Fortran77 on the iPad  - details ]

[ Nov. 28,2016 - Included info on how to get Python 2.7 running on iPad ]

[ Nov. 03,2016 - Added page: How to put VLC 2.1.3 on iPad-1 running iOS 5.1.1 ]

[ Oct. 23,2016 - Added page on "GNU gcc" = How to compile & run a C program on iPad ]

The Hack Which Launched this Site...

I put this website together after I hacked my old iPad, and felt I should publish the method, as it turned the old device into a very cool experimental platform, and a surprisingly useful research tool, as it is possible to obtain most of the Unix/Linux utilities from Cydia, and configure Safari to be able to directly download viewed content (eg: videos, .PDF files of important documents, etc.)  As well, there are application hives, or "repos", which offer very useful utilities, such as "iFile", which allow navigation of the native file system.  (One uses Cydia to add "sources", such as "" and "" to gain access to these additional applications).   (Further, if you use static IPv4 numbers on your local WiFi-enabled LAN, you can seemlessly transfer files between the iPad and either Windows or Linux machines.)

I've provided detailed instructions for "jailbreaking" the original iPad.  Once the iPad was opened up using the "Redsn0w" software,  Cydia was used to obtain *root* access to it.  It is our belief that *root* access should be provided to all devices owners, if they request it.  ("root" is the User-id that provides full, administrative control in any Unix/Linux system.  It is like the "Administrator" account in Windows.)  It is a lawful act to obtain this access - known as a "jailbreak" - for any device which you own.   And by doing this, you can open up the range of applications and technologies that the device can address, regardless of the restrictive trade practices that device makers employ to limit the capability.

Once the iPad was unlocked, and SSL and SCP were configured and made available, I was able to install sAPL and APLSE on it.  I also installed Borland 3.0 C++, and compiled the Blowfish encryption algorithm, to confirm that DOSpad (the PC-DOS emulator available for the iPad) behaved correctly.  The generated .EXE files for Blowfish on Android with gDOSbox, Windows XP/SP3 CLI (Command Line Interface), and those compiled on the iPad under DOSpad are all isometric. 

I've also built and deployed thru the Google "Play Store", some interesting apps on the Android platform.  These include gDOSbox, GNUplot37, and several APL interpreters.  The Android software is experimental, and does not contain any usage tracking or in-app advertising.  I did this project mainly because I wanted to run a real APL on a tablet, as APL was the first language I learned, at University of Toronto and Univesity of Waterloo. 

APL was (and is) unique in that it provided real-time, interactive computing, before the advent of personal computers and tablets.  Ken Iverson, the inventor of APL, originally developed the language as a notational tool to express algorithms.  IBM then took the idea, and built the interpreter.  Personal computers - which ran only APL! - were developed and sold by IBM in the early 1970's. (A prototype was made available to some clients in 1973.  It was a complete personal computer - called "Special Computer, APL Machine Portable" (SCAMP), and it ran APL.)  For those of us involved in computing in those early years, APL was the only real-time, interactive computing environment, and it was the first desktop, personal-computer system, as well.

So I just had to put APL on these little tablets. Big Grin

The website here is a work-in-progress.   It consists of:

  - APL on an iPad  - the notes on how to hack the iPad, and open it up to installation of non-Apple/iTunes software.   Also includes a link to my github site, where a zip file of the P/C version of sAPL files can be obtained.  sAPL is freeware, and can run in "Cmd" shell on any Windows machine, as well as Android gDOSbox, or iPad DOSpad.  (See below)

  -  GEMESYS Apps on Android - just a short summary.  This software is experimental, and is provided primarily for educational and recreational use.  Google keeps changing Android, and this makes the Android environment fragile and unstable.  Note that if you are running Android Lollipop or Marshmellow, you will need to download and make as the default, the "Hacker's Keyboard", to use the GEMESYS Android apps now, as Google has altered Android system keyboard operation.  (See below...)

  - Fractal Examples on iPad using APLSE  - I show two recent images generated using APLSE running on the iPad. (Also down below...)

  - GNU gcc & Python 2.7 - How to Compile & Run C programs natively, and install Python  - Application development for tablets typically involves IDE's and a bunch of stuff to fabricate vendor-locked packages.  With a *jailbroken* iPad, you can load GNU gcc onto it, and develop and run C programs right on the device. The underlying iOS is very unix/linux like, and can be used effectively on its own, as a fully functional computer, once tools are made available.  Python 2.7.3 can be installed also. (First button, top line)

  - OpenWatcom Fortran-77 - How to run Fortran on an iPad - This is another DOSpad trick, where OpenWatcom Fortran77 is shown configured and running on the iPad. 

  - How to Put VLC on iPad-1 - Apple will not let you access the older versions of applications from their iTunes/iStore.  They want you to buy a new device - each year, it seems.  But if you jailbreak your iPad, you can get the .IPA file from the VLC archive, and install it with Install0us.  VLC is fully open-source, and will let you watch downloaded .FLV (Flash Video) files.  VLC 2.1.3 for iPad-1, running iOS 5.1.1 is Taro-approved.

  -  Pictures from Space - I have a research-interest in Chaos Theory, and fractal geometry, turblent flow, and so on, with specific reference to the Capital Markets.  Images from  space show astonishing variety of fractal examples.  The recent Juno probe shows amazing images of the turbulent flow of the atmosphere of Jupiter. (Second button, top line). The ISS also shows wonderful space-views of our home-world.

   -  Economics and the Stock Market.  (What I studied (officially) when I was at school).  And since we pay the bills as much by our investment results, as by our consulting efforts, the markets remain a constant and critical focus.  I will try to note some useful observations here. (Third button, top-line)

  -  Statistics & The Null-Hypothesis.  A very great deal of what is written about statistical methods, and the mathematics of data-science oriented research, is either incoherent or incomprehensible.  I ran across this well-written note, and before it is vandalized by professional statisticians who seek to raise the barriers to entry to their dark-arts, I thought it should be preserved.  I will try to add some clear examples of actual research.  I used to use SPSS, SAS and R.  Awful stuff, but data analysis can yield wonderful dividends, if it is done right, and you understand *exactly* what you are doing.  (Button 4, top-line)

  -  Hausdorff (Fractal) Dimension Examples and Explanations - lifted from other websites (which may change).  The examples and explanations are good, and I wanted to preserve them. (More button / top line)

  -  Images and notes on Time Travel (Why not?  It's my site!) {#smileys123.tonqueout}And who does not love the idea of Time Travel?   We are all time travellers, aren't we?  The past offers us insight, and the future, opportunity.  But what will the future hold - pleasant dreams or our worst nightmares?    (More button / top line)

Any comments or questions can be addressed to gemesyscanada < a t > gmail dot com.  (I spell out the email address here to limit the spam robots from mail-bombing me.  I trust you can understand the syntax.)

  -  TensorFlow/Xerion Neural-Network Development.  This is my latest thing, and I hope to use this new (old) technology to pull together a number of threads, and get to a better method.  If Thaler's work is right (based on Kahneman and Tversky), my weakness and deep loss-aversion will just keep me from taking action, when it is needed most.   It appears one must effectively automate all investment activity, if one is to have any chance nowadays.  The low-return world demands it, as do the AI/algorithmic-driven modern markets.  One cannot fight the world - one must dance with it. Wink Note - I started out planning to use TensorFlow primarily, but I could not get it to run on my Linux boxes.  I finally got it running on my MacBook, but I found I was also able to get Xerion running on my modern Linux machines.  Xerion is the Univ. of Toronto product Dr. Hinton's team developed in the late 1990's.  It is written in C and Tck/Tk, and it is also complex, but I know it well.   I had originally run Xerion under Slackware Linux, in 1995-8, and had built neural-nets to forecast commodity markets.  At first, compiling Xerion under gcc generated a blizzard of errors. But I made a number of minor changes, and used a 2008 gcc 4.3.0 version (with some custom-hacked stuff to address gcc 1990's-isms), and also downgraded Tcl/Tk from 8.5 to 7.6.   The running Xerion (with examples shown) runs on Fedora Linux boxes, and works surprisingly well.  Much better than I expected, actually.  I re-ran some of my old stuff from the 1990's (the D-Mark forecaster) as a regression-test, and confirmed I could generate exactly the same results, right down to the GNUplot graphics, viewed using Ghostview (I'm using GPL Ghostscript 8.6.3), as GNUplot will generate both .jpg and postscript output files).  I hope to transition some work to TensorFlow, soon.  But the Xerion stuff - using this signed boolean jump-delta idea, seems also to work *much* better than I expected.  It is actually kind of exciting, truth be told.  I have this sAPL workspace, "neuralxr", running on the iPad,  which I think I can extend to basically run (ie. "activate") the Xerion-trained "MarketNet", for an experimental series I have been focusing on for years.  If you look carefully, you can see the target is CM.  I use CM because it has unique, serial-autocorrelation characteristics - like a junk-bond, actually.  If you think of equity as basically a 100-year bond, then this stuff, with its curiously high yield, is basically just a long-duration not-really-but-trades-like-it high-risk, high-yield bond.   I have no formal connection with CM of any kind, except a small LOC on my farm (full disclosure) from them, which is undrawn.  Another property that makes CM unique among Cdn banks, is its historical commercial roots.  They are risk-taking real bankers, who get out and make loans.  It's a risky business, but it is also very profitable.  And I have an old high-school buddy (more full disclosure) who runs a major regulatory organization that manages the macro-prudential systemic risk monitoring of Cdn SIFUs, and I am confident his guys are doing their jobs.  But let me stress, I have no special knowledge, beyond what I read in the papers, and on the wire services.   Banking is just one of those wild-good business models.  As long as you don't blow-up, given the modern world (buckets and buckets and buckets of fiat money created everywhere, all the time, by just about everybody - and without any recourse required to turn it into gold or latium-bars or anything but computer bits), banking only really has the system-risk of hyper-inflation that it has to deal with.   In a world awash with fiat-cash, even if you make too many bad loans, as long as you ensure adequate collateral (Canada has a long tradition of 75-25, for example - banks won't loan more than 75% of value without CMHC or someone else taking the hit if the loan sours), then worst-case, you stop making money for a while.  For example, on my farm, which is worth 7 figures maybe?, and has *no* mortgage at all, the LOC is only 5 figures, and is not even drawn.  In the part of the Province where I live, this is typical.  Farms around here often sell for cash, or with financing arranged by family connections.  Yes, the large commercial loans banks make can go south, and then you have to set aside reserves.  But the capital requirements are tough and fiercely enforced here.  As we drive towards the future, Canada looks more like the Switzerland of the Americas, rather than the "Argentina of the North" some used to term it.   I also target CM in my NN example because it is a good trader's stock - lots of action, whether you like it or not.  The jump-delta table wants to be full of lots of -1's and +1's, not just a bunch of zeros, right?  So it is obvious then, that you want to train to a target that demostrates beta greater than one, and has a Hurst exponent that does not converge on 0.50 over time.

Neural-Net run on iPad using sAPL

I have hacked and "jailbroken" my iPad Gen-1, and have loaded sAPL on it.  This was the APL product I originally released on the Blackberry Playbook, and remains available for Android devices, from the Google PlayStore. (A Windows Cmd-shell and/or DOSbox version of sAPL is available from the GEMESYS Github account, as a .zip file.)   sAPL is a P/C version of the original IP Sharp APL mainframe product, which ran on IBM 370's, and Amdahl V8's.  This iPad version, running under DOSpad, provides a workspace just over 300K.  It is a small, but reliable, implementation of a full APL.

See the section: "APL on iPad" for details on what had to be done to put APL on the iPad.

I've built a small sAPL workspace, as a proof-of-concept, that accepts the weights, bias values, and structure of a trivial Xor2 (boolean exclusive-or) neural network, trained using Xerion, which can be activated (ie. run), on the iPad.  This has potential applications, as it would allow a complex network to be trained on a research machine, and then the network's weights and structure can be transfered to the iPad so that evolving, real-time scenarios can be entered on the fly, by someone who wants to query what the trained network's "thinks" of a possible data-scenario.  It's a simple approach, but might be useful.  An example of the simple Xor2 network being activated is shown to the right.

GEMESYS Apps for Android - on the Google Play Store:

gDOSbox has over 50,000 downloads on Google Play Store

The following GEMESYS Android Apps are available on the Google Play Store:

gDOSbox  -  This is a full-featured implementation of the DOSbox-0.74 open-source DOS emulator for Android.  It was developed for Android version 4 (KitKat series), and was recently upgraded to work on Android 5 series (and above) devices.  Recent changes by Google to their keyboard have caused issues on some devices, so we strongly recommend the "Hacker's Keyboard", by Klaus Weidner. 

Download "Hacker's Keyboard" from the Google Play Store, then use the Settings icon, scroll to "Language and Input", and select/invoke the "Hacker's Keyboard".  Then, in the "Default Keyboard" option, choose the "Hacker's Keyboard" as your Default Keyboard.  The Google keyboard attempts to hijack *all* user input, and damages the gDOSbox interface routines.

gDOSbox is a full DOS implementation, with corrected math routines, which allows DOS .exe files to be run on an Android tablet. 

GNUplot37 - A version of the GNUplot graph generation tool.  Allows data to be quickly plotted in two and three dimensions, as well as supporting math processing, and curve-fitting to data, and displaying the result.  Try it with:  "plot sin(x)" to see a sign wave.  Then load the demo (hundreds of examples) with "load 'all.dem' ".   To clear the screen, (if using an on-screen keyboard), use "!cls", and use "!dir /p" to review all the GNUplot examples available.

sAPL      -    The original IP Sharp 32-bit APL, which runs in an emulated IBM 360/75 environment as series of .exe files, orginally released to run on IBM P/C's, and them made into a freeware product by IP Sharp, to encourgage APL usage education. APL characters are generated by ALT-key (eg. ALT-L creates the APL quad character, ALT-[ creates the assignment operator, etc.), so the Hacker's Keyboard is required.

APLSE    -   The STSC APL freeware product, directly downloadable from the PlayStore.  (You do not need to install gDOSbox, it is loaded first).  This is an excellent small-footprint APL, which has full graphics support.  It is reliable, and was released as a freeware product to encourage and assist APL education.  Like sAPL, the APL characters are created using ALT sequences, so ALT-[, for example, is the assignment operator.  The "Hacker's Keyboard" is required.

TryAPL2  -   The IBM full featured "TryAPL2" product, which allows a subset of early APL2 to be run on a P/C.  This is a working APL, which includes IBM's variant of the enclosed-array extensions.  APL characters are generated with shift-letter sequences, so gKeyboard can be used with this APL.

WatAPL  -    The original Watcom APL, circa early 1980's.   This was recovered of of an original Watcom APL System floppy diskette, and dates from 1984.  It can be used with the gKeyboard, as the APL characters are generated with Shift-key sequences.

gKeyboard - A basic keyboard, with the APL characters shown on keytops.  Useful for TryAPL2 and WatAPL, and for learning the location of APL characters on the keyboard.

All GEMESYS software is freeware for educational purposes, and contains *no* advertising or in-app usage monitoring or tracking.

The seven GEMESYS apps for Android. No *root* access is required to run any of them!

Examples - iPad/Samsung Tab-A as "AI-Helper" platform, Xerion Xor2 Example, TensorFlow Linear Regression Example

The freeware APL,  APLSE, can be run on the iPad, using appropriate emulation. As an example,  I calculate and generate a graphic of the Logistic Equation phase-space, as a fractal example.  For those who study or work with fractals and Chaos Theory, the "Tent Map" is well known.  That was my first example.

I also have GNUplot37 running on the iPad and it is available from the Google Playstore as an Android app (no adverts, no in-app monitoring, no scams) , and it can be used to visualize a variety of numeric datasets.  Three examples are shown below (all running on my customized, jailbroken iPad, which once jailbroken, functions as an effective Linux/Unix tablet computer.)

The electrostatic field display (see the hundreds of tiny, pointing vectors?), is an example from the GNUplot37 demo programs.  It takes about 12 minutes to run on the iPad, but the information it conveys is impressive.

As straightforward economic series - London Gold price 10:30 AM fixing, daily-data, from 1965 to 2016 is shown.  If you look at long duration, accurate price-series, you can see the mechanism of market dynamics fairly clearly.    The boom-bust sequences in the spot gold market are typical of *all* financial markets.  That is why the attempts by American and European legislators to over-protect the financial system are deeply misguided.  Markets *require* the freedom to bankrupt foolish people who mindlessly follow trends, and enrich those who deploy risk-capital in places where real risk is present.  Risk needs to be recognized as a very real part of how markets do their job.  Remove risk, and you remove the effective, allocative intelligence of market behaviour.  Political people are often quite unable to grasp this simple truth.  Prices have to *move* and sometimes, move *a lot*, in order to do their job correctly.  Blaming markets for bad outcomes, is as unwise as blaming oxygen for causing a fire.

The last iPad display example shown is 3-d graphic showing a surface generated by a trigonometric function, again GNUPlot37 on my hacked iPad. 

My Vision for the AI-Augmenter (or AI-Helper..)

My vision for the AI-Augmenter (or AI-Helper), involves having a series of well-trained neural networks on a tablet device, and being able to interrogate them with current data, and get an "opinion" from them - and possibly display this amalgam of the AI's opinion in a graphic format that a human is comfortable interpreting - perhaps like a cross between the electrostatic field display (a bunch of little pointing vectors), and the 3-d surface, shown in the last example.

Examples of Xerion running the simple Xor2 network on a Linux development box are shown, as is an example of TensorFlow (the Google AI toolset, recently open-sourced), running on my MacBook Pro.  I find working on the MacBook Pro annoying and irritating, and just getting Python to successfully load and access all the libraries needed to run TensorFlow was more work than porting Xerion to a modern Linux, and getting a clean compile from the source.  I had to down-convert Tcl/Tk from 8.5 back to 7.6 and such, but that was not a huge hardship or difficult exercise.  The MacBook Pro hardware is very fine, but the Apple software is carefully designed to aggressively benefit Apple, regardless of the grief it causes independent developers.

Given that Microsoft was accused of being a "monopoly", and faced lawsuits for simply including a browser in its Windows O/S, I remain astonished by the extensive, and unchallenged use of monopolistic strategies that Apple gets away with.  They have restrictive dealer pricing, a "you-can-only-do-your-business-through-our-company store" policy that is a classic strategy of a monopolist, and they want additional cash-payments just to access development tools that are required to write computer programs that are to run on other Apple hardware.   In the 1970's, when IBM attached similar restrictions to their mainframe machines, they were successfully prosecuted by the US Justice Department for monopolistic, anti-competitive behaviour.   I like Apple hardware (which is built off-shore), but the code inside iOS that initiates the "Killed: 9" response when I attempt to run a gcc-compiled C-program, seems more like a monopolist's strategy, than it does a legitimate attempt to protect the system integrity. (See the "GNU gcc & Lynx" section, top line of this site to see what I am referring to.)

Very recently,  Google has annouced it will offer (as open-source), something called "TensorFlow-Lite", which will allow a subset of TensorFlow to operate on a tablet.  This is a very wise idea, and typical of the cleverness the Google folks demonstrate.  The most effective place for an AI tool is right in the hands of the client.

And this is key:  It has to be *unique*.   If AI is to have any benefit for me - especially in a complex, dangerous, tactical situation - it will have to offer something unique that only I have - it must offer me an *edge* of some sort. It need only be a tiny edge (as most are), but it will be the capacity of AI-Helper tools to offer that custom edge, that will make them quickly indespensible.  Once your "AI-Helper" gets understood to be offering you a real, actionable advantage - it will quickly become essential - like a telephone was to a stock-broker of old, or an automatic assault rifle is to a soldier in the battlefield.

The three iPad images below, were made with GNUplot37, which runs on the jailbroken iPad, under the DOSbox port, called "DOSPad-Gsys". The old Ver. 1.0 iPad can be a fully-functional, and useful computer, once the Apple iOS restrictions are bypassed.  The field-lines display is particularly interesting, as it requires substantial floating-point math calculations to create.

London 10:30 AM Spot Gold Price - 1965 to 2016, rendered on iPad, using GNUPlot37, running under DOSpad Gsys.

Example of Surface Plot - 3-D, using GNUplot37 - with contours, and accurate math processing.

Left side is Xerion on Linux, right side is Actnet function in sAPL on iPad, with same network weights. Example training cases produce same network output, both platforms.

Here is the Probability Calculator running on the jailbroken iPad. This shows an estimated probability density function for a possible trade with a 20-day duration. The underlying market database can be migrated to the iPad from the desktop box via secure copy (Linux utility "scp", given that one has Cygwin tools to support "ssh" (secure shell) on the Window's box that maintains the data. ). The idea, of course, is to have a series of neural networks watching all the data in something close to real time, and migrating information like this to the tablet, where visualization can be used to sanity-check the network's recommendations, before pulling the trigger on any given trade.

Wine-2.0.1.tar.xz checksums (MD5 and Sha256). I've just downloaded the stable Wine 2.0.1 code, and have now migrated my Time Series Manager to Linux - currently Fedora and CentOS.

Windows .EXE's for TSM and Gnuplot, running on CentOS 6.6 (Linux kernel 2.6.32-504.el6.i686), using a Pentium 4 (2.40 GHz) cpu, with only 2.0 GiB memory. I built this box just as an experiment (old 32-bit processor), but it runs so well, I can run a WEBrick Rails web-server as well as the old analytic stuff, and it is still snappy quick.