[R] What's wrong with this simple code???

Yong Wang wang at galton.uchicago.edu
Sun May 30 06:13:30 CEST 2004


Hi, all
I can not figure this out, please have a look and help me out.
thank you! 

Note: this is in SPLUS, not R.

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




More information about the R-help mailing list