I have a matrix that looks like this:
n1 = 5;
f[i_, j_] := With[{z := RandomInteger[j - 1]},If[i != j, RandomChoice[{z/n1, 1 - z/n1} -> {1, 0}], 0]];
s = SparseArray[{{i_, j_} -> f[i, j]}, {n1, n1}];
I want to generate a list of 100 matrices that looks like this:
n2 = 100;
s1 = Table[SparseArray[{{i_, j_} -> f[i, j]}, {n1, n1}], {k, n2}];
Now I want to build two histograms from the average of n2-matrices:
i) the frequency numbers one per line;
ii) the frequency numbers 1 per column.
From the distribution would get the kurtosis and skewness.
Can you help me?
z:=
causes the twoz
instances inRandomChoice
to have different values. Probably you want a non-delayedz=
$\endgroup$ – george2079 Sep 26 '16 at 14:29i
?Histogram[Mean[Flatten@#] & /@ s1]
$\endgroup$ – george2079 Sep 26 '16 at 15:27s1 = Table[SparseArray[{{i_, j_} -> f[i, j]}, {n1, n1}], {k, n2}];
generates 100 matrices 5x5 . The elements of each matrix are 0 or 1. I would like to build a histogram of the frequency numbers 1 obtained in each row and each column. $\endgroup$ – SAC Sep 26 '16 at 15:49