Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
8b061a73
Commit
8b061a73
authored
May 29, 2018
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update er analysis
parent
6b3f0a38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
factoranalysis.py
alphamind/analysis/factoranalysis.py
+5
-6
No files found.
alphamind/analysis/factoranalysis.py
View file @
8b061a73
...
@@ -112,7 +112,7 @@ def er_portfolio_analysis(er: np.ndarray,
...
@@ -112,7 +112,7 @@ def er_portfolio_analysis(er: np.ndarray,
weights
=
long_short_builder
(
er
)
.
flatten
()
weights
=
long_short_builder
(
er
)
.
flatten
()
elif
method
==
'mv'
or
method
==
'mean_variance'
:
elif
method
==
'mv'
or
method
==
'mean_variance'
:
lbound
,
ubound
,
cons_exp
,
risk_lbound
,
risk_ubound
=
create_constraints
(
benchmark
,
**
kwargs
)
lbound
,
ubound
,
cons_exp
,
risk_lbound
,
risk_ubound
=
create_constraints
(
benchmark
,
**
kwargs
)
cov
=
kwargs
[
'cov
'
]
risk_model
=
kwargs
[
'risk_model
'
]
if
'lam'
in
kwargs
:
if
'lam'
in
kwargs
:
lam
=
kwargs
[
'lam'
]
lam
=
kwargs
[
'lam'
]
...
@@ -120,7 +120,7 @@ def er_portfolio_analysis(er: np.ndarray,
...
@@ -120,7 +120,7 @@ def er_portfolio_analysis(er: np.ndarray,
lam
=
1.
lam
=
1.
status
,
_
,
weights
=
mean_variance_builder
(
er
,
status
,
_
,
weights
=
mean_variance_builder
(
er
,
cov
=
cov
,
risk_model
=
risk_model
,
bm
=
benchmark
,
bm
=
benchmark
,
lbound
=
lbound
,
lbound
=
lbound
,
ubound
=
ubound
,
ubound
=
ubound
,
...
@@ -132,7 +132,7 @@ def er_portfolio_analysis(er: np.ndarray,
...
@@ -132,7 +132,7 @@ def er_portfolio_analysis(er: np.ndarray,
elif
method
==
'tv'
or
method
==
'target_vol'
:
elif
method
==
'tv'
or
method
==
'target_vol'
:
lbound
,
ubound
,
cons_exp
,
risk_lbound
,
risk_ubound
=
create_constraints
(
benchmark
,
**
kwargs
)
lbound
,
ubound
,
cons_exp
,
risk_lbound
,
risk_ubound
=
create_constraints
(
benchmark
,
**
kwargs
)
cov
=
kwargs
[
'cov
'
]
risk_model
=
kwargs
[
'risk_model
'
]
if
'target_vol'
in
kwargs
:
if
'target_vol'
in
kwargs
:
target_vol
=
kwargs
[
'target_vol'
]
target_vol
=
kwargs
[
'target_vol'
]
...
@@ -140,14 +140,13 @@ def er_portfolio_analysis(er: np.ndarray,
...
@@ -140,14 +140,13 @@ def er_portfolio_analysis(er: np.ndarray,
target_vol
=
1.
target_vol
=
1.
status
,
_
,
weights
=
target_vol_builder
(
er
,
status
,
_
,
weights
=
target_vol_builder
(
er
,
cov
=
cov
,
risk_model
=
risk_model
,
bm
=
benchmark
,
bm
=
benchmark
,
lbound
=
lbound
,
lbound
=
lbound
,
ubound
=
ubound
,
ubound
=
ubound
,
risk_exposure
=
cons_exp
,
risk_exposure
=
cons_exp
,
risk_target
=
(
risk_lbound
,
risk_ubound
),
risk_target
=
(
risk_lbound
,
risk_ubound
),
vol_low
=
0
,
vol_target
=
target_vol
)
vol_high
=
target_vol
)
else
:
else
:
raise
ValueError
(
"Unknown building type ({0})"
.
format
(
method
))
raise
ValueError
(
"Unknown building type ({0})"
.
format
(
method
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment