Angenommen, ich besitze 100 Geld-Einheiten. Ich bin an einer Aktie interessiert, die derzeit 1 Geldeinheit pro Stück kostet. Der Kurs der Aktie ändert sich pro Zeiteinheit um einen lognormal-verteilten Zufallsfaktor. Wie lege ich mein Geld an besten an? Optionen sind
kurs = 1
anteile = 0
for t in 1:100:
x ~ normal(mu, sigma)
kurs *= exp(x)
anteile += 1/kurs
end
options(repr.plot.width=5, repr.plot.height=5)
mu = 0
sigma = 0.1
simulation <- function(mu, sigma) {
kurs = 1
anteile = 0
for (t in 1:100) {
x <- rnorm(1,mu,sigma)
kurs <- kurs * exp(x)
anteile <- anteile + 1/kurs
}
return(c(kurs, anteile))
}
d <- t(replicate(10000, simulation(0, .1)))
d <- data.frame(d)
colnames <- c('Kurs', 'Anteile')
boxplot(d, log='y')
abline(h=100, col='red')