手机版

金融时间序列分析 第一次作业(6)

时间:2025-07-06   来源:未知    
字号:

张老师的金融计量课作业答案 R软件

p<-pnorm(t,lower.tail=FALSE) result$t<-t result$p<-p

if(alternative=="two.sided"){ p<-2*p result$p<-p }

else return("Unexpected Error") if(p<alpha){

result$conclusion<-("Accept Null Hypothesis") }

else {result$conclusion<-("Reject Null Hypthesis;Accept Alternative Hypothesis") }

return(result) }

建立名为z.test2的函数用于检验超额峰度

z.test2<-function(kurtosis,n,alpha,alternative="two.sided"){ options(digits=6) result<-list()

t<-((kurtosis-3)/sqrt(24/n)) p<-pnorm(t,lower.tail=FALSE) result$t<-t result$p<-p

if(alternative=="two.sided"){ p<-(min(2*p,2(1-p))) result$p<-p }

else return("Unexpected Error") if(p>alpha){

result$conclusion<-("Accept Null Hypothesis") }

else {result$conclusion<-("Reject Null Hypthesis;Accept Alternative Hypothesis") }

return(result) }

1.5R语言程序源码

setwd("F:/Financial Econometrics/Homework Guide/TsayDat") fxca<-read.table(file="d-fxca00.txt") fxuk<-read.table(file="d-fxuk00.txt") fxjp<-read.table(file="d-fxjp00.txt") fxeu<-read.table(file="d-fxeu00.txt")

fxca$V2=log(1+fxca$V2) fxuk$V2=log(1+fxuk$V2) fxjp$V2=log(1+fxjp$V2) fxeu$V2=log(1+fxeu$V2)

mean(fxca$V2) mean(fxuk$V2) mean(fxjp$V2) mean(fxeu$V2) min(fxca$V2) min(fxuk$V2) min(fxjp$V2) min(fxeu$V2) max(fxca$V2) max(fxuk$V2) max(fxjp$V2) max(fxeu$V2)

sd(fxca$V2) sd(fxuk$V2) sd(fxjp$V2) sd(fxeu$V2)

library(fBasics)

金融时间序列分析 第一次作业(6).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)