RPubs will retire in June 2027. Your existing documents will stay accessible through December 31, 2031
and Connect Cloud is the recommended home for new publishing. Read the blog post
gravatar

heroza71

Hero Ozagho

Recently Published

Plot
Explicit Moving Averages
Plot
# ----------------------------------------- # DCF Plot for GOOGL Stock – Modified Example in R # Adjusted parameters to see variation in discounted FCFs # Parameters (in billions of USD) fcf0 <- 75 # Current Free Cash Flow g <- 0.12 # Adjusted Annual Growth Rate (12%) r <- 0.10 # Discount Rate (10%) terminalMultiple <- 15 # Terminal FCF Multiple MOS <- 0.20 # 20% Margin of Safety # Choose the forecast horizon (set T = 10 for a 10-year forecast) T <- 10 # ------------------------------- # Step 1: Calculate Projected and Discounted FCFs for Each Year # ------------------------------- years <- 1:T # Projected free cash flows for each year with 12% growth projected_fcf <- fcf0 * (1 + g)^years # Discount factors for each year discount_factors <- (1 + r)^years # Discounted FCF: now these will vary because g != r discounted_fcf <- projected_fcf / discount_factors # ------------------------------- # Step 2: Calculate Terminal Value at the End of Forecast # ------------------------------- # Projected FCF in the final forecast year final_year_fcf <- projected_fcf[T] # Terminal value using the terminal multiple terminal_value <- final_year_fcf * terminalMultiple # Discount the terminal value back to the present PV_terminal <- terminal_value / ((1 + r)^T) # ------------------------------- # Step 3: Plot the Results # ------------------------------- plot(years, discounted_fcf, type = "b", pch = 19, col = "blue", lwd = 2, xlab = "Year", ylab = "Value (Billion USD)", main = "DCF Analysis for GOOGL: Discounted FCF & Terminal Value") # Add the discounted Terminal Value as a red point at the final forecast year points(T, PV_terminal, col = "red", pch = 19, cex = 1.5) text(T, PV_terminal, labels = paste("PV(TV) =", round(PV_terminal, 2)), pos = 3, col = "red", cex = 0.8) # Optionally, add a legend to the plot legend("topleft", legend = c("Discounted Annual FCF", "Discounted Terminal Value"), col = c("blue", "red"), pch = c(19, 19), lty = c(1, NA), bty = "n")
Plot