Greetings,
I am trying to put together a user defined function called risk of ruin. I would like it to output the probability associated with the occurrence of the 'bankroll' variable falling to <= 0. I am receiving 0 values as output for some reason. My graphing calculator and wikipedia tells me the correct value given the chosen inputs should be about 13%. what is occurring here?
I am trying to put together a user defined function called risk of ruin. I would like it to output the probability associated with the occurrence of the 'bankroll' variable falling to <= 0. I am receiving 0 values as output for some reason. My graphing calculator and wikipedia tells me the correct value given the chosen inputs should be about 13%. what is occurring here?
Code:
Public Function Risk_of_Ruin(mu As Integer, st_dev As Integer, bankroll As Integer) As Integer
'Risk of Ruin calculates the probability of reaching a less than or equal to zero value for the bankroll value
'Inputs should be entered as whole dollar values
Dim r As Integer
r = Application.WorksheetFunction.Sqrt(mu ^ 2 + st_dev ^ 2)
Risk_of_Ruin = (((2 / (1 + mu / r)) - 1) ^ (bankroll / r))
Risk_of_Ruin = output
End Function