I have some formulas from a paper (Provably Manipulation-Resistant Reputation Systems) that I would like to run 3 times (with different nummbers).
Therefore, I wrote a small programm that now finally works ... and bam:
This computation has exceeded the memory limit for your plan
I didn't know something like this could occur.
Is there anything I can do to improve my code so that it runs to completion?
Formulas:
This is my code (first time coding with Wolfram|Cloud):
unr = 4;
lnr = 3;
size = unr * lnr;
eps = 0.2;
e = SparseArray[{{2, 3} -> -1}, {size,size}];
n = Array[f , {size,size}];
bounds = (If[0 <= # <= 1, True, Throw[False], Throw[False]])&;
checkLessEquals = (Catch[Map[bounds, #, {2}]; Throw[True]])&;
prod = (Total[#1*#2, 2])&;
ArgMax[
{eps * prod[e, n] + Log[Det[n+IdentityMatrix[size]]],
checkLessEquals[n] && PositiveDefiniteMatrixQ[n]},
Flatten[n]]
Det[]
? Note that you should be able to work out for yourself what the Determinant is with relative ease! It's a lot of work, but this is what hangs your calculation. $\endgroup$checkLessEquals[n]
andPositiveDefiniteMatrixQ[n]
both evaluate toFalse
. $\endgroup$