/3/22 13:50:47 In[54]:=
Clear[f,g,b,A,B,q,,Obs,freq,listPMF,logPMF,LLFunc]
I have this recurrence formula, ​
f(0)=
-m

,f(x)=
m
x
x-1
∑
j=0
(j+1)b(j+1)f(x-1-j)
, where
b(j)=A
j-1

(j-1)!
-B
j
q
j
,A>0,B>0,>0,0<q<1
. Assume that the probability model is correct.This formula applied to calculate the maximum log-likelihood value. The problem is that the expression grows massive. Despite running my machine for several days, the computation are went into an infinite amount of period, and I had to kill the kernel multiple times.

Data: observed random variable (Obs) and observed frequency (freq)

Obs={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,48,51,74};
freq={39,8,12,11,10,6,7,14,21,17,21,15,15,20,27,28,15,14,21,19,22,19,21,18,19,17,14,21,15,12,11,17,14,14,12,15,5,7,4,2,6,2,2,2,1,2,1,2,1};

Method1 to generate list log-likelihood function

Block{b,x,j,A,B,,q},b[j_]:=b[j]=A
j-1

(j-1)!
-B
j
q
j
;​​g=Table[b[j],{j,1,76}];​​listPMF={Exp[m]};​​TablelistPMF=listPMF,
m
x
Sum[(j+1)g[[j+1]]listPMF[[x-j]],{j,0,x-1}]//Flatten,{x,75}//Last;
Remark: Too slow. Aborted! :(

Method2 to generate list log-likelihood function

Block{b,x,j,A,B,,q},b[j_]:=b[j]=A
j-1

(j-1)!
-B
j
q
j
;​​g=Table[b[j],{j,1,76}];​​listPMF={Exp[m]};​​TablelistPMF=HoldComplete@@AppendTolistPMF,
m
x
Sum[(j+1)g[[j+1]]listPMF[[x-j]],{j,0,x-1}],{x,75}//Last;
Remark :
1. Using HoldComplete make it appears to have generated the list faster .
2. It is taking again an indefinite amount of time to access the list elements, if number >= 20, for the computation .
3. Finally, I has only to put an end to the kernel :(

Method3 to generate list for log-likelihood function

Block{b,x,j,A,B,,q},b[j_]:=b[j]=A
j-1

(j-1)!
-B
j
q
j
;​​f[0]:=Exp[m];​​f[x_]:=f[x]=
m
x
Sum[(j+1)b[j+1]f[x-1-j],{j,0,x-1}]
Monitor[listPMF=Table[f[x],{x,Obs}],Grid[{{Text[Style["Generating PMF:",Darker[Blue,0.66]]],ProgressIndicator[x,{1,75}]},{Text[Style["Observed count in process: ",Darker[Blue,0.66]]],x}},Alignment->Left,Dividers->Center]];
Remark: It appears to be executed more quickly, which could be due to the semicolon (;).
Otherwise,it simply hung up for an unknown amount of time. :(

To build the log-likelihood function

logPMF=Map[Log,listPMF];
Remark : I' ve used listPMF variable generate from the method 3 in this case.
/3/22 12:03:27 In[20]:=
Shallow[logPMF]
/3/22 12:03:27 Out[20]//Shallow=
{Log[Power[2]],Log[Times[3]],Log[Times[3]],Log[Times[3]],Log[Times[3]],Log[Times[3]],Log[Times[3]],Log[Times[3]],Log[Times[3]],Log[Times[3]],39}
LLFunc=Apply[Plus,freqlogPMF];(*Objectivefunction*)
/3/22 13:33:10 In[48]:=
Shallow[LLFunc]
/3/22 13:33:10 Out[48]//Shallow=
39Log[1]+12Log[1]+11Log[1]+10Log[1]+6Log[1]+7Log[1]+14Log[1]+21Log[1]+17Log[1]+21Log[1]+39

Overall purpose: For computing the log-likelihood function value

NMaximize[{LLfunc,0.01<m&&0.01<A&&0.01<&&0.01<B&&0.01<q<0.99,Element[{m,A,,B,q},Reals]},{m,A,,B,q},Method{"SimulatedAnnealing",​​"BoltzmannExponent"Function[{i,df,f0},-df/(Exp[i/10])],"InitialPoints"Flatten[Table[{i,j,k,l,m},{i,1.,4.,0.1},{j,4.,6.,0.1},{k,4.,6.5,0.1},{l,5.,7.,0.1},{m,0.9,0.998,0.1}],1],"SearchPoints"50,"PerturbationScale"3}]
Remark : Before I aborted it again, I waited more than 24 hours for a result glance. In all cases i cant access the list elements more than 20.

WolframMark Benchmark Report

Machine Name:
laptop-if53vd2c
System:
Microsoft Windows (64-bit)
Date:
March 3, 2022
Wolfram Language Version:
12.3.1
Benchmark Result:
1.35

WolframMark Results

WolframMark
DetailedTimings
Total
Test 1
Test 2
Test 3
Test 4
Test 5
Test 6
Test 7
Test 8
Test 9
Test 10
Test 11
Test 12
Test 13
Test 14
Test 15
Intel Core i7-3770 CPU @ 3.40GHz (8 cores)
Linux x86 (64-bit)
7.34
0.38
0.31
0.48
0.42
0.62
0.41
0.40
0.68
0.40
0.75
0.64
0.09
0.85
0.45
0.45
3.5 GHz 6-Core Intel Xeon E5
Mac OS X x86 (64-bit)
7.35
0.61
0.36
0.28
0.45
0.30
0.47
0.43
0.99
0.29
0.67
0.69
0.09
0.89
0.43
0.42
Intel(R) Core(TM) i5-3550 CPU @ 3.30GHz
Microsoft Windows (64-bit)
8.34
0.47
0.34
0.48
0.53
0.80
0.45
0.47
0.63
0.44
0.86
0.69
0.11
1.00
0.55
0.53
>> laptop-if53vd2c <<
Microsoft Windows (64-bit)
10.29
0.60
0.48
0.91
0.60
1.26
0.54
0.58
0.83
0.69
1.01
0.79
0.16
0.37
0.74
0.74
2.2 GHz Intel Core i7
Mac OS X x86 (64-bit)
11.49
0.84
0.47
0.49
0.68
0.83
0.58
0.53
1.64
0.73
0.82
0.92
0.12
1.20
0.88
0.75
3.07 GHz Core i7-950 (8 Cores)
Windows 7 Pro (64-bit) Desktop
13.84
0.80
0.98
1.00
0.80
0.84
1.00
0.98
1.00
0.78
1.06
0.95
0.89
0.97
0.92
0.86
2.93 GHz Core i7-940 (8 Cores)
Linux Ubuntu (64-bit) Desktop
15.65
0.94
0.99
1.14
0.92
0.80
0.81
0.88
1.51
0.89
1.31
1.16
1.14
1.41
0.89
0.86
Intel Core i7 CPU
Microsoft Windows (64-bit)
16.46
0.93
0.72
0.68
1.23
1.44
0.89
0.85
1.02
1.40
1.33
1.58
0.15
1.44
1.47
1.33
2 × 2.26 GHz Quad Core Xeon E5520 (8 Cores)
Mac XServe OS X (64-bit) Server
20.06
1.06
1.22
1.44
1.00
1.67
1.05
1.12
1.71
0.67
2.79
1.32
1.22
1.76
0.94
1.08
2.80 GHz Core 2 Duo Mobile T9600 (2 Cores)
Windows 7 Pro (64-bit) Laptop
20.67
1.12
1.20
1.90
1.06
2.04
1.17
1.15
1.61
1.53
1.61
1.19
1.06
1.22
1.25
1.56
2.4 Ghz Core 2 Duo Mobile T8300 (2 Cores)
MacBook OS X Snow Leopard (64-bit) Laptop
29.76
1.78
1.40
2.44
1.40
3.03
1.13
1.22
2.20
2.35
2.31
1.63
1.57
2.06
2.86
2.38
2.60 GHz Core 2 Duo Mobile T7800 (2 Cores)
Windows XP Pro (32-bit) Laptop
31.77
1.27
1.80
2.59
1.44
3.69
1.92
2.06
2.41
3.25
1.91
1.45
1.41
1.34
2.52
2.72
2.13 GHz Core 2 Duo E6400 (2 Cores)
Windows Vista (32-bit) Server
38.08
2.49
2.18
3.39
1.75
3.18
2.35
2.54
2.92
3.28
2.52
2.33
1.65
1.78
3.12
2.60
1.6 GHz Core 2 Duo Mobile L7500 (2 Cores)
Windows 7 Pro (32-bit) Laptop
43.81
2.17
2.75
3.74
2.26
4.23
2.90
3.14
3.46
3.42
2.73
2.48
1.92
2.11
3.39
3.12
2 × 2.00 GHz G5 PowerPC (2 Cores)
Mac OS X (32-bit) Desktop
100.91
4.61
4.64
10.91
4.94
19.50
5.16
5.01
5.70
5.21
7.17
3.33
4.87
4.28
9.74
5.84
ARMv6-compatible processor rev 7 (v6l)
Linux ARM (32-bit)
3010.75
31.84
15.55
84.43
144.46
183.05
16.49
20.02
28.88
1164.78
37.60
36.45
4.70
25.73
444.15
772.61
Timings are CPU time in seconds

​

​

​

​