Parameter fitting log"

knitr::opts_chunk$set(echo = FALSE)
if(!exists("fit")) {
  # HACK: load environment to have (hopefully) some testing data in place for
  # vignette development
  message("Loading environment from `.Rdata` file ...")
  load(".Rdata")
}

R environment

Session information and package versions.

si <- sessionInfo()
# imitates the behavior of print.sessionInfo() but looks nicer
df <- data.frame(name=sapply(si$otherPkgs, `[[`, "Package"), version=sapply(si$otherPkgs, `[[`, "Version"))
if(nrow(df) == 0)
  df <- data.frame(name="none", version="-")
knitr::kable(df, caption="Other attached packages", row.names=FALSE)

df <- data.frame(name=sapply(si$loadedOnly, `[[`, "Package"), version=sapply(si$loadedOnly, `[[`, "Version"))
knitr::kable(df, caption="Loaded via namespace (not attached)", row.names=FALSE)

rm(si, df)

Configuration

calibration settings start values (> calibrate) error function (> calibrate) optim method > calibrate parameter boundaries (if used) > calibrate solver settings (method, rtol, atol?) > impossible atm

Experimental data

trial data by trial id observed > fit/cs weights? > fit/cs exposure > fit/cs

Fitted scenarios

scenario infos by trial id > fit, attach calisets name
parameters initial state transfers forcings

Results

r ifelse(fit$convergence == 0, "The parameter fit was **<g>SUCCESSFUL</g>**", "Problems occurred during fit. Please **<r>check results</r>**").

Fitted parameter values

cat(paste("- ", names(fit$par), ": ", fit$par, sep="", collapse="\n"))

Confidence intervals

Calculated using the Hessian matrix (r fit$dof degrees of freedom):

cat(paste("- ", names(fit$ci), ": [", paste(unlist(fit$ci), collapse="; "), "]",  sep="", collapse="\n"))

Additional outputs

knitr::kable(fit$hessian, caption="Hessian matrix")
# Original values of observed vs predicted
if(fit$err_fun != "sse") {
  knitr::kable(fit$hessian, caption="Hessian matrix")
}

fit result > fit return value obs vs pred (original, if necessary) > fit ✓ obs vs pred vs residuals (can be transformed) > fit ✓



Try the cvasi package in your browser

Any scripts or data that you put into this service are public.

cvasi documentation built on Sept. 11, 2025, 5:11 p.m.