diff --git a/docs/articles/canopy-model.html b/docs/articles/canopy-model.html index 7545b07..eb5bd58 100644 --- a/docs/articles/canopy-model.html +++ b/docs/articles/canopy-model.html @@ -302,7 +302,7 @@
initials <- data.frame(
uid = c(195, 40),
- t1 = c(40, 60),
- t2 = c(70, 80),
+ t1 = c(70, 60),
+ t2 = c(40, 80),
k = c(100, 100)
)
@@ -356,8 +356,8 @@Providing different initial values
195 -40 70 +40 100 @@ -375,8 +375,7 @@ Providing different initial values y = Canopy, grp = Plot, fn = "fn_piwise", - parameters = c(t1 = 45, t2 = 80, k = 0.9), - initial_vals = initials, + parameters = initials, subset = c(195, 40), add_zero = TRUE ) @@ -399,14 +398,14 @@
Providing different initial values34.79943
53.73295 72.5438 -2845.5421 +2845.542 @@ -529,54 +528,54 @@ 195 -38.72534 -60.04934 +72.48588 +41.90441 91.7450 -390.4596 +6112.868 Comparing Models
rbind.data.frame( - mutate(mod_1$param, mod = "1"), - mutate(mod_2$param, mod = "2"), - mutate(mod_3$param, mod = "3"), - mutate(mod_4$param, mod = "4") + mutate(mod_1$param, model = "1", .before = uid), + mutate(mod_2$param, model = "2", .before = uid), + mutate(mod_3$param, model = "3", .before = uid), + mutate(mod_4$param, model = "4", .before = uid) ) |> - filter(uid %in% 40) |> + filter(uid %in% 195) |> kable()
model | uid | t1 | t2 | k | sse | -mod | ||||
---|---|---|---|---|---|---|---|---|---|---|
40 | -34.79943 | -53.73295 | -72.5438 | -2845.5421388 | 1 | +195 | +38.72534 | +60.04934 | +91.745 | +390.4596 |
40 | -34.79943 | -53.73295 | -72.5438 | -2845.5421388 | 2 | +195 | +72.48588 | +41.90441 | +91.745 | +6112.8678 |
40 | -34.80771 | -60.84828 | -100.0000 | -6268.4633265 | 3 | +195 | +38.72534 | +61.96802 | +100.000 | +663.0397 |
40 | -34.80771 | -60.84828 | -100.0000 | -0.0014765 | 4 | +195 | +38.72534 | +61.96802 | +100.000 | +0.0000 |
-fixed_params <- results |>
- pluck("dt_long") |>
- filter(var %in% "Canopy" & uid %in% c(195, 40)) |>
- group_by(uid) |>
- summarise(k = max(y), .groups = "drop")
fixed_params <- data.frame(uid = c(195, 40), k = c(100, 100))
mod_1 <- dt_chips |>
modeler(
@@ -263,7 +259,7 @@ Fitting models for plant height y = PH,
grp = Plot,
fn = "fn_exp2_exp",
- initial_vals = initials,
+ parameters = initials,
fixed_params = fixed_params,
subset = c(195, 40),
add_zero = TRUE
diff --git a/docs/articles/how_to_start.html b/docs/articles/how_to_start.html
index f912a7f..f326492 100644
--- a/docs/articles/how_to_start.html
+++ b/docs/articles/how_to_start.html
@@ -147,7 +147,7 @@ 1. Simple linear regression#>
#> Metrics:
#> Groups Timing Convergence Iterations
-#> 1 0.4126 secs 100% 259 (id)
Once the model is fitted, we can examine the output, extract the estimated parameters, make some plots, and predict new x values.
@@ -283,7 +283,7 @@2. Piece-wise regression#> #> Metrics: #> Groups Timing Convergence Iterations -#> 1 0.3895 secs 100% 511 (id)
After fitting the model, we can examine the results, plot the fitted curve, extract the coefficients and their associated p-values, obtain the variance-covariance matrix, and make predictions for unknown values @@ -335,8 +335,7 @@
fixed_params <- results |>
@@ -277,7 +277,7 @@ Passing initial values y = GLI_2,
grp = Plot,
fn = "fn_lin_pl_lin",
- initial_vals = initials,
+ parameters = initials,
subset = c(195, 40),
add_zero = TRUE
)
A named numeric vector specifying the initial values for the parameters to be optimized. Default is NULL
.
Can be a named numeric vector specifying the initial values for the parameters to be optimized,
+or a data frame with columns uid
, and the initial parameter values for each group id. Used for providing specific
+initial values per group id. Default is NULL
.
A data frame with columns uid
, and the initial parameter values for each group id. Used for providing specific initial values per group id.
A data frame with columns uid
, and the fixed parameter values for each group id. Used for fixing certain parameters during optimization.