Category Archives: mathematica

Historical global Big Mac prices

Somewhere in the world a hedge fund manager has bought a Ferrarri with trading profits made possible by the following data:

indices = {"BIGMUS", "BIGMBZ", "BIGMMX"};
data = Map[
msBBGhistory[# <> " Index", "Px_Last", {1997, 1, 1}, "",
"Monthly"] &, indices];
DateListPlot[data, PlotStyle -> {Red, Blue, Purple},
PlotRange -> {1.1, 6.4}, Frame -> {True, True, False, False},
PlotLabel -> "Global Big Mac Prices (USD)",
Epilog -> {(Text[Style["U.S.", FontFamily -> "Calibri", FontSize -> 10, Red], {{2012, 1, 10}, 3.8(*vertical position*)}]), (Text[Style["Brazil", FontFamily -> "Calibri", FontSize -> 10, Blue], {{2011, 11, 1}, 4.9(*vertical position*)}]), (Text[Style["Mexico", FontFamily -> "Calibri", FontSize -> 10, Purple], {{2012, 1, 10}, 2.4(*vertical position*)}])}, ImageSize -> Large]

Historical big mac prices, U.S., Mexico and Brazil

Visualizing relationships between dynamic variables, part iii

Principal component analysis can be a powerful tool for detecting similarity between time series, and whether a series ceases to resemble one group of signals and begins to resemble another. I extract three principal components and create a three-dimensional dot plot. My function msPCABoxNF3[] used to label each dot with an Epilog, but with Mathematica 11.3 it became possible to use Callout[]s instead.

msPCABoxNF3[allChNF3sA, "names" -> "names", ImageSize -> Large]

We can show the evolution of these relationships over time using Manipulate[] (a snapshot of the tool is shown below)

msEvolvingPCABoxNF3[allChNF3sA, 20, "spacing" -> 200, "names" -> "tickers", ImageSize -> Large]

Mathematica can also export videos of these things, as shown below. The following runs a bit quicker than I would like but I’m not going to solve the problem for the sake of this post.

Visualizing relationships between dynamic variables, part ii


msCorrelationMatrix[allChNF3sA, "noisy" -> False]


msCorrelationMatrix[allChNF3sA, "noisy" -> False]





Dec 2004

Jan 2008

May 2008

July 2012

It stays like that to the current day.

Tomorrow, principal component analysis.

Visualizing relationships between dynamic variables, part i



"NDDUWI Index"}; hfNF3 =
allNF3s = Prepend[bogiesNF3, hfNF3];
hfChNF3 = msChanges[hfNF3];
bogiesChNF3 = msChanges /@ bogiesNF3;
allChNF3s = Prepend[bogiesChNF3, hfChNF3];
allNF3sA = msIntersectionData[allNF3s];
allChNF3sA = msIntersectionData[allChNF3s];







Another unexpected dataset in Bloomberg

tickets =
FrameTicks -> {{Table[{i,

Observe the internet happening