R语言怎么把股票日收盘价转换成对数收益率

如题所述

R表示是融资融券的品种;N是新股的意思,new的首字母,第一天上市会戴这个帽子;K是科创板的股票,代码688开头。
股票收益率是反映股票收益水平的指标。投资者购买股票或债券最关心的是能获得多少收益,衡量一项证券投资收益大小以收益率来表示。
股票收益率=收益额/原始投资额。

温馨提示:
1、以上信息仅供参考,不作任何建议;
2、投资有风险,入市需谨慎。

应答时间:2021-10-18,最新业务变化请以平安银行官网公布为准。
[平安银行我知道]想要知道更多?快来看“平安银行我知道”吧~
https://b.pingan.com.cn/paim/iknow/index.html
温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-02-08
知道一系列收盘价向量X,length=1000,求对数收益率的R语言代码
acf(int[,2], lag.max = 15,type = "correlation", plot = TRUE,main='int monthly

acf(int.l[,2], lag.max = 15,type = "correlation", plot = TRUE,main='int monthly
log return')

Box.test(int[,2], lag = 5, type = "Ljung-Box")
Box.test(int[,2], lag = 10, type = "Ljung-Box")
Box.test(int.l[,2], lag = 5, type = "Ljung-Box")
Box.test(int.l[,2], lag = 10, type = "Ljung-Box")

运行结错误办

> int <- read.table("d-intc7208.txt", head=T)
错误于file(file, "rt") : 打链结
外: 警告信息:
In file(file, "rt") :
打文件'd-intc7208.txt': No such file or directory

+ acf(int.l[,2], lag.max = 15,type = "correlation", plot = TRUE,main='int monthly
错误: 意外符号 in:
"
acf(int.l[,2], lag.max = 15,type = "correlation", plot = TRUE,main='int"
> log return')
错误: 意外符号 in "log return"本回答被网友采纳
相似回答