R equivalent of MATLAB's filter function

自古美人都是妖i 提交于 2019-12-04 07:36:42

Hmm can't you achieve that with filter function in the package signal ?

require(signal)
a = c(1,0.6)
b = c(1,0.25,3)
e = rnorm(100)
waveform = filter(b,a,e)

Yeah, you can do this usring arima.sim, e.g.

arima.sim(npts, model=list(ar=a, ma=b), rand.gen=rnorm)

Note that the model is checked for stationarity and the model you have above is not stationary. If you want something integrated you can specify the order of integration in the model.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!