jamesbeau
03-25-2016, 07:57 PM
Hi Guys,
For an assignment i'm doing, I have to simulate returns which are normally distributed mu, sigma for t periods and then calculating the simulated annualised returns i.e ((1+r1)(1+r2)...(1+rt))^(1/t) -1.
I have attempting to set up a loop to aggregate the returns but am struggling to get the loop working. Any help would be much appreciated.
Function RandReturn(mu, sigma)
RandReturn = WorksheetFunction.Norm_Inv(Rnd, mu, sigma)
End Function
Function SimAnnualReturn(mu, sigma, t)
For i = 1 To t
SimReturn = SimReturn * (1 + RandReturn(mu, sigma))
Next
SimAnnualReturn = (SimReturn ^ (1 / t)) - 1
End Function
For an assignment i'm doing, I have to simulate returns which are normally distributed mu, sigma for t periods and then calculating the simulated annualised returns i.e ((1+r1)(1+r2)...(1+rt))^(1/t) -1.
I have attempting to set up a loop to aggregate the returns but am struggling to get the loop working. Any help would be much appreciated.
Function RandReturn(mu, sigma)
RandReturn = WorksheetFunction.Norm_Inv(Rnd, mu, sigma)
End Function
Function SimAnnualReturn(mu, sigma, t)
For i = 1 To t
SimReturn = SimReturn * (1 + RandReturn(mu, sigma))
Next
SimAnnualReturn = (SimReturn ^ (1 / t)) - 1
End Function