# Minimization Nminimize nnum error

I have imported data (mat is the name, 1x100 dimensional vector)and written a likelihood function for normal distribution.

f[miu_, sigma_] := -1/2 Log[2 Pi sigma] - (mat - miu)^2/(2 sigma^2)
Minimize[{Total[f[miu, sigma]] && miu ≥ 1 && sigma ≥ 1}, {miu, sigma}]


However this gives me error

NMinimize::nnum: Function value False at{miu, sigma} = {-0.936293, 0.280416}is not a number


Can anyone tell me what I am doing wrong?

• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. – bbgodfrey Apr 10 '15 at 2:51
• If this error occurs with a shorter vector, please provide it, so that readers can reproduce your problem. – bbgodfrey Apr 10 '15 at 2:54
• You are giving a Boolean expression in the place of an objective function. The error message kind of makes that clear.. – Daniel Lichtblau Apr 10 '15 at 15:21

mat = RandomVariate[NormalDistribution[2, 6], 200];
f[miu_, sigma_] := -1/2 Log[2 Pi sigma] - (mat - miu)^2/(2 sigma^2) // N // Total;
NMaximize[{f[miu, sigma], 1 <= miu <= 5 && 1 <= sigma <= 5},