s-news
[Top] [All Lists]

Re: what's the problem with this simple code?

To: Yong Wang <wang@galton.uchicago.edu>
Subject: Re: what's the problem with this simple code?
From: Zhu Wang <zhuw@mail.smu.edu>
Date: Sun, 30 May 2004 15:55:17 -0500
Cc: zhuw@mail.smu.edu, s-news@lists.biostat.wustl.edu
In-reply-to: <Pine.LNX.4.58.0405301530050.24619@aitken.uchicago.edu>
References: <Pine.LNX.4.58.0405301530050.24619@aitken.uchicago.edu>
I do not have garch and the data but I suggest you to insert browser()
in the function and see what is happening. See below.

On Sun, 2004-05-30 at 15:32, Yong Wang wrote:
> 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]

browser()

> > 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
> 
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news
-- 
Zhu Wang



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