Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
7ecdc557
Commit
7ecdc557
authored
Feb 16, 2021
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
波动率
parent
935c679d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
week_evaluation.py
app/utils/week_evaluation.py
+4
-1
No files found.
app/utils/week_evaluation.py
View file @
7ecdc557
...
...
@@ -69,7 +69,10 @@ def volatility(simple_return, n):
:param n:数据类型, 周(52), 月(12), 日(250)
:return:
"""
d
=
math
.
sqrt
(
n
)
*
simple_return
.
std
(
ddof
=
1
)
new_s_r
=
simple_return
/
simple_return
.
shift
(
1
)
new_s_r
.
fillna
(
1
)
new_s_r
=
simple_return
.
apply
(
lambda
x
:
math
.
log
(
x
))
d
=
math
.
sqrt
(
len
(
simple_return
))
*
new_s_r
.
std
(
ddof
=
1
)
return
d
...
...
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