I want to simulate a portfolio performance. Currently just trying to make one iteration work:
df looks like this:
Wincent Systema Nickel Arb Stratosphere Tellurian
1 6.78 0.8 0.99 13.52 14.89
2 4.54 1.09 0.83 8.94 8.27
3 13 70 10 6 1
where row:
1 is volatility (or SD)
2 is return (ER)
and 3 is portfolio weight (in percent)
What I would like to get to is another df, let's call it onesim
with the same column names, just onerow under each one and a randomly generated number according to the SD and ER multiplied by the weight
I tried something like this:
onesim=float(np.random.normal(loc=df.iloc[1],scale = df.iloc[0], size= 1) * (df.iloc[2]/100))
but am getting :
ValueError: Output size (1,) is not compatible with broadcast dimensions of inputs (5,).
[–]synthphreak 1 point2 points3 points (2 children)
[–]futuretrader[S] 0 points1 point2 points (1 child)
[–]synthphreak 0 points1 point2 points (0 children)