Displaying 2 results from an estimated 2 matches for "aicrss".
Did you mean:
access
2012 Sep 19
0
Discrepancies in weighted nonlinear least squares
...magnitude the better one.
Why so?
If I define AIC based on residual sum-of-squares as found in the textbooks
RSS <- function (object)
{
w <- object$weights
r <- residuals(object)
if (is.null(w))
w <- rep(1, length(r))
sum(w * residuals(object)^2)
}
AICrss <- function(object)
{
n <- nobs(object)
k <- length(coef(object))
rss <- RSS(object)
n * log((2 * pi)/n) + n + 2 + n * log(rss) + 2 * k
}
I get
> AICrss(fm1DNase1)
[1] -76.41642
Which is the same value as the above AIC (stats:::AIC.logLik) based on
log-like...
2013 Feb 12
0
Deviance and AIC in weighted NLS
...tude the better one
(lower AIC).
However, if I define AIC based on residual sum-of-squares as found in the
textbooks
RSS <- function (object)
{
w <- object$weights
r <- residuals(object)
if (is.null(w))
w <- rep(1, length(r))
sum(w * residuals(object)^2)
}
AICrss <- function(object)
{
n <- nobs(object)
k <- length(coef(object))
rss <- RSS(object)
n * log((2 * pi)/n) + n + 2 + n * log(rss) + 2 * k
}
I get
> AICrss(fm1DNase1)
[1] -76.41642
which is the same value as the above AIC (stats:::AIC.logLik) based on
log-likelihood
but
&g...