summaryrefslogtreecommitdiff
path: root/CakeCost.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2017-10-18 11:18:07 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2017-10-18 11:18:07 +0200
commit3d6b4b4b8293a4a4ab6f06805e1380600373796c (patch)
tree4ec4dd041427b0154684122f5ae2101c7385f5e2 /CakeCost.R
parentbe6d42ef636e8e1c9fdcfa6f8738ee10e885d75b (diff)
Version 2.0v2.0
Diffstat (limited to 'CakeCost.R')
-rw-r--r--CakeCost.R38
1 files changed, 30 insertions, 8 deletions
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 <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

Contact - Imprint