DAGUET
Member
Hi There,
I am trying (hard) to get out of the following situation and would need your help.
• I need to build from the attached spreadsheet an XLS User-Defined Function that is able to generate a stochastic-driven simulation (Monte Carlo process) to perform the valuation of Netscape.
• To do that, I would start from the « Simulation Model » worksheet input variable (those in green font) and build a macro out of each of those cells that would instruct XL to perform a loop on the stochastic generation process for those variable.
• Then obtain as an outcome a distribution of values of the company (cell "O4" is my output cell), the type of which I get in crystal ball .
I think the formulation I seek is more or less derived from the code used in VBA for MC sim for Value at Risk (see an illustration below unrelated to the case).
But I can't get to that for some unknown reason..... I flare that this is not that complicated at the end but I am not there and would appreciate if you could help me in some way.
Best regards
FOR ILLUSTRATION PURPOSE ONLY VBA CODE FOR VAR
Function ValueAtRiskMC(confidence, horizon, RiskFree, StDv, StockValue)
Dim i As Integer
Dim stockReturn(1 To 10000) As Double
For i = 1 To 10000
stockReturn(i) = Exp((RiskFree – 0.5 * StDv ^ 2) + StDv * Application.NormInv(Rnd(), 0, 1)) – 1
Next i
ValueAtRiskMC = -(horizon) ^ 0.5 * Application.Percentile(stockReturn, 1 – confidence)
ValueAtRiskMC = StockValue * ValueAtRiskMC
End Function
I am trying (hard) to get out of the following situation and would need your help.
• I need to build from the attached spreadsheet an XLS User-Defined Function that is able to generate a stochastic-driven simulation (Monte Carlo process) to perform the valuation of Netscape.
• To do that, I would start from the « Simulation Model » worksheet input variable (those in green font) and build a macro out of each of those cells that would instruct XL to perform a loop on the stochastic generation process for those variable.
• Then obtain as an outcome a distribution of values of the company (cell "O4" is my output cell), the type of which I get in crystal ball .
I think the formulation I seek is more or less derived from the code used in VBA for MC sim for Value at Risk (see an illustration below unrelated to the case).
But I can't get to that for some unknown reason..... I flare that this is not that complicated at the end but I am not there and would appreciate if you could help me in some way.
Best regards
FOR ILLUSTRATION PURPOSE ONLY VBA CODE FOR VAR
Function ValueAtRiskMC(confidence, horizon, RiskFree, StDv, StockValue)
Dim i As Integer
Dim stockReturn(1 To 10000) As Double
For i = 1 To 10000
stockReturn(i) = Exp((RiskFree – 0.5 * StDv ^ 2) + StDv * Application.NormInv(Rnd(), 0, 1)) – 1
Next i
ValueAtRiskMC = -(horizon) ^ 0.5 * Application.Percentile(stockReturn, 1 – confidence)
ValueAtRiskMC = StockValue * ValueAtRiskMC
End Function