When I include many uncertain variables (I incorporate at least 15/20 variables) in the for loop function, pb_profit sometimes gives me .75/.90 even. So it is perhaps to do with how many variables I am incorporating in uncertainty. The main npv function is as follows:
...
NPV_fun <- function(p_jet=24,capex=23,
opex=27) #default value
{
cash flow for Y0: initial investment
CF0 <- capex0.08(1+r_dis)^2+capex0.6(1+r_dis)+capex*0.32
cash flow for Y1-Y20: sale-expenses
exp_ut <- q_waterp_water+q_elecp_elec+
q_gasp_gas+q_h2p_h2
exp <- exp_ut+q_fdp_fd+q_labp_lab #275.56
print(exp)
sale_by <- q_dslp_dslp_oil+q_lpgp_lpgp_oil+q_napp_napp_oil+
q_mealp_meal
sale <- sale_by+q_jetp_jet*p_oil
cat("revenue share for meal:",q_meal*p_meal/sale,"\n")
ebitda <- sale-exp
dep <- capex*0.8/t_dep
ebit <- ebitda-dep
other cash flow for Y1-10: mortgage, (depreciation)
amort <- amort.table(Loan=capex*debt,n=t_loan,pmt=NA,r_dis)[["Schedule"]]
CF1 <- as.data.frame(amort)
CF1$Depreciation <- dep
other cash flow for Y11-20: no mortgage, no depreciation
CF2 <- CF1*0
CF <- rbind(CF1,CF2)
CF <- cbind(Year=1:nrow(CF),CF)
CF$EBIT <- ebit
CF$EBT <- CF$EBIT-CF$Interest Paid
CF$Flow <- CF$EBT*(1-r_tax)+CF$Depreciation-CF$Principal Paid
CF$Discount <- r_dis
CF$PV <- CF$Flow/(1+CF$Discount)^CF$Year
NPV <- sum(CF$PV)-CF0
print(NPV)
}
NPV_base <- NPV_fun()
#######################################
Monte Carlo simulation
#######################################
ndraw <- 10000
set.seed(12345)
p_jet_vec<- runif(10000,10,20)
capex_vec<- runif(10000,20,30)
opex_vec<- runif(10000,30,40)
npv_vec <- rep(NA,ndraw)
profit_vec <- rep(NA,ndraw)
for(i in 1:ndraw) {
npv_vec[i] <- NPV_fun(p_jet_vec[i],capex_vec[i]
opex_vec[i])
profit_vec[i] <- ifelse(npv_vec[i]>0,1,0)
}
pb_profit <- mean(profit_vec)
pb_profit
...
As you can see, I put some random no, because I cant put original no here, which is sensitive. Hope this is good enough to understand?