Im trying to plot the data from all 250 loops into one figure
The loop works on its own but i only see data from the first loop when i use ggplot. Do i need to include ggplot into the loop? Or do i maybe need to save the output from the loop into a vector/list? (output is a 2x131 data frame)
for(i in seq(250)){
sim_data<- mvrnorm(n=100, mu, sigma)
mean1<- colMeans(sim_data)
cov <- cov(sim_data)
output <- data.frame(compute_efficient_frontier(cov,mean))
}
ggplot(output, aes(x = sd, y = mu))+
geom_point()