[Dream-commits] r30 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 13 09:55:08 CEST 2010


Author: josephguillaume
Date: 2010-05-13 09:55:08 +0200 (Thu, 13 May 2010)
New Revision: 30

Added:
   pkg/man/calc.loglik.Rd
   pkg/man/calc.rmse.Rd
   pkg/man/calc.weighted.rmse.Rd
Modified:
   pkg/R/dreamCalibrate.R
   pkg/man/dreamCalibrate.Rd
Log:
- Default dreamCalibrate obj fun is RMSE
- Added placeholder help for log likelihood functions

Modified: pkg/R/dreamCalibrate.R
===================================================================
--- pkg/R/dreamCalibrate.R	2010-05-13 03:34:01 UTC (rev 29)
+++ pkg/R/dreamCalibrate.R	2010-05-13 07:55:08 UTC (rev 30)
@@ -29,14 +29,13 @@
 ## control: Wb,Cb,gamma,measurement.sigma
 calc.loglik <- function(predicted,observed,control=list(gamma=0)){
 
-  req.control <- c("gamma")
+  req.control <- c("gamma","sigma")
   if (!all(req.control %in% names(control)))
     stop(sprintf("Missing arguments to control: %s",
                  paste(req.control[!req.control %in% names(control)],collapse=", ")
                  ))
   
   if (!all(c("Cb","Wb") %in% names(control))) control <- modifyList(control,CalcCbWb(control$gamma))
-  if (! "sigma" %in% names(control)) control$sigma <- sd(observed)
   if (! "N" %in% names(control)) control$N <- length(observed)
 
   err <- as.numeric(observed-predicted)
@@ -51,7 +50,7 @@
 dreamCalibrate <- function(FUN,
                            pars,
                            obs,
-                           lik.fun=calc.loglik,
+                           lik.fun=calc.rmse,
                            lik.control=NULL,
                            FUN.pars=list(),
                            ... ##Extra arguments to dream

Added: pkg/man/calc.loglik.Rd
===================================================================
--- pkg/man/calc.loglik.Rd	                        (rev 0)
+++ pkg/man/calc.loglik.Rd	2010-05-13 07:55:08 UTC (rev 30)
@@ -0,0 +1,3 @@
+\name{calc.loglik}
+\title{Log likelihood function}
+\description{Calculate log likelihood of predicted values matching observed}
\ No newline at end of file


Property changes on: pkg/man/calc.loglik.Rd
___________________________________________________________________
Added: svn:executable
   + *

Added: pkg/man/calc.rmse.Rd
===================================================================
--- pkg/man/calc.rmse.Rd	                        (rev 0)
+++ pkg/man/calc.rmse.Rd	2010-05-13 07:55:08 UTC (rev 30)
@@ -0,0 +1,4 @@
+\name{calc.rmse}
+\title{RMSE log likelihood function}
+\description{Calculate log RMSE using formulas used by Vrugt}
+\details{This is used as the default, but it is recommended to use an objective function better suited to the particular problem}
\ No newline at end of file


Property changes on: pkg/man/calc.rmse.Rd
___________________________________________________________________
Added: svn:executable
   + *

Added: pkg/man/calc.weighted.rmse.Rd
===================================================================
--- pkg/man/calc.weighted.rmse.Rd	                        (rev 0)
+++ pkg/man/calc.weighted.rmse.Rd	2010-05-13 07:55:08 UTC (rev 30)
@@ -0,0 +1,2 @@
+\name{calc.weighted.rmse}
+\title{Sigma-weighted RMSE log likelihood function}
\ No newline at end of file


Property changes on: pkg/man/calc.weighted.rmse.Rd
___________________________________________________________________
Added: svn:executable
   + *

Modified: pkg/man/dreamCalibrate.Rd
===================================================================
--- pkg/man/dreamCalibrate.Rd	2010-05-13 03:34:01 UTC (rev 29)
+++ pkg/man/dreamCalibrate.Rd	2010-05-13 07:55:08 UTC (rev 30)
@@ -3,7 +3,7 @@
 \title{Utility to calibrate a function using dream}
 \usage{
 
-dreamCalibrate(FUN, pars, obs, lik.fun=calc.loglik,lik.control=NULL,FUN.pars = list(), ...)
+dreamCalibrate(FUN, pars, obs, lik.fun=calc.rmse,lik.control=NULL,FUN.pars = list(), ...)
 
 }
 \description{
@@ -23,7 +23,8 @@
   }
   \item{lik.fun}{
     A function that returns the log likelihood of model predictions
-    matching observed values. \code{log.lik=f(predicted,observed,control)} 
+    matching observed values. \code{log.lik=f(predicted,observed,control)}.
+	See included functions listed below. Default uses RMSE, as implemented by \code{\link{calc.rmse}}.
   }
   \item{lik.control}{
     A list of any extra arguments to be passed to \code{lik.fun}
@@ -41,6 +42,10 @@
   \code{\link[=predict.dream_model]{predict}},
   \code{\link[=coef.dream]{coef}}.
 
+Log likelihood functions included are:
+\code{\link{calc.rmse}},
+\code{\link{calc.weighted.rmse}},
+\code{\link{calc.loglik}}
 }
 \value{
   An object inheriting from \code{\link{dream}}, i.e. with the same elements and:



More information about the Dream-commits mailing list