全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
2482 2
2007-08-17

R里面的mcmc包可以做时间序列的问题么?

非常感谢!

二维码

扫码加我 拉你入群

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

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

全部回复
2007-8-17 18:36:00
可以。不过取决于你使用什么模型
二维码

扫码加我 拉你入群

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

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

2014-12-28 22:01:43

一般不用这个包做时间序列

  

时间序列常用的包见:http://www.zhihu.com/question/23117581

   

例子——


install.packages("astsa") # install it ... you'll be asked to choose the closest CRAN mirror
require(astsa)            # then load it (has to be done at the start of each session)


data(jj)  # load the data - you don't have to do this anymore with astsa, but you do in general
jj        # print it to the screen
ls()         # list your objects
rm(worry)    # remove your worry object
jj[1]       # the first element
jj[84]      # the last element
jj[1:4]     # the first 4 elements
jj[-(1:80)] # everything EXCEPT the first 80 elements
length(jj)  # the number of elements
dim(jj)     # but no dimensions ...
nrow(jj)    # ... no rows
ncol(jj)    # ... and no columns


#-- if you want it to be a column vector (in R, a matrix), an easy way to go is:
jjm = as.matrix(jj)
dim(jjm)   
options(digits=2)  # the default is 7, but it's more than I want now
options           # to see your options (it's the help file)
rnorm             # we're using it on the next line
(zardoz = ts(rnorm(48), start=c(2293,6), frequency=12))


# use window() if you want a part of a ts object
(oz = window(zardoz, start=2293, end=c(2295,12)))
time(jj)   
cycle(jj)  
plot(jj, ylab="Earnings per Share", main="J & J")   

二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群