── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Portfolio Return Probability
1 A 0.15 0.3
2 A 0.08 0.5
3 A -0.05 0.2
4 B 0.10 0.4
5 B 0.06 0.4
6 B -0.02 0.2
7 C 0.07 0.6
8 C 0.05 0.3
9 C -0.01 0.1
summary(data_load)
Portfolio Return Probability
Length:9 Min. :-0.05000 Min. :0.1000
Class :character 1st Qu.:-0.01000 1st Qu.:0.2000
Mode :character Median : 0.06000 Median :0.3000
Mean : 0.04778 Mean :0.3333
3rd Qu.: 0.08000 3rd Qu.:0.4000
Max. : 0.15000 Max. :0.6000
# A tibble: 3 × 4
Portfolio expected_Return Variance Standard_deviation
<chr> <dbl> <dbl> <dbl>
1 A 0.075 0.00482 0.0695
2 B 0.06 0.00192 0.0438
3 C 0.056 0.000564 0.0237
##Interpretation:
Based on the statistical results, Portfolio A presents the highest financial risk compared to the other two portfolios because it has the highest standard deviation of approximately 6.95%. However, it also offers the highest expected return of 7.5%. Portfolio B has a moderate level of risk and an expected return of 6%, while Portfolio C has the lowest risk, with a standard deviation of approximately 2.37% and an expected return of 5.6%. These results suggest that higher expected returns are associated with greater risk among the three portfolios
portfolio_B_R <-sample(portfolio_B$Return, size = n, replace =TRUE, prob = portfolio_B$Probability)head(portfolio_B_R)
[1] 0.10 0.10 0.10 -0.02 0.06 0.10
portfolio_C_R <-sample(portfolio_C$Return, size = n, replace =TRUE, prob = portfolio_C$Probability)head(portfolio_C_R)
[1] 0.07 0.07 0.07 0.07 0.07 0.07
Compare the return distributions
library(ggplot2)simulated_data <-data.frame(Return =c(portfolio_A_R, portfolio_B_R, portfolio_C_R),Portfolio =rep(c("A", "B", "C"), each = n) )ggplot(simulated_data, aes(x = Return)) +geom_histogram(binwidth =0.01, fill ="steelblue",color ="white") +facet_wrap(~Portfolio) +labs(title ="Monte Carlo Simulation of Portfolio Returns",x ="Simulated Return",y ="Frequency") +theme_minimal()
##Interpretation:
Based on the Monte Carlo simulation, the three portfolios show different return distributions. Portfolio A has a wider spread of possible returns, ranging from -5% to 15%, indicating greater variability and financial risk. Portfolio B has a smaller range of returns, from -2% to 10%, while Portfolio C has the narrowest range, from -1% to 7%. Portfolio C’s return of 7% occurs approximately 6,000 times out of 10,000 simulations because it has a probability of 60%. Overall, Portfolio A shows the highest variability, while Portfolio C demonstrates the most stable returns.
# A tibble: 3 × 5
Portfolio Mean_Return Variance Standard_deviation Probabilty_Loss
<chr> <dbl> <dbl> <dbl> <dbl>
1 A 0.0737 0.00494 0.0703 0.208
2 B 0.0599 0.00193 0.0439 0.202
3 C 0.0561 0.000558 0.0236 0.0987
##Interpretation:
Based on the Monte Carlo simulation, Portfolio A has the highest estimated probability of a loss at 20.84%, followed by Portfolio B at 20.15%. Portfolio C has the lowest estimated probability of a loss at 9.87%. These results are close to the theoretical probabilities of 20%, 20%, and 10%, respectively. The small differences are due to random variation in the simulation. Overall, Portfolio C has the lowest probability of experiencing a negative return, while Portfolio A and Portfolio B have similar probabilities of loss. However, Portfolio A has a larger potential loss of 5%, compared to 2% for Portfolio B.
Part C: Investment Recommendation
Prepare a recommendation for:
Conservative investors
Portfolio C — Lower risk
Expected return: 5,6% and Standard deviation: 2.37%
Best for investors who prioritize stability and minimizing potential losses over maximizing returns
Moderate investors
Portfolio B — Balanced risk and return
Expected return: 6.0% and Standard deviation: 4.38%
Best for investors willing to accept moderate variability in exchange for hihgher expected return
Aggressive investors
Portfolio A — Higher risk and return
Expected return: 7.5% Standard deviation: 6.95%
Best suited for investors seeking higher expected returns who can tolerate larger fluctuations and potential losses.
##Interpretation:
Based on the statistical analysis and Monte Carlo simulation, I would recommend Portfolio C for conservative investors because it has the lowest standard deviation and the lowest probability of a loss. Although its expected return is lower than the other portfolios, it provides greater stability.
For moderate investors, I would recommend Portfolio B because it offers a balance between risk and expected return. Its expected return of 6% is slightly higher than Portfolio C, but it also carries greater risk.
For aggressive investors, I would recommend Portfolio A because it offers the highest expected return of 7.5%. However, it also has the highest standard deviation and the largest potential loss among the three portfolios. Therefore, it is more suitable for investors who are willing to accept higher risk in pursuit of higher returns.