s-news
[Top] [All Lists]

what's the problem with this simple code?

To: s-news@lists.biostat.wustl.edu
Subject: what's the problem with this simple code?
From: Yong Wang <wang@galton.uchicago.edu>
Date: Sun, 30 May 2004 15:32:08 -0500 (CDT)
Dear all.
got a problem, simply can not figure out, please help me, thank you in 
advance:

 I have following code
> ***********************************
> modfit<-function(yir,yew, ft) {
> 
> n<-length(yew)
> yew<-yew[1:(n-1)]
> 
> yy<-yir-ft
> xx<-yew-ft
> 
> n<-length(xx)
> xx0<-xx[2:n]
> yy0 <-yy [2:n]
> 
> xx1<-xx[1:(n-1)]
> 
> fit <- garch(yy0~xx0 + xx1+var.in.mean, ~garch(1,1),cond.dist='ged')
> summary(fit)
> }
> 
> fs1hca<-modfit(s1hca.r, s1hca.ew, zfr)
> 
> **************error message is ***************
> 
> Problem in garch(yy0 ~ xx0 + xx1 + var.in.mean,  ~ ..: Object "xx0" not 
> found Use traceback() to see the call stack
> 
 It is really weird, I  tried step by step, the code works,
 but what's the problem with xx0,I can't figure it out.
 
 thank you for any suggestion.
 
 best regards
 yong


<Prev in Thread] Current Thread [Next in Thread>