2
2
3
3
import numpy as np
4
4
import pandas as pd
5
+
5
6
from pypfopt import expected_returns
6
7
from pypfopt import risk_models
7
8
from pypfopt .efficient_frontier import (
11
12
EfficientCDaR ,
12
13
)
13
14
from pypfopt .cla import CLA
14
- from pypfopt .expected_returns import returns_from_prices
15
15
16
16
17
17
def resource (name ):
@@ -72,7 +72,7 @@ def setup_efficient_frontier(
72
72
def setup_efficient_semivariance (data_only = False , solver = None , verbose = False ):
73
73
df = get_data ().dropna (axis = 0 , how = "any" )
74
74
mean_return = expected_returns .mean_historical_return (df , compounding = False )
75
- historic_returns = returns_from_prices (df )
75
+ historic_returns = expected_returns . returns_from_prices (df )
76
76
if data_only :
77
77
return mean_return , historic_returns
78
78
return EfficientSemivariance (
@@ -85,7 +85,7 @@ def setup_efficient_cvar(
85
85
):
86
86
df = get_data ().dropna (axis = 0 , how = "any" )
87
87
mean_return = expected_returns .mean_historical_return (df )
88
- historic_returns = returns_from_prices (df )
88
+ historic_returns = expected_returns . returns_from_prices (df )
89
89
if data_only :
90
90
return mean_return , historic_returns
91
91
return EfficientCVaR (
@@ -102,7 +102,7 @@ def setup_efficient_cdar(
102
102
):
103
103
df = get_data ().dropna (axis = 0 , how = "any" )
104
104
mean_return = expected_returns .mean_historical_return (df )
105
- historic_returns = returns_from_prices (df )
105
+ historic_returns = expected_returns . returns_from_prices (df )
106
106
if data_only :
107
107
return mean_return , historic_returns
108
108
return EfficientCDaR (
0 commit comments