[R] I want to create an object to use for the plot command
I'm using the TSA package (along with all prerequisites) to do some GARCH work and for some reason, something which used to work for me has decided to up and stop. The code is as follows, after loading the package: gs - garch.sim(alpha=c(1.9,0.1), beta=c(0.71, -0.083, -0.016),rnd = rnorm, n = 400, ntrans=500) gs1 - garch.sim(alpha=c(1.9,0.1), beta=c(0.7, -0.08, -0.016),rnd = rnorm, n = 400, ntrans=500) gts=ts(gs) gts1=ts(gs1) dgts=gts1-gts test - garch(dgts, order=c(0,0)) plot(test) However, I get the following error: Error in plot(test) : object 'test' not found What's extra annoying is that I had been using this type of code before and it was working fine, I honestly don't know what the problem is, I've used R reasonable extensively before but never with these packages so I'm not sure what I might have done wrong. If anyone could take the time to help me out, I'd really appreciate it. Yours etc, Aodhán -- View this message in context: http://r.789695.n4.nabble.com/I-want-to-create-an-object-to-use-for-the-plot-command-tp3390383p3390383.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] I want to create an object to use for the plot command
On Mar 19, 2011, at 7:02 PM, AOLeary wrote: I'm using the TSA package (along with all prerequisites) to do some GARCH work and for some reason, something which used to work for me has decided to up and stop. The code is as follows, after loading the package: gs - garch.sim(alpha=c(1.9,0.1), beta=c(0.71, -0.083, -0.016),rnd = rnorm, n = 400, ntrans=500) gs1 - garch.sim(alpha=c(1.9,0.1), beta=c(0.7, -0.08, -0.016),rnd = rnorm, n = 400, ntrans=500) gts=ts(gs) gts1=ts(gs1) dgts=gts1-gts test - garch(dgts, order=c(0,0)) plot(test) However, I get the following error: Actually you failed to note that you got an earlier error from the garch() function: Error in sigt[1:max(order[1], order[2])] - rep.int(NA, max(order[1], : replacement has length zero Which raises the question... what does it mean to specify a GARCH model of order c(0,0)? -- David. Error in plot(test) : object 'test' not found What's extra annoying is that I had been using this type of code before and it was working fine, I honestly don't know what the problem is, I've used R reasonable extensively before but never with these packages so I'm not sure what I might have done wrong. If anyone could take the time to help me out, I'd really appreciate it. Yours etc, Aodhán -- View this message in context: http://r.789695.n4.nabble.com/I-want-to-create-an-object-to-use-for-the-plot-command-tp3390383p3390383.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] I want to create an object to use for the plot command
Hm, thank you David, that is a good point. I'm trying to model it as a white noise model, essentially. Now that I think of it there's probably an easier way to do this that I haven't thought of yet. I was trying it this way based on something I'd remembered reading from Engle's original paper on ARCH models where an ARCH(0,0) model would correspond to a white noise process. It may be that the GARCH implementation in R has a different specification. In any case, thank you for pointing that out. A simple error I hadn't noticed at all. Yours etc, Aodhán -- View this message in context: http://r.789695.n4.nabble.com/I-want-to-create-an-object-to-use-for-the-plot-command-tp3390383p3390444.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.