mylik[data_, kdata_, model_: "BBB"] :=
Block[{K, pj, fj, N0, loglik, above, below},
K = kdata;
If[model == "BBB",
pj = Table[
w*PDF[BinomialDistribution[K, p], j]
+
(1 - w)*PDF[BetaBinomialDistribution[alpha, beta, K], j],
{j, 0, K}];
];
fj = Prepend[PadRight[data, K], f0];
N0 = Total[fj];
above = LogGamma[N0 + 1];
below = Total[LogGamma[fj + 1]];
loglik = fj.Log[pj];
loglik = above - below + loglik;
loglik
];
link3 = {679, 531, 379, 272, 198, 143, 99, 67, 46, 32, 22, 14, 9, 5, 3, 1};
klink3 = 20;
liklink3 = mylik[link3, klink3] // N;
NMaximize[{liklink3, f0 > 0, alpha > 0, beta > 0, 0 < w < 1, 0 < p < 1}, {f0, alpha, beta, w, p}, MaxIterations -> 1000]
NMaximize[{liklink3, f0 > 0, alpha > 0, beta > 0, 0 < w < 1, 0 < p < 1}, {f0, alpha, beta, w, p}, Method -> {"SimulatedAnnealing", "SearchPoints" -> 200}, MaxIterations -> 1000]
NMaximize[{liklink3, f0 > 0, alpha > 0, beta > 0, 0 < w < 1, 0 < p < 1}, {f0, alpha, beta, w, p}, Method -> {"RandomSearch", "SearchPoints" -> 200}, MaxIterations -> 1000]
NSolve[{0.1206 == alpha/(alpha + beta),
0.116 == 1/(alpha + beta)}, {alpha, beta}];
mletmp = Flatten[{%, p -> 0.5396, w -> (1 - 0.9892), f0 -> 871.3}]
liklink3 /. mletmp
A lot of the time, I am only getting -46.0252 for the target function. I want to get -45.7408.

This difference of the target function value may not be very big, but the estimate of f0 is significantly different.
I have tried all possible methods, with many starting points with no success. Is there anything else could be done?
RandomSearchthis may be beneficial). However, the values of the tuning parameters $F$ ("ScalingFactor") and $C$ ("CrossProbability") are absolutely critical to the success or otherwise of differential evolution. Did you adjust those? – Oleksandr R. Dec 16 '14 at 01:32ScalingFactor. I will read a bit onCrossProbabilityand have a go. It's just a bit frustrating that I can't get it to the desired values (when i know exactly what they are). – Chen Stats Yu Dec 16 '14 at 01:43"ScalingFactor"between 0.5 and 1, and"CrossProbability"either 0 to 0.1 or 0.9 to 1. (Try both possibilities. Small values are better for separable functions; large ones, for unseparable functions. Intermediate values do not work well in general, but despite this, the default in Mathematica is 0.5.) – Oleksandr R. Dec 16 '14 at 01:51