楼主: ReneeBK
7660 71

[其他] [高频数据案例研究]Density Estimation of High-Frequency Financial Data   [推广有奖]

  • 1关注
  • 62粉丝

VIP

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49407 个
通用积分
51.8704
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57815 点
帖子
4006
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
Frequently we will want to estimate the empirical probability density function of real-world data and compare it to the theoretical density from one or more probability distributions. The following example shows the empirical and theoretical normal density for EUR/USD high-frequency tick data
  1. # Function that reads Reuters CSV tick data and converts Reuters dates
  2. # Assumes format is Date,Tick
  3. readRTD <- function(filename) {
  4. tickData <- read.csv(file=filename, header=TRUE, col.names=c("Date","Tick"))
  5. tickData$Date <- as.POSIXct(strptime(tickData$Date, format="%d/%m/%Y %H:%M:%S"))
  6. tickData
  7. }

  8. # Boilerplate function for Reuters FX tick data transformation and density plot
  9. plot.reutersFXDensity <- function() {
  10. filenames <- c("data/eur_usd_tick_26_10_2007.csv",
  11.     "data/eur_usd_1min_26_10_2007.csv",
  12.     "data/eur_usd_5min_26_10_2007.csv",
  13.     "data/eur_usd_hourly_26_10_2007.csv",
  14.     "data/eur_usd_daily_26_10_2007.csv")
  15. labels <- c("Tick", "1 Minute", "5 Minutes", "Hourly", "Daily")

  16. par(mfrow=c(length(filenames), 2),mar=c(0,0,2,0), cex.main=2)
  17. tickData <- c()
  18. i <- 1
  19. for (filename in filenames) {
  20. tickData[[i]] <- readRTD(filename)
  21. # Transform: `$Y = \nabla\log(X_i)[color=#373737][b]Frequently we will want to estimate the empirical probability density function of real-world data and compare it to the theoretical density from one or more probability distributions. The following example shows the empirical and theoretical normal density for EUR/USD high-frequency tick data [/b][/color]
  22. logtick <- diff(log(tickData[[i]]$Tick))
  23. # Normalize: `$\frac{(Y-\mu_Y)}{\sigma_Y}[color=#373737][b]Frequently we will want to estimate the empirical probability density function of real-world data and compare it to the theoretical density from one or more probability distributions. The following example shows the empirical and theoretical normal density for EUR/USD high-frequency tick data [/b][/color]
  24. logtick <- (logtick-mean(logtick))/sd(logtick)
  25. # Theoretical density range: `$\left[\lfloor\mathrm{min}(Y)\rfloor,\lceil\mathrm{max}(Y)\rceil\right][color=#373737][b]Frequently we will want to estimate the empirical probability density function of real-world data and compare it to the theoretical density from one or more probability distributions. The following example shows the empirical and theoretical normal density for EUR/USD high-frequency tick data [/b][/color]
  26. x <- seq(floor(min(logtick)), ceiling(max(logtick)), .01)
  27. plot(density(logtick), xlab="", ylab="", axes=FALSE, main=labels[i])
  28. lines(x,dnorm(x), lty=2)
  29. #legend("topleft", legend=c("Empirical","Theoretical"), lty=c(1,2))
  30. plot(density(logtick), log="y", xlab="", ylab="", axes=FALSE, main="Log Scale")
  31. lines(x,dnorm(x), lty=2)
  32. i <- i + 1
  33. }
  34. par(op)
  35. }
复制代码

上面的代码解疑:

https://bbs.pinggu.org/thread-3622629-1-1.html


大数据研究:

https://bbs.pinggu.org/thread-3621697-1-1.html


文献:

本帖隐藏的内容

Density Estimation of HighFrequency Financial Data.pdf (717.84 KB)



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Estimation financial Frequency inancial Financia following function converts compare example

回帖推荐

sjing21 发表于16楼  查看完整内容

代码 太复杂了 现在真需要全才啊,不仅能文能武,还得数理化 样样精通,外语水平 出类拔萃,越来越赶不上时代的步伐了
已有 1 人评分经验 论坛币 收起 理由
fantuanxiaot + 30 + 34 精彩帖子

总评分: 经验 + 30  论坛币 + 34   查看全部评分

本帖被以下文库推荐

沙发
ydb8848 发表于 2015-3-20 08:33:35 |只看作者 |坛友微信交流群

使用道具

藤椅
lhf8059 发表于 2015-3-20 09:04:29 |只看作者 |坛友微信交流群
看看!

使用道具

板凳
fantuanxiaot 发表于 2015-3-20 09:07:36 |只看作者 |坛友微信交流群
Let me See it!!!!

使用道具

报纸
tracymicky 发表于 2015-3-20 12:04:57 |只看作者 |坛友微信交流群
have a look

使用道具

地板
jgw1213 发表于 2015-3-20 12:19:18 |只看作者 |坛友微信交流群
谢谢分享         

使用道具

7
zboby 在职认证  发表于 2015-3-20 12:30:00 |只看作者 |坛友微信交流群
好好好好好好好

使用道具

8
duoduoduo 在职认证  发表于 2015-3-20 13:07:08 |只看作者 |坛友微信交流群
学习学习啊

使用道具

9
mike68097 发表于 2015-3-20 13:49:22 |只看作者 |坛友微信交流群

使用道具

10
kzpan 发表于 2015-3-20 18:18:45 |只看作者 |坛友微信交流群
谢谢分享
已有 1 人评分论坛币 收起 理由
fantuanxiaot + 4 补偿

总评分: 论坛币 + 4   查看全部评分

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jr
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 07:41