首页 > 学院 > 开发设计 > 正文

时间序列分析-R语言-随机游走以及回归画图

2019-11-08 02:02:54
字体:
来源:转载
供稿:网友
###随机游走以及回归library(TSA)win.graph(width=4.8, height=3,pointsize=10)data(rwalk)plot(rwalk,type='o',ylab='数值',main='随机游走')model1=lm(rwalk~time(rwalk))summary(model1)abline(model1)
Call:lm(formula = rwalk ~ time(rwalk))Residuals:     Min       1Q   Median       3Q      Max -2.70045 -0.79782  0.06391  0.63064  2.22128 Coefficients:             Estimate Std. Error t value PR(>|t|)    (Intercept) -1.007888   0.297245  -3.391  0.00126 ** time(rwalk)  0.134087   0.008475  15.822  < 2e-16 ***---Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1Residual standard error: 1.137 on 58 degrees of freedomMultiple R-squared:  0.8119,	Adjusted R-squared:  0.8086 F-statistic: 250.3 on 1 and 58 DF,  p-value: < 2.2e-16

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表