# \donttest{
# use of \donttest{} because execution time exceeds 5 seconds
data(sim_wrc_hcc)
# define number of cores for parallel computations
if(interactive()) ncpu <- parallel::detectCores() - 1L else ncpu <- 1L
# estimate parameters for 3 samples by unconstrained, global optimisation
# algorithm NLOPT_GN_MLSL
# sample 1: use only conductivity data
# sample 2: use only water content data
# sample 3: use both types of data
rfit_uglob <- fit_wrc_hcc(
wrc_formula = wc ~ head | id, hcc_formula = hc ~ head | id,
wrc_subset = id != 1, hcc_subset = id != 2,
data = sim_wrc_hcc, fit_param = default_fit_param(tau = TRUE),
control = control_fit_wrc_hcc(param_bound = param_boundf(
alpha = c(0.00001, 50), n = c(1.0001, 7), tau = c(-1, 5)
), pcmp = control_pcmp(ncores = ncpu)))
print(rfit_uglob)
summary(rfit_uglob)
coef(rfit_uglob, what = "nonlinear")
coef(rfit_uglob, what = "linear", gof = TRUE)
coef(vcov(rfit_uglob), status = TRUE, se = FALSE)
op <- par(mfrow = c(3, 2))
plot(rfit_uglob)
on.exit(par(op))
# }
Run the code above in your browser using DataLab