From 3d6b4b4b8293a4a4ab6f06805e1380600373796c Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 18 Oct 2017 11:18:07 +0200 Subject: Version 2.0 --- CakeCost.R | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'CakeCost.R') diff --git a/CakeCost.R b/CakeCost.R index 1cc3981..40635f0 100644 --- a/CakeCost.R +++ b/CakeCost.R @@ -23,7 +23,7 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see # # -# $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 -- cgit v1.2.1