diff options
Diffstat (limited to 'CakeCost.R')
-rw-r--r-- | CakeCost.R | 38 |
1 files changed, 30 insertions, 8 deletions
@@ -23,7 +23,7 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see <http://www.gnu.org/licenses/># # -# $Id: CakeCost.R 216 2011-07-05 14:35:03Z nelr $ +# $Id$ CakeCost <- function (model, obs, x = "time", y = NULL, err = NULL, weight = "none", scaleVar = FALSE, cost = NULL, ...) { @@ -180,6 +180,24 @@ CakeCost <- function (model, obs, x = "time", y = NULL, err = NULL, Res <- (ModVar- obsdat) res <- Res/Err resScaled <- res*Scale + + # print("==========================="); + # print("#Names[i]"); + # print(Names[i]); + # print("xDat"); + # print(xDat); + # print("obsdat"); + # print(obsdat); + # print("ModVar"); + # print(ModVar); + # print("1/Err"); + # print(1/Err); + # print("Res"); + # print(Res); + # print("res"); + # print(res); + # print("==========================="); + Residual <- rbind(Residual, data.frame( name = Names[i], @@ -191,13 +209,17 @@ CakeCost <- function (model, obs, x = "time", y = NULL, err = NULL, res = res)) CostVar <- rbind(CostVar, - data.frame( - name = Names[i], - scale = Scale, - N = length(Res), - SSR.unweighted = sum(Res^2), - SSR.unscaled = sum(res^2), - SSR = sum(resScaled^2))) + data.frame( + name = Names[i], + scale = Scale, + N = length(Res), + SSR.unweighted = sum(Res^2), + SSR.unscaled = sum(res^2), + SSR = sum(resScaled^2))) + + # print("************************") + # print(CostVar) + # print("************************") } # end loop over all observed variables ## SSR |