syerramilli / R-sysid

4 stars 2 forks source link

The residuals of an arx model ars the same as fitted values #25

Closed MoonMitEum closed 1 year ago

MoonMitEum commented 4 years ago

In this example below, mod_arx$fitted.values and mod_arx$residuals are the same (In the body of the function sysid::arx, residuals = eps[1:N, , drop = F] and eps <- X %*% coef). Is it intended to work like this?

library(sysid) data(arxsim) mod_arx <- arx(arxsim, c(1, 2, 2)) head(cbind(mod_arx$fitted.values, mod_arx$residuals), 100) sum(mod_arx$fitted.values != mod_arx$residuals) # 0