楼主: jw21
3088 1

[问答] 请教有关事件序列的分析 [推广有奖]

  • 1关注
  • 3粉丝

已卖:1份资源

教授

39%

还不是VIP/贵宾

-

威望
0
论坛币
118940 个
通用积分
0.0603
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
2723 点
帖子
109
精华
0
在线时间
2629 小时
注册时间
2008-3-30
最后登录
2025-12-24

楼主
jw21 发表于 2015-10-27 13:42:14 |AI写论文
200论坛币
刚接触R不久,只懂得一些浅显的基础知识,这边有一组关于时间序列的图片比较困惑,希望大神们可以帮我解释一下。下面是R的程序,然后是doc文档中是plot图,希望可以有比较详细的解释.
> par(mfrow=c(1,1))
> plot(bicoal.tons,xlab="Year",ylab="Production in Millions of  Net Tons of Bitumous Coal",pch="*",type="b",main="Production of Bitumous Coal Between 1920 and 1968")
> xt<-time(bicoal.tons)-1945
> mod<-rlm(bicoal.tons~cbind(xt,xt^2))
> mod$coefficients
        (Intercept)   cbind(xt, xt^2)xt cbind(xt, xt^2)xt^2
       472.51468692          0.29658002          0.02902045
> plot(mod$residuals,xlab="Year",ylab = "Production in Millions of  Net Tons of Bitumous Coal",pch="*",type="b",main="Production of Bitumous Coal Between 1920 and 1968")
> Ident(mod$residuals,"Detrended Bitumous Coal Data","Raw Scale")
> fin<-Raic(mod$residuals)
> par(mfrow=c(1,1),oma=c(4,0,6,0))
> c1<-2/sqrt(length(bicoal.tons))
> plot(fin$k,diag(fin$coef),ylim = range(diag(fin$coef),c1,-c1),type = "b",lty=2,main="Robust PACF",xlab = "Autorefression Order",ylab = "Robust PACF")
> box(lty = 1)
> abline(h=c(-c1,c1),lty=2)
> abline(h=0)
> segments(fin$k,0,fin$k,diag(fin$coef))
> mtext("Identification for the Bitunous Coal Data,Quadratic Trend Fitted",3,1,outer = T,cex = 1.5)
> fin$coef[1,1]
[1] 0.7195047
> res<-fin$resid[,1]
> fv<-mod$residuals[-1]-res
> Ident(res,"Bitumous Coal Data","residuals from Quadratic Trend and AR(1) fit")
> fin2<-Raic(res)
> par(mfrow=c(1,1),oma=c(4,0,6,0))
> c1<-2/sqrt(length(bicoal.tons))
> plot(fin2$k,diag(fin2$coef),ylim = range(diag(fin2$coef),c1,-c1),type = "b",lty=2,main="Robust PACF",xlab="Autoregression Order",ylab = "Robust PACF")
> box(lty=1)
> abline(h=c(-c1,c1),lty=2)
> abline(h=0)
> segments(fin2$k,0,fin2$k,diag(fin2$coef))
> mtext("Identification for the Bitumou Coal Data,Quadratic trend and AR(1) Fitted",3,1,outer = T,cex = 1.5)
> par(mfrow=c(2,2),oma=c(0,0,6,0))
> plot(1:(length(bicoal.tons)-1),res,type="b",pch="*",xlab="Time",ylab="Residuals",main="Residual Plot")
> plot(fv,res,main="Residuals Versus Fitted Values",ylab="Residuals",xlab = "Fitted Values")
> qqnorm(res,main="Quantile-Quantile Plot",ylab="Residuals",xlab = "Gaussian Quantiles")
> plot(fv,abs(res),main="Absolute Residuals Versus Fitted Values",ylab = "Absolute Residuals",xlab = "Fitted Values")


> lines(lowess(fv,abs(res)))
> mtext("Residual Plots from quadratic trend and AR(1) fit to the Bitumous Coal Data",outer = T,side = 3,cex = 1.5)



关键词:coefficients coefficient production regression Residuals 基础知识 图片 程序

沙发
warriorqi 发表于 2017-10-21 22:55:23
楼主这个会了么 我们也有这道题

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-4 09:33