You got the position specification wrong. PosicionECMMin + 1
in your answer is not the scalar it is supposed to be.
As M. Stern points out, the most straightforward way to fix this is to replace
PosicionECMMin = Position[ECMEst, Min[ECMEst]]
in your code, with
PosicionECMMin = Position[ECMEst, Min[ECMEst]][[1, 1]]
This also works:
{EspEst, VarEst, ECMEst} = RandomReal[1, {3, 4}];
PosicionECMMin =
Prepend[FirstPosition[ECMEst, Min[ECMEst]], 4] + {0, 1};
Grid[{
{"", "T1", "T2", "T3", "T4"},
Prepend[EspEst, "Esperanza"],
Prepend[VarEst, "Varianza"],
Prepend[ECMEst, "ECM"]
},
Frame -> All,
Alignment -> Center,
Spacings -> 2,
Background -> {None, None, PosicionECMMin -> Green}
]

Another approach would be to not use the Background
property, but to use Item
instead:
PosicionECMMin = FirstPosition[ECMEst, Min[ECMEst]];
ECMEst = ReplacePart[ECMEst,
PosicionECMMin ->
Item[Extract[ECMEst, PosicionECMMin], Background -> Green]]
Grid[{
{"", "T1", "T2", "T3", "T4"},
Prepend[EspEst, "Esperanza"],
Prepend[VarEst, "Varianza"],
Prepend[ECMEst, "ECM"]
},
Frame -> All,
Alignment -> Center,
Spacings -> 2
]
The Item
approach can also be used with TableForm
:
{EspEst, VarEst, ECMEst} = RandomReal[1, {3, 4}];
PosicionECMMin = FirstPosition[ECMEst, Min[ECMEst]];
ECMEst = ReplacePart[
ECMEst,
PosicionECMMin -> Item[Extract[ECMEst, PosicionECMMin], Background -> Green]
];
TableForm[
{EspEst, VarEst, ECMEst},
TableHeadings -> {{"Esperanza", "Varianza", "ECM"}, {"T1", "T2", "T3", "T4"}}
]

Beware that the Item
approach modifies ECMEst
. If you intend to keep doing other work with ECMEst
then you'll want to copy the values to another variable first.