I'm looking for a way to visualize evolution of histogram over time. You have $n$ timesteps, each with its own set of data, and I want to create $n$ histograms and visualize them as a density plot. Basically I want to demonstrate how the distribution of a 1-dimensional quantity changes over time.
In my weights and biases project it looks like this:
A concrete application for Mathematica is below. I'm using ListPlot to visualize it, but ListPlot doesn't quite have the right look.
Ideally it would look like a density plot, perhaps with some marking separating the region of 0 density from non-zero density. Any tips appreciated!
numSamples = 100;
numSteps = 1000;
SeedRandom[1];
p = 1;
n = 200;
alpha = 1.5;
sampler =
Switch[n, 2, CirclePoints, 3, SpherePoints, ,
RandomPoint[Sphere[n], #] &];
xb0 = sampler[numSamples];
h = Table[1/i^p, {i, 1, n}] // N;
hb = Table[alpha h, {numSamples}];
batchStep[xb] := xb - hbxb;
xTrajectories =
NestList[batchStep, xb0,
numSteps - 1];(numSteps x numSamples x n)
yTrajectories =
Map[Total[#h#] &,
xTrajectories, {2}];(numSteps x numSamples)
(turn into ListPlot
friendly format)
(augment=Compile[{{trajectory,_Real,1}},MapIndexed[{First@#2,#1}&,
trajectory]];
logyTrajectories=augment/@Transpose[Log@yTrajectories];(numSamples,
numSteps,2) )
logyTrajectories = Transpose@Log@yTrajectories;
meanTrajectory = Mean[logyTrajectories];
logyTrajectories = (# - meanTrajectory) & /@
logyTrajectories; ( decenter )
logyTrajectories =
Transpose[
RandomSample /@
Transpose[
logyTrajectories]]; ( randomize *)
ListPlot[logyTrajectories]








