Ah!! After way too many hours of work Ive answered my
own question. To get varExp2, a copy of varExp, to
work as a new varFunc, one needs to use this sort of
syntax:
update.varExp2 <- function (object, data, ...)
{
print ("enter update")
val <- NextMethod()
if (length(val) == 0) {
aux <- coef(val, allCoef = TRUE)
if (!is.null(grps <- getGroups(val))) {
aux <- aux[grps]
}
attr(val, "logLik") <- sum(log(attr(val,
"weights") <- exp(-aux *
getCovariate(val))))
}
val
}
setMethod("update", "varExp2", update.varExp2)
And then do the same for all methods used by varExp
(see methods(class="varExp")). When writing the
setMethod for coef<-.varExp2, use
cat("coef<-.varExp2") in the statement. Or at least
that worked for me.
But I still have an unanswered question from the other
day (see [R] two questions on nlme: error messages and
nested variance). What is the best way in nlme to
model the variance when the variance of the variance
is not constant but is dependent on a covariate?
Thanks. John
______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html