hello I have covariance stacionary proces, and i want to estimate some parameter of this proces via gmm.
My problem is with write "g" -function. 0 order autocovariance is not problem 1 and higher order autocavariance are problem, because add order from 0 mean that I "loose" one "observacion" if I have 100 observation and i am going to use mean, variance and first autocovariance and fit one parameter ! g<- function(theta,x) { m1<-(P1-x) m2<-(P2-(x-P1)^2) m3<-(P3-(???)) f <- cbind(m1,m2,m3) return(f) } where P1,P2,P3 are formulas for mean, variance and first autocovariance via my parameter my question is how to define ??? i think about something like this : y<-x[2:length(x)] x<-x[-(length(x))] m1<-(P1-x) m2<-(P2-(x-P1)^2) m3<-(P3-(x-P1)*(y-P1)) but here i have to lost 1 observacion, what is problem when i call gmm: rad<-arima.sim(n=200,list(ar=0.5), sd=1) tet<-gmm(g,rad,t0=c(0)) any idea ? thanks -- View this message in context: http://r.789695.n4.nabble.com/GMM-with-covariance-moment-condicion-tp2276392p2276392.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.