The International Space Station - image-capture from HDEV experiment, Oct. 2, 2017, showing Earth and terminator in background. Even if we cannot predict the future, we can certainly create it.

Current 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 eduction 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 2.6.27.25-78.2.56.fc9.i686 #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 work):

[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.  How about that, eh?  Science sorta 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 stupid 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 complete bullshit.  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: https://www.freedesktop.org/wiki/Software/PulseAudio/FAQ/#index16h3  

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.  https://www.youtube.com/watch?v=-ux3DMkbCrA

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 idiotic streaming technology.  All non-live video should just be downloaded and localized.   Streaming a static file is crazy, but of course, the money for Google and Netflix is not, and given the horrible DMCA, a broken, crappy 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...

https://www.moneytalkgo.com/video/q3-canadian-bank-earnings-round/?referral=gemesyscanada

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.

https://www.youtube.com/watch?v=GIYGPr539Ss

https://www.youtube.com/watch?v=KHTUHT4kAOY

 

[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.

https://www.youtube.com/watch?v=wmw5eGh888Y

[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.

https://securityintelligence.com/after-big-takedown-efforts-20-more-bankbot-mobile-malware-apps-make-it-into-google-play/?otm_medium=onespot&otm_source=onsite&otm_content=articles-units:right-rail-unit&otm_click_id=foplease

[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:  https://www.theregister.co.uk/2017/08/21/gchq_knew_marcus_hutchins_risked_arrest_fbi/

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.

https://blog.malwarebytes.com/cybercrime/2017/08/inside-kronos-malware/

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:  http://www.aiai.ed.ac.uk/events/ccs2002/CCS-early-british-ai-dmichie.pdf

Prof. Michie's CV is still online, as is his publications list.  http://www.aiai.ed.ac.uk/~dm/dmpubs.html

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.    

URL: https://finance.yahoo.com/news/citigroup-pay-130-mln-end-231141984.html

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: https://www.youtube.com/watch?v=68D7z04CR8c

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:  https://en.wikipedia.org/wiki/Bayesian_inference  (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:  http://me.bios.io/ME:About   There are experimental "ME-Disable" routines, which flash part of the firmware with hexFF, but try to keep the BIOS BUP (boot-up) stuff: https://github.com/corna/me_cleaner  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: https://www.winehq.org/announce/2.0.1     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 mktnet3040.in     (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.)
12
> bp_groupType MarketNet.Output     (confirm nodes are correct configuration...)
OUTPUT DPROD TANH SUMSQUARE

> 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: http://ftp.cs.toronto.edu/dist/xerion/  and the documentation is at:  ftp://ftp.sys.utoronto.ca/dist/xerion/tutorial.ps.Z   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.  (J-sys...how 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: http://www.ethistory.ethz.ch/rueckblicke/departemente/dinfk/forschung/weitere_seiten/lilith/index_EN/popupfriendly/)   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:  http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.2.1.tar.gz  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: http://yasm.tortall.net/.  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: http://www.mplayerhq.hu/MPlayer/skins/Blue-1.12.tar.bz2 , 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.  https://deepmind.com/blog/open-sourcing-sonnet/  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:
    # ---                                     https://www.tensorflow.org/tutorials/pdes
    # --- and provides a nifty example of manipulating n-dimensional tensors.
    # ---
    # --- For Python newbies (me!):   1) invoke Python in terminal shell
    # ---                             2) >>> execfile("LaplaceMCL.py")
    # --- 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 "requirements.py" 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 "requirements.py" 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:  https://www.schneier.com/blog/archives/2013/10/air_gaps.html    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 "repo.biteyourapple.net" and "repo.insanelyi.com" 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.

Prototype of an Augmenter-AI. Do the kind of data-science you need to do to actually make money, and run it on an Android tablet you can carry in your pocket. The example here is Samsung Tab-A, running Android 6.01 and gDOSbox running APLSE. Your counterparties are *all* using AI technology, so each fellow in the field (or the barn) had better have access to it as well.

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.