Hello I'm trying to implement numerical methods in Excel. The first step is to create equation function and it seems work.
But when m is more than 170 I get the error type mismatch
Function PoissonEqs(p As Double, m As Integer)
If m = 0 Then
PoissonEqs = Exp(-p)
Else
PoissonEqs = Exp(m * Log(p) - p - Log(Application.Gamma(m + 1))) + PoissonEqs(p, m - 1)
End If
End Function
Sub test()
Dim a As Double
Debug.Print PoissonEqs(193.063, 170)
End Sub
For m 171 p is 194.125.
I need to get m as 1000 as the least.
Regards,
Alex