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 @@

Fitting Models#> #> Metrics: #> Groups Timing Convergence Iterations -#> 2 0.9051 secs 100% 547 (id) +#> 2 0.8683 secs 100% 547 (id)
 plot(mod_1, id = c(195, 40))

plot fit

@@ -340,8 +340,8 @@

Providing different initial values
 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 195 -38.72534 -60.04934 +72.48588 +41.90441 91.7450 -390.4596 +6112.868 @@ -529,54 +528,54 @@

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 ssemod
4034.7994353.7329572.54382845.5421388 119538.7253460.0493491.745390.4596
4034.7994353.7329572.54382845.5421388 219572.4858841.9044191.7456112.8678
4034.8077160.84828100.00006268.4633265 319538.7253461.96802100.000663.0397
4034.8077160.84828100.00000.0014765 419538.7253461.96802100.0000.0000
diff --git a/docs/articles/canopy-model_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/canopy-model_files/figure-html/unnamed-chunk-13-1.png index 6d40aff..e995853 100644 Binary files a/docs/articles/canopy-model_files/figure-html/unnamed-chunk-13-1.png and b/docs/articles/canopy-model_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/docs/articles/height-model.html b/docs/articles/height-model.html index f6d0597..aea1607 100644 --- a/docs/articles/height-model.html +++ b/docs/articles/height-model.html @@ -131,11 +131,7 @@

Estimating days to emergenceFitting models for canopy

-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)

+#> 1 0.3649 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)

+#> 1 0.4007 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 @@

Providing Initial values x = time, y = variable, fn = "fun", - parameters = c(t1 = 45, t2 = 80, k = 90), - initial_vals = init + parameters = init ) mod_2 #> @@ -353,7 +352,7 @@

Providing Initial values#> #> Metrics: #> Groups Timing Convergence Iterations -#> 1 0.4191 secs 100% 567 (id) +#> 1 0.4342 secs 100% 567 (id) coef(mod_2) #> # A tibble: 3 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` @@ -390,8 +389,8 @@

Fixing parameters#> 1 38.6 60.6 13.6 98 #> #> Metrics: -#> Groups Timing Convergence Iterations -#> 1 0.3413 secs 100% 321 (id) +#> Groups Timing Convergence Iterations +#> 1 0.427 secs 100% 321 (id) coef(mod_3) #> # A tibble: 2 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` diff --git a/docs/articles/maturity-model.html b/docs/articles/maturity-model.html index d72a137..5525bb0 100644 --- a/docs/articles/maturity-model.html +++ b/docs/articles/maturity-model.html @@ -181,7 +181,7 @@

Fitting models for maturity -

Providing initial parameters from the canopy model +

Fixing parameters from the canopy model

 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 )

diff --git a/docs/articles/plotting.html b/docs/articles/plotting.html index 0e39bfe..597fc20 100644 --- a/docs/articles/plotting.html +++ b/docs/articles/plotting.html @@ -126,7 +126,7 @@

Expectation function and modeling#> #> Metrics: #> Groups Timing Convergence Iterations -#> 1 0.3954 secs 100% 334 (id) +#> 1 0.3531 secs 100% 334 (id)

Plotting predictions and derivatives diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 2545021..549c89c 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -7,7 +7,7 @@ articles: how_to_start: how_to_start.html maturity-model: maturity-model.html plotting: plotting.html -last_built: 2024-10-02T17:19Z +last_built: 2024-10-07T15:34Z urls: reference: https://apariciojohan.github.io/flexFitR/reference article: https://apariciojohan.github.io/flexFitR/articles diff --git a/docs/reference/coef.modeler.html b/docs/reference/coef.modeler.html index 82df45b..4b54bbd 100644 --- a/docs/reference/coef.modeler.html +++ b/docs/reference/coef.modeler.html @@ -126,7 +126,7 @@

Examples#> #> Metrics: #> Groups Timing Convergence Iterations -#> 3 1.3296 secs 100% 414 (id) +#> 3 1.3482 secs 100% 414 (id) #> coef(mod_1, id = 2) #> # A tibble: 3 × 6 diff --git a/docs/reference/confint.modeler.html b/docs/reference/confint.modeler.html index 56757a7..29ef292 100644 --- a/docs/reference/confint.modeler.html +++ b/docs/reference/confint.modeler.html @@ -131,7 +131,7 @@

Examples#> #> Metrics: #> Groups Timing Convergence Iterations -#> 3 1.8447 secs 100% 410 (id) +#> 3 1.9365 secs 100% 410 (id) #> confint(mod_1) #> # A tibble: 9 × 6 diff --git a/docs/reference/metrics.html b/docs/reference/metrics.html index 9e755cd..a0186f4 100644 --- a/docs/reference/metrics.html +++ b/docs/reference/metrics.html @@ -124,8 +124,8 @@

Examples#> 2 35.2 60.7 100.0 7.014 #> #> Metrics: -#> Groups Timing Convergence Iterations -#> 2 0.9089 secs 100% 469 (id) +#> Groups Timing Convergence Iterations +#> 2 0.951 secs 100% 469 (id) #> metrics(mod_1) #> # A tibble: 2 × 8 diff --git a/docs/reference/modeler-1.png b/docs/reference/modeler-1.png index 381f146..9f6cbcc 100644 Binary files a/docs/reference/modeler-1.png and b/docs/reference/modeler-1.png differ diff --git a/docs/reference/modeler.html b/docs/reference/modeler.html index f1a69e4..6c3b2e5 100644 --- a/docs/reference/modeler.html +++ b/docs/reference/modeler.html @@ -63,7 +63,6 @@

Usage parameters = NULL, lower = -Inf, upper = Inf, - initial_vals = NULL, fixed_params = NULL, method = c("subplex", "pracmanm", "anms"), return_method = FALSE, @@ -107,7 +106,9 @@

Argumentsparameters -

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.

lower
@@ -118,10 +119,6 @@

Argumentsinitial_vals -

A data frame with columns uid, and the initial parameter values for each group id. Used for providing specific initial values per group id.

- -
fixed_params

A data frame with columns uid, and the fixed parameter values for each group id. Used for fixing certain parameters during optimization.

@@ -235,7 +232,7 @@

Examples#> #> Metrics: #> Groups Timing Convergence Iterations -#> 1 0.9031 secs 100% 901 (id) +#> 1 0.8988 secs 100% 901 (id) #> # Example 2 mod_2 <- dt_potato |> @@ -266,7 +263,7 @@

Examples#> #> Metrics: #> Groups Timing Convergence Iterations -#> 1 0.5985 secs 100% 349 (id) +#> 1 0.5793 secs 100% 349 (id) #>

diff --git a/docs/reference/plot.modeler.html b/docs/reference/plot.modeler.html index bc544ff..e3d2089 100644 --- a/docs/reference/plot.modeler.html +++ b/docs/reference/plot.modeler.html @@ -189,7 +189,7 @@

Examples#> #> Metrics: #> Groups Timing Convergence Iterations -#> 3 1.4614 secs 100% 499.67 (id) +#> 3 1.4357 secs 100% 499.67 (id) #> plot(mod_1, id = 1:2) diff --git a/docs/reference/predict.modeler.html b/docs/reference/predict.modeler.html index 0a6a3e9..5af3808 100644 --- a/docs/reference/predict.modeler.html +++ b/docs/reference/predict.modeler.html @@ -170,7 +170,7 @@

Examples#> #> Metrics: #> Groups Timing Convergence Iterations -#> 3 1.4932 secs 100% 414 (id) +#> 3 1.3572 secs 100% 414 (id) #> # Point Prediction predict(mod_1, x = 45, type = "point", id = 2) diff --git a/docs/reference/print.modeler.html b/docs/reference/print.modeler.html index 0bf0674..579e99a 100644 --- a/docs/reference/print.modeler.html +++ b/docs/reference/print.modeler.html @@ -115,7 +115,7 @@

Examples#> #> Metrics: #> Groups Timing Convergence Iterations -#> 5 2.3334 secs 100% 435.2 (id) +#> 5 2.3763 secs 100% 435.2 (id) #> diff --git a/docs/reference/vcov.modeler.html b/docs/reference/vcov.modeler.html index 3bd90c5..b207aa6 100644 --- a/docs/reference/vcov.modeler.html +++ b/docs/reference/vcov.modeler.html @@ -120,7 +120,7 @@

Examples#> #> Metrics: #> Groups Timing Convergence Iterations -#> 3 1.3742 secs 100% 414 (id) +#> 3 1.3307 secs 100% 414 (id) #> vcov(mod_1) #> $`2` diff --git a/docs/search.json b/docs/search.json index 99cdfc7..75f69b6 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"loading-libraries","dir":"Articles","previous_headings":"","what":"Loading libraries","title":"Modelling Emergence and Maximun Canopy","text":"","code":"library(flexFitR) library(dplyr) library(kableExtra) library(ggpubr) library(purrr)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"exploring-data-explorer","dir":"Articles","previous_headings":"","what":"Exploring data explorer()","title":"Modelling Emergence and Maximun Canopy","text":"","code":"data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = Canopy, id = Plot) names(explorer) #> [1] \"summ_vars\" \"summ_metadata\" \"locals_min_max\" \"dt_long\" #> [5] \"metadata\""},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"data-exploration","dir":"Articles","previous_headings":"","what":"Data exploration","title":"Modelling Emergence and Maximun Canopy","text":"","code":"p1 <- plot(explorer, type = \"evolution\", return_gg = TRUE) p2 <- plot(explorer, type = \"x_by_var\", return_gg = TRUE) ggarrange(p1, p2)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"target-function","dir":"Articles","previous_headings":"","what":"Target Function","title":"Modelling Emergence and Maximun Canopy","text":"fn_piwise() \\[\\begin{equation} f(t; t_1, t_2, k) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t > t_2 \\end{cases} \\end{equation}\\]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"fitting-models","dir":"Articles","previous_headings":"","what":"Fitting Models","title":"Modelling Emergence and Maximun Canopy","text":"","code":"mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(195, 40), add_zero = TRUE ) mod_1 #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 390.5 1004.2 1618.0 1618.0 2231.8 2845.5 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 40 34.8 53.7 72.5 2846 #> 195 38.7 60.0 91.7 390 #> #> Metrics: #> Groups Timing Convergence Iterations #> 2 0.9051 secs 100% 547 (id) plot(mod_1, id = c(195, 40)) kable(mod_1$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"providing-different-initial-values","dir":"Articles","previous_headings":"","what":"Providing different initial values","title":"Modelling Emergence and Maximun Canopy","text":"","code":"initials <- data.frame( uid = c(195, 40), t1 = c(40, 60), t2 = c(70, 80), k = c(100, 100) ) kable(initials) mod_2 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), initial_vals = initials, subset = c(195, 40), add_zero = TRUE ) plot(mod_2, id = c(195, 40)) kable(mod_2$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"fixing-some-parameters-of-the-model","dir":"Articles","previous_headings":"","what":"Fixing some parameters of the model","title":"Modelling Emergence and Maximun Canopy","text":"","code":"fixed_params <- data.frame(uid = c(195, 40), k = c(100, 100)) kable(fixed_params) mod_3 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE ) plot(mod_3, id = c(195, 40)) kable(mod_3$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"correcting-maximun-value","dir":"Articles","previous_headings":"","what":"Correcting Maximun value","title":"Modelling Emergence and Maximun Canopy","text":"","code":"mod_4 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE, max_as_last = TRUE ) plot(mod_4, id = c(195, 40)) kable(mod_4$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"comparing-models","dir":"Articles","previous_headings":"","what":"Comparing Models","title":"Modelling Emergence and Maximun Canopy","text":"","code":"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\") ) |> filter(uid %in% 40) |> kable()"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"loading-libraries","dir":"Articles","previous_headings":"","what":"Loading libraries","title":"Modelling Plant Height","text":"","code":"library(flexFitR) library(dplyr) library(kableExtra) library(ggpubr) library(purrr)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"exploring-data-explorer","dir":"Articles","previous_headings":"","what":"Exploring data explorer()","title":"Modelling Plant Height","text":"","code":"data(dt_chips) results <- explorer(dt_chips, x = DAP, y = c(PH, Canopy), id = Plot) names(results) #> [1] \"summ_vars\" \"summ_metadata\" \"locals_min_max\" \"dt_long\" #> [5] \"metadata\""},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"data-exploration","dir":"Articles","previous_headings":"","what":"Data exploration","title":"Modelling Plant Height","text":"","code":"p1 <- plot(results, type = \"evolution\", return_gg = TRUE) p2 <- plot(results, type = \"x_by_var\", return_gg = TRUE) ggarrange(p1, p2, nrow = 2)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"estimating-days-to-emergence","dir":"Articles","previous_headings":"","what":"Estimating days to emergence","title":"Modelling Plant Height","text":"\\[\\begin{equation} f(t; t_1, t_2, k) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t > t_2 \\end{cases} \\end{equation}\\]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"fitting-models-for-canopy","dir":"Articles","previous_headings":"","what":"Fitting models for canopy","title":"Modelling Plant Height","text":"","code":"fixed_params <- results |> pluck(\"dt_long\") |> filter(var %in% \"Canopy\" & uid %in% c(195, 40)) |> group_by(uid) |> summarise(k = max(y), .groups = \"drop\") mod_1 <- dt_chips |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE, max_as_last = TRUE ) plot(mod_1, id = c(195, 40)) kable(mod_1$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"target-function-for-plant-height","dir":"Articles","previous_headings":"","what":"Target function for plant height","title":"Modelling Plant Height","text":"fn_exp2_exp() \\[\\begin{equation} f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)^2} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\left(e^{\\alpha \\cdot (t_2 - t_1)^2} - 1\\right) \\cdot e^{\\beta \\cdot (t - t_2)} & \\text{} t > t_2 \\end{cases} \\end{equation}\\]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"fixing-parameters-and-providing-initial-values","dir":"Articles","previous_headings":"","what":"Fixing parameters and providing initial values","title":"Modelling Plant Height","text":"","code":"fixed_params <- mod_1 |> pluck(\"param\") |> select(uid, t1) kable(fixed_params) initials <- mod_1 |> pluck(\"param\") |> select(uid, t1, t2) |> mutate(alpha = 1 / 600, beta = -1 / 30) kable(initials)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"fitting-models-for-plant-height","dir":"Articles","previous_headings":"","what":"Fitting models for plant height","title":"Modelling Plant Height","text":"Using t1 previous model fixed parameter using t2 initial parameter per plot.","code":"mod_2 <- dt_chips |> modeler( x = DAP, y = PH, grp = Plot, fn = \"fn_exp2_exp\", initial_vals = initials, fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE ) plot(mod_2, id = c(195, 40)) kable(mod_2$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"getting-started","dir":"Articles","previous_headings":"","what":"Getting started","title":"How to start","text":"basic idea vignette illustrate users use flexFitR package. ’ll start basic example: simple linear regression. Although example primary focus package, serve demonstrate use.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"simple-linear-regression","dir":"Articles","previous_headings":"","what":"1. Simple linear regression","title":"How to start","text":"example, ’ll work small dataset consisting 6 observations, X independent variable Y dependent variable. First, define objective function. case, function fn_lm represent linear regression, b intercept m slope regression. plot_fn function, integrated package, allows us plot function parameters provided. useful visualizing shape function fitting model data. fit model, use modeler function. function, pass x independent variable, y dependent variable, vector parameters assign initial values coefficient b coefficient m. model fitted, can examine output, extract estimated parameters, make plots, predict new x values. order get coefficients variance-covariance matrix make use coef vcov function, takes model object argument. Finally, can make predictions using predict function, takes fitted model object X value want make prediction. can compare lm function R, give results similar obtained package.","code":"library(flexFitR) library(dplyr) library(ggpubr) dt <- data.frame(X = 1:6, Y = c(12, 16, 44, 50, 95, 100)) plot(explorer(dt, X, Y), type = \"xy\") fn_lm <- function(x, b, m) { y <- b + m * x return(y) } plot_fn(fn = \"fn_lm\", params = c(b = 10, m = 5)) mod <- dt |> modeler( x = X, y = Y, fn = \"fn_lm\", parameters = c(b = -5, m = 10) ) mod #> #> Call: #> Y ~ fn_lm(x, b, m) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> -12.5905 -6.0762 -0.3476 0.0000 6.1952 12.8952 #> #> Optimization Results `head()`: #> uid b m sse #> 1 -15.5 19.5 449 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.4126 secs 100% 259 (id) a <- plot(mod, color = \"blue\", title = \"Raw data\") b <- plot(mod, type = 4, n_points = 200, color = \"black\") ggarrange(a, b) coef(mod) #> # A tibble: 2 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 1 b -15.5 9.86 -1.57 0.192 #> 2 1 m 19.5 2.53 7.71 0.00152 vcov(mod) #> $`1` #> b m #> b 97.21937 -22.435238 #> m -22.43524 6.410068 predict(mod, x = 4.5) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 1 4.5 72.3 5.01"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"comparison-with-lm","dir":"Articles","previous_headings":"1. Simple linear regression","what":"Comparison with lm","title":"How to start","text":"previous example fairly simple, can consider complex scenario need fit just one function, hundreds functions several groups. can achieved using grp argument modeler function. Additionally, can parallelize processes setting parallel argument TRUE defining number cores use. ’s important note depending functions defined user, parameters may need constrained, required greater less zero. cases, certain parameters might need fixed known values. complex situations, many curves fit working complex functions—whether non linear regressions specific parameter constraints cases parameters fixed group—modeler offers extensive flexibility.","code":"mo <- lm(Y ~ X, data = dt) summary(mo)$coefficients #> Estimate Std. Error t value Pr(>|t|) #> (Intercept) -15.46667 9.859988 -1.568629 0.191812151 #> X 19.51429 2.531811 7.707639 0.001524882 vcov(mo) #> (Intercept) X #> (Intercept) 97.21937 -22.435238 #> X -22.43524 6.410068 predict(mo, newdata = data.frame(X = 4.5), se.fit = TRUE) #> $fit #> 1 #> 72.34762 #> #> $se.fit #> [1] 5.010599 #> #> $df #> [1] 4 #> #> $residual.scale #> [1] 10.59133"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"piece-wise-regression","dir":"Articles","previous_headings":"","what":"2. Piece-wise regression","title":"How to start","text":"following example, although still simple, represents slightly complex function greater number parameters. case, piece-wise regression, parameterized t1, t2, k, defined following expression: fitting model, let’s take look example dataset. can make plot piecewise function fit model using modeler function. fitting model, can examine results, plot fitted curve, extract coefficients associated p-values, obtain variance-covariance matrix, make predictions unknown values x. Finally, illustrate provide different initial values function dealing multiple groups, also show fix parameters objective function.","code":"fun <- function(t, t1 = 45, t2 = 80, k = 0.9) { if (t < t1) { y <- 0 } else if (t >= t1 && t <= t2) { y <- k / (t2 - t1) * (t - t1) } else { y <- k } return(y) } dt <- data.frame( time = c(0, 29, 36, 42, 56, 76, 92, 100, 108), variable = c(0, 0, 0.67, 15.11, 77.38, 99.81, 99.81, 99.81, 99.81) ) plot(explorer(dt, time, variable), type = \"xy\") plot_fn(fn = \"fun\", params = c(t1 = 25, t2 = 70, k = 90)) mod_1 <- dt |> modeler( x = time, y = variable, fn = \"fun\", parameters = c(t1 = 45, t2 = 80, k = 90) ) mod_1 #> #> Call: #> variable ~ fun(x, t1, t2, k) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.00000 0.00000 0.00000 0.07444 0.00000 0.67000 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61 99.8 0.449 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.3895 secs 100% 511 (id) plot(mod_1) # Coefficients coef(mod_1) #> # A tibble: 3 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 1 t1 38.6 0.0779 496. 4.54e-15 #> 2 1 t2 61.0 0.0918 665. 7.82e-16 #> 3 1 k 99.8 0.137 730. 4.47e-16 # Variance-Covariance Matrix vcov(mod_1) #> $`1` #> t1 t2 k #> t1 6.061705e-03 -0.002940001 1.877072e-07 #> t2 -2.940001e-03 0.008431400 4.204939e-03 #> k 1.877072e-07 0.004204939 1.870426e-02 # Making predictions predict(mod_1, x = 45) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 1 45 28.5 0.223"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"providing-initial-values","dir":"Articles","previous_headings":"2. Piece-wise regression","what":"Providing Initial values","title":"How to start","text":"example, don’t grouping variable. However, default, function assigns unique identifier (uid) dataset. , need specify uid = 1 initial values fixed parameters. one group, need modify parameters argument accordingly. approach primarily illustrative purposes.","code":"init <- data.frame(uid = 1, t1 = 20, t2 = 30, k = 0.8) mod_2 <- dt |> modeler( x = time, y = variable, fn = \"fun\", parameters = c(t1 = 45, t2 = 80, k = 90), initial_vals = init ) mod_2 #> #> Call: #> variable ~ fun(x, t1, t2, k) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.00000 0.00000 0.00000 0.07444 0.00000 0.67000 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61 99.8 0.449 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.4191 secs 100% 567 (id) coef(mod_2) #> # A tibble: 3 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 1 t1 38.6 0.0779 496. 4.54e-15 #> 2 1 t2 61.0 0.0918 665. 7.82e-16 #> 3 1 k 99.8 0.137 730. 4.47e-16"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"fixing-parameters","dir":"Articles","previous_headings":"2. Piece-wise regression","what":"Fixing parameters","title":"How to start","text":"vignette provided basic introduction using flexFitR package, starting simple examples linear regression piecewise regression. goal demonstrate fundamental features flexibility package. However, complex situations can arise working high-throughput phenotypic (HTP) data, involve multiple groups, parameter constraints, advanced modeling scenarios. complex situations illustrated vignettes, use real HTP data showcase full capabilities flexFitR package.","code":"fix <- data.frame(uid = 1, k = 98) mod_3 <- dt |> modeler( x = time, y = variable, fn = \"fun\", parameters = c(t1 = 45, t2 = 80, k = 90), fixed_params = fix ) mod_3 #> #> Call: #> variable ~ fun(x, t1, t2, k) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.0000 0.0000 0.6700 0.8789 1.8100 1.8100 #> #> Optimization Results `head()`: #> uid t1 t2 sse k #> 1 38.6 60.6 13.6 98 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.3413 secs 100% 321 (id) coef(mod_3) #> # A tibble: 2 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 1 t1 38.6 0.396 97.5 3.15e-12 #> 2 1 t2 60.6 0.429 141. 2.34e-13 plot(mod_3) rbind(metrics(mod_1), metrics(mod_2), metrics(mod_3)) #> # A tibble: 3 × 8 #> uid var SSE MAE MSE RMSE r_squared n #> #> 1 1 variable 0.449 0.0744 0.0499 0.223 1.00 9 #> 2 1 variable 0.449 0.0744 0.0499 0.223 1.00 9 #> 3 1 variable 13.6 0.879 1.51 1.23 0.999 9"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"loading-libraries","dir":"Articles","previous_headings":"","what":"Loading libraries","title":"Modelling Maturity","text":"","code":"library(flexFitR) library(dplyr) library(kableExtra) library(ggpubr) library(purrr)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"exploring-data-explorer","dir":"Articles","previous_headings":"","what":"Exploring data explorer()","title":"Modelling Maturity","text":"","code":"data(dt_potato) results <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) names(results) #> [1] \"summ_vars\" \"summ_metadata\" \"locals_min_max\" \"dt_long\" #> [5] \"metadata\""},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"data-exploration","dir":"Articles","previous_headings":"","what":"Data exploration","title":"Modelling Maturity","text":"","code":"p1 <- plot(results, type = \"evolution\", return_gg = TRUE) p2 <- plot(results, type = \"x_by_var\", return_gg = TRUE) ggarrange(p1, p2, nrow = 2)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"target-function-for-maturity","dir":"Articles","previous_headings":"","what":"Target function for maturity","title":"Modelling Maturity","text":"fn_lin_pl_lin() \\[\\begin{equation} f(t; t_1, t_2, t_3, k, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t_2 \\leq t \\leq t_3 \\\\ k + \\beta \\cdot (t - t_3) & \\text{} t > t_3 \\end{cases} \\end{equation}\\]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"fitting-models-for-maturity","dir":"Articles","previous_headings":"","what":"Fitting models for maturity","title":"Modelling Maturity","text":"","code":"mod_1 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin\", parameters = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), subset = c(195, 40), add_zero = TRUE ) plot(mod_1, id = c(195, 40)) kable(mod_1$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"providing-initial-parameters-from-the-canopy-model","dir":"Articles","previous_headings":"","what":"Providing initial parameters from the canopy model","title":"Modelling Maturity","text":"","code":"fixed_params <- results |> pluck(\"dt_long\") |> filter(var %in% \"Canopy\" & uid %in% c(195, 40)) |> group_by(uid) |> summarise(k = max(y), .groups = \"drop\") mod_2 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE, max_as_last = TRUE ) plot(mod_2, id = c(195, 40)) kable(mod_2$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"passing-initial-values","dir":"Articles","previous_headings":"","what":"Passing initial values","title":"Modelling Maturity","text":"","code":"initials <- mod_2 |> pluck(\"param\") |> select(uid, t1, t2) |> mutate(t3 = 100, k = 0.32, beta = -0.01) kable(initials) mod_3 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin\", initial_vals = initials, subset = c(195, 40), add_zero = TRUE ) plot(mod_3, id = c(195, 40)) kable(mod_3$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"adding-constrains-to-the-optimization","dir":"Articles","previous_headings":"","what":"Adding constrains to the optimization","title":"Modelling Maturity","text":"","code":"mod_4 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin2\", parameters = c(t1 = 38.7, t2 = 62, dt = 28, k = 0.32, beta = -0.01), lower = c(-Inf, -Inf, 0, -Inf, -Inf), upper = c(Inf, Inf, Inf, Inf, 0), method = c(\"nlminb\", \"L-BFGS-B\"), subset = c(195, 40), add_zero = TRUE ) plot(mod_4, id = c(195, 40)) kable(mod_4$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/plotting.html","id":"example-dataset-and-loading-libraries","dir":"Articles","previous_headings":"","what":"Example dataset and loading libraries","title":"Plotting Options","text":"","code":"library(flexFitR) library(dplyr) library(ggpubr) set.seed(10) dt <- data.frame( time = c(0, 29, 36, 42, 56, 76, 92, 100, 108), variable = c(0, 0, 0.67, 15.11, 77.38, 99.81, 99.81, 99.81, 99.81) ) |> mutate(variable = variable + rnorm(n = n(), mean = 5, sd = 6))"},{"path":"https://apariciojohan.github.io/flexFitR/articles/plotting.html","id":"expectation-function-and-modeling","dir":"Articles","previous_headings":"","what":"Expectation function and modeling","title":"Plotting Options","text":"","code":"fn <- function(t, t0, t1, t2) t0 / (1 + exp((t1 - t) / t2)) mod <- dt |> modeler( x = time, y = variable, fn = \"fn\", parameters = c(t0 = 100, t1 = 50, t2 = 5) ) mod #> #> Call: #> variable ~ fn(x, t0, t1, t2) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> -6.1496 -2.9462 2.1181 0.4716 3.2479 6.7654 #> #> Optimization Results `head()`: #> uid t0 t1 t2 sse #> 1 101 49.2 4.01 169 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.3954 secs 100% 334 (id)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/plotting.html","id":"plotting-predictions-and-derivatives","dir":"Articles","previous_headings":"","what":"Plotting predictions and derivatives","title":"Plotting Options","text":"","code":"a <- plot(mod, color = \"blue\", title = \"Raw data\") b <- plot(mod, type = 4, n_points = 200, color = \"black\") c <- plot(mod, type = 5, n_points = 200, color = \"black\") d <- plot(mod, type = 6, n_points = 200, color = \"black\") ggarrange(a, b, c, d)"},{"path":"https://apariciojohan.github.io/flexFitR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Johan Aparicio. Author, maintainer. Jeffrey Endelman. Author. University Wisconsin Madison. Copyright holder.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Aparicio J, Endelman J (2024). flexFitR: Flexible Non-Linear Least Square Modelling. R package version 0.1.0, https://github.com/AparicioJohan/flexFitR, https://apariciojohan.github.io/flexFitR/.","code":"@Manual{, title = {flexFitR: Flexible Non-Linear Least Square Modelling}, author = {Johan Aparicio and Jeffrey Endelman}, year = {2024}, note = {R package version 0.1.0, https://github.com/AparicioJohan/flexFitR}, url = {https://apariciojohan.github.io/flexFitR/}, }"},{"path":[]},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement johanstevenapa@gmail.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"flexfitr-","dir":"","previous_headings":"","what":"Flexible Non-Linear Least Square Modelling","title":"Flexible Non-Linear Least Square Modelling","text":"flexFitR R package designed efficient modeling analysis large complex datasets. offers powerful tools parameter estimation, model fitting, visualization, leveraging {optimx} package optimization future package parallel processing.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Flexible Non-Linear Least Square Modelling","text":"can install development version flexFitR GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"AparicioJohan/flexFitR\")"},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"Flexible Non-Linear Least Square Modelling","text":"Parameter Estimation: Utilizes {optimx} derivative-free algorithms solve estimate parameters given function. Parallelization: Implements parallel processing using future package, enabling efficient fitting hundreds curves simultaneously. Visualization Tools: Provides variety plots visualize model fits, correlations, predictions, . Statistical Rigor: Offers standard errors p-values coefficients, supporting robust conclusions interpretations. Prediction: Facilitates prediction non-observed data points. Flexibility: Allows users fix certain parameters model specify different initial values per grouping factor. Custom Modeling Functions: Equipped built-modeling functions common analysis tasks, also permitting users supply custom functions.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Flexible Non-Linear Least Square Modelling","text":"’s simple example get started flexFitR. example demonstrates fitting piecewise regression model:","code":"library(flexFitR) dt <- data.frame( time = c(0, 29, 36, 42, 56, 76, 92, 100, 108), variable = c(0, 0, 0.67, 15.11, 77.38, 99.81, 99.81, 99.81, 99.81) ) plot(explorer(dt, time, variable), type = \"xy\") fun <- function(t, t1 = 45, t2 = 80, k = 0.9) { if (t < t1) { y <- 0 } else if (t >= t1 && t <= t2) { y <- k / (t2 - t1) * (t - t1) } else { y <- k } return(y) } # Fitting piecewise regression mod_1 <- dt |> modeler( x = time, y = variable, fn = \"fun\", parameters = c(t1 = 45, t2 = 80, k = 90) ) print(mod_1) Call: variable ~ fun(x, t1, t2, k) Residuals: Min. 1st Qu. Median Mean 3rd Qu. Max. 0.00000 0.00000 0.00000 0.07444 0.00000 0.67000 Optimization Results `head()`: uid t1 t2 k sse 1 38.6 61 99.8 0.449 Metrics: Groups Timing Convergence Iterations 1 0.4068 secs 100% 511 (id) # Auto plot plot(mod_1) # Coefficients coef(mod_1) # A tibble: 3 × 6 uid coefficient solution std.error `t value` `Pr(>|t|)` 1 1 t1 38.6 0.0779 496. 4.54e-15 2 1 t2 61.0 0.0918 665. 7.82e-16 3 1 k 99.8 0.137 730. 4.47e-16 # Variance-Covariance Matrix vcov(mod_1) $`1` t1 t2 k t1 6.061705e-03 -0.002940001 1.877072e-07 t2 -2.940001e-03 0.008431400 4.204939e-03 k 1.877072e-07 0.004204939 1.870426e-02 # Making predictions predict(mod_1, x = 45) # A tibble: 1 × 4 uid x_new predicted.value std.error 1 1 45 28.5 0.223"},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"Flexible Non-Linear Least Square Modelling","text":"detailed documentation examples, visit flexFitR Vignette 1: start Vignette 2: Modeling Canopy Vignette 3: Modeling Plant Height Vignette 4: Modeling VIs","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Flexible Non-Linear Least Square Modelling","text":"Contributions flexFitR welcome! ’d like contribute, please fork repository submit pull request. significant changes, please open issue first discuss ideas.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Flexible Non-Linear Least Square Modelling","text":"Please note flexFitR project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Flexible Non-Linear Least Square Modelling","text":"flexFitR licensed MIT License. See LICENSE file details.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 flexFitR authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"Perform extra sum--squares F-test compare two nested models class modeler. test assesses whether additional parameters full model significantly improve fit compared reduced model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"","code":"# S3 method for class 'modeler' anova(reduced_model, full_model = NULL, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"reduced_model object class modeler representing reduced model fewer parameters. full_model optional object class modeler representing full model parameters. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"tibble containing columns F-statistic corresponding p-values, indicating whether full model provides significantly better fit reduced model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"","code":"library(flexFitR) dt <- data.frame(X = 1:6, Y = c(12, 16, 44, 50, 95, 100)) mo_1 <- modeler(dt, X, Y, fn = \"fn_lin\", param = c(m = 10, b = -5)) #> Loading required package: foreach #> Loading required package: future plot(mo_1) mo_2 <- modeler(dt, X, Y, fn = \"fn_quad\", param = c(a = 1, b = 10, c = 5)) plot(mo_2) anova(mo_1, mo_2) #> # A tibble: 1 × 9 #> uid RSS_reduced RSS_full n df1 df2 F `Pr(>F)` . #> #> 1 1 449. 385. 6 1 3 0.494 0.533 ns"},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Coefficients of a Modeler Object — coef.modeler","title":"Coefficients of a Modeler Object — coef.modeler","text":"Extract estimated coefficients object class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coefficients of a Modeler Object — coef.modeler","text":"","code":"# S3 method for class 'modeler' coef(x, id = NULL, metadata = FALSE, df = FALSE, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coefficients of a Modeler Object — coef.modeler","text":"x object class modeler, typically result calling modeler() function. id optional unique identifier filter specific group. Default NULL. metadata Logical. TRUE, metadata included along coefficients. Default FALSE. df Logical. TRUE, degrees freedom fitted model returned alongside coefficients. Default FALSE. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coefficients of a Modeler Object — coef.modeler","text":"data.frame containing model's estimated coefficients, standard errors, optional metadata degrees freedom specified.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Coefficients of a Modeler Object — coef.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coefficients of a Modeler Object — coef.modeler","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(15, 2, 45), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.002601 0.504829 1.007057 2.674719 4.010777 7.014498 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 2 35.2 60.7 100.0 7.0145 #> 15 38.5 69.4 99.8 1.0071 #> 45 38.3 64.5 100.0 0.0026 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.3296 secs 100% 414 (id) #> coef(mod_1, id = 2) #> # A tibble: 3 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 2 t1 35.2 0.239 147. 6.57e-12 #> 2 2 t2 60.7 0.371 164. 3.53e-12 #> 3 2 k 100. 0.541 185. 1.68e-12"},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Confidence Intervals for a modeler Object — confint.modeler","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"Extract confidence intervals estimated parameters object class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"","code":"# S3 method for class 'modeler' confint(x, parm = NULL, level = 0.95, id = NULL, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"x object class modeler, typically result calling modeler() function. parm character vector specifying parameters confidence intervals calculated. NULL, confidence intervals parameters returned. Default NULL. level numeric value indicating confidence level intervals. Default 0.95, corresponding 95% confidence interval. id optional unique identifier filter specific group. Default NULL. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"tibble containing lower upper confidence limits specified parameter.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"","code":"library(flexFitR) data(dt_potato) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(15, 35, 45), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.002601 0.504829 1.007057 0.968957 1.452134 1.897212 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 15 38.5 69.4 99.8 1.0071 #> 35 52.2 61.4 100.0 1.8972 #> 45 38.3 64.5 100.0 0.0026 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.8447 secs 100% 410 (id) #> confint(mod_1) #> # A tibble: 9 × 6 #> uid coefficient solution std.error ci_lower ci_upper #> #> 1 15 t1 38.5 0.162 38.1 38.8 #> 2 15 t2 69.4 0.283 68.7 70.1 #> 3 15 k 99.8 0.205 99.3 100. #> 4 35 t1 52.2 2.00 47.3 57.1 #> 5 35 t2 61.4 2.87 54.4 68.5 #> 6 35 k 100. 0.281 99.3 101. #> 7 45 t1 38.3 0.00704 38.3 38.3 #> 8 45 t2 64.5 0.00972 64.4 64.5 #> 9 45 k 100. 0.0104 100. 100."},{"path":"https://apariciojohan.github.io/flexFitR/reference/dot-fitter_curve.html","id":null,"dir":"Reference","previous_headings":"","what":"General-purpose optimization — .fitter_curve","title":"General-purpose optimization — .fitter_curve","text":"function .fitter_curve used internally find parameters requested.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dot-fitter_curve.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"General-purpose optimization — .fitter_curve","text":"","code":".fitter_curve(data, id, fn, method, lower, upper, control, .keep)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/dot-fitter_curve.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"General-purpose optimization — .fitter_curve","text":"data nested data.frame columns . id optional vector IDs filter data. Default NULL, meaning ids used. fn string specifying name function used curve fitting. Default \"fn_piwise\". method character vector specifying optimization methods used. See optimx package available methods. Default c(\"subplex\", \"pracmanm\", \"anms\"). lower Numeric vector specifying lower bounds parameters. Default -Inf parameters. upper Numeric vector specifying upper bounds parameters. Default Inf parameters. control list control parameters passed optimization function. example, list(maxit = 500).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dot-fitter_curve.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"General-purpose optimization — .fitter_curve","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) mod_1 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin\", parameters = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), subset = 195, add_zero = TRUE )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_chips.html","id":null,"dir":"Reference","previous_headings":"","what":"Drone Data in Potato 2022 — dt_chips","title":"Drone Data in Potato 2022 — dt_chips","text":"Vegetative indices biomass related traits potato trial arranged p-rep design.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_chips.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drone Data in Potato 2022 — dt_chips","text":"","code":"dt_chips"},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_chips.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Drone Data in Potato 2022 — dt_chips","text":"tibble 1568 rows 17 variables: Trial chr trial name DAP dbl denoting Days planting Plot dbl denoting unique plot id Row dbl denoting row coordinate Range dbl denoting range coordinate Gen chr denoting genotype id Yield dbl Total Yield measured end season VineMaturity dbl VineMaturity measure season Red - Canopy dbl denoting drone-derived traits","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_chips.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Drone Data in Potato 2022 — dt_chips","text":"UW - Potato Breeding Program","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_potato.html","id":null,"dir":"Reference","previous_headings":"","what":"Drone Data in Potato 2020 — dt_potato","title":"Drone Data in Potato 2020 — dt_potato","text":"Vegetative indices biomass related traits potato trial arranged p-rep design.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_potato.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drone Data in Potato 2020 — dt_potato","text":"","code":"dt_potato"},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_potato.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Drone Data in Potato 2020 — dt_potato","text":"tibble 1372 rows 17 variables: Trial chr trial name DAP dbl denoting Days planting Plot dbl denoting unique plot id Row dbl denoting row coordinate Range dbl denoting range coordinate Gen chr denoting genotype id Yield dbl Total Yield measured end season VineMaturity dbl VineMaturity measure season Red - Canopy dbl denoting drone-derived traits","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_potato.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Drone Data in Potato 2020 — dt_potato","text":"UW - Potato Breeding Program","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":null,"dir":"Reference","previous_headings":"","what":"Explore Data — explorer","title":"Explore Data — explorer","text":"Explores data data frame wide format.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Explore Data — explorer","text":"","code":"explorer(data, x, y, id, metadata)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Explore Data — explorer","text":"data data.frame wide format containing data. x name column `data` contains x points. y names columns `data` contain variables analyzed. id names columns `data` contains grouping variable. metadata names columns `data` keep across analysis.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Explore Data — explorer","text":"object class explorer, list containing following elements: summ_vars data.frame containing summary statistics trait x point, including minimum, mean, median, maximum, standard deviation, coefficient variation, number non-missing values, percentage missing values, percentage negative values. summ_metadata data.frame summarizing metadata. locals_min_max data.frame containing local minima maxima mean y values x. dt_long data.frame long format, columns uid, metadata, var, x, y metadata character vector names variables keep across.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Explore Data — explorer","text":"function helps explore dataset analyzed modeler().","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Explore Data — explorer","text":"","code":"library(flexFitR) data(dt_potato) results <- dt_potato |> explorer( x = DAP, y = c(Canopy, PH), id = Plot, metadata = c(Gen, Row, Range) ) names(results) #> [1] \"summ_vars\" \"summ_metadata\" \"locals_min_max\" \"dt_long\" #> [5] \"metadata\" head(results$summ_vars) #> # A tibble: 6 × 12 #> var x Min Mean Median Max SD CV n miss `miss%` #> #> 1 Canopy 29 0 0 0 0 0 NaN 196 0 0 #> 2 Canopy 36 0 2.95 1.84 15.1 3.22 1.09 196 0 0 #> 3 Canopy 42 0.763 23.4 22.9 46.2 9.31 0.398 196 0 0 #> 4 Canopy 56 33.4 75.8 75.2 98.9 12.4 0.164 196 0 0 #> 5 Canopy 76 89.1 99.7 100 100 1.04 0.0104 196 0 0 #> 6 Canopy 92 62.5 97.0 98.4 100. 4.36 0.0449 196 0 0 #> # ℹ 1 more variable: `neg%` plot(results, label_size = 4, signif = TRUE, n_row = 2) # New data format head(results$dt_long) #> # A tibble: 6 × 7 #> uid Gen Row Range var x y #> #> 1 1 W17037-24 1 1 Canopy 29 0 #> 2 1 W17037-24 1 1 PH 29 NA #> 3 1 W17037-24 1 1 Canopy 36 0.67 #> 4 1 W17037-24 1 1 PH 36 0.0154 #> 5 1 W17037-24 1 1 Canopy 42 15.1 #> 6 1 W17037-24 1 1 PH 42 0.0173"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential Exponential Function 1 — fn_exp1_exp","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"Computes value based exponential growth curve exponential decay model time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"","code":"fn_exp1_exp(t, t1, t2, alpha, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"t Numeric. time value. t1 Numeric. lower threshold time. Assumed known. t2 Numeric. upper threshold time. alpha Numeric. parameter first exponential term. Must greater 0. beta Numeric. parameter second exponential term. Must less 0.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"numeric value based double exponential model. t less t1, function returns 0. t t1 t2 (inclusive), function returns exp(alpha * (t - t1)) - 1. t greater t2, function returns (exp(alpha * (t2 - t1)) - 1) * exp(beta * (t - t2)).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"$$ f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\left(e^{\\alpha \\cdot (t_2 - t_1)} - 1\\right) \\cdot e^{\\beta \\cdot (t - t_2)} & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_exp1_exp\", params = c(t1 = 35, t2 = 55, alpha = 1 / 20, beta = -1 / 30), interval = c(0, 108), n_points = 2000, auc_label_size = 3, y_auc_label = 0.2 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential Linear Function 1 — fn_exp1_lin","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"Computes value based exponential growth curve linear decay model time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"","code":"fn_exp1_lin(t, t1, t2, alpha, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"t Numeric. time value. t1 Numeric. lower threshold time. Assumed known. t2 Numeric. upper threshold time. alpha Numeric. parameter exponential term. Must greater 0. beta Numeric. parameter linear term. Must less 0.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"numeric value based exponential linear model. t less t1, function returns 0. t t1 t2 (inclusive), function returns exp(alpha * (t - t1)) - 1. t greater t2, function returns beta * (t - t2) + (exp(alpha * (t2 - t1)) - 1).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"$$ f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\beta \\cdot (t - t_2) + \\left(e^{\\alpha \\cdot (t_2 - t_1)} - 1\\right) & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_exp1_lin\", params = c(t1 = 35, t2 = 55, alpha = 1 / 20, beta = -1 / 40), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential Exponential Function 2 — fn_exp2_exp","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"Computes value based exponential growth curve exponential decay model time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"","code":"fn_exp2_exp(t, t1, t2, alpha, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"t Numeric. time value. t1 Numeric. lower threshold time. Assumed known. t2 Numeric. upper threshold time. alpha Numeric. parameter first exponential term. Must greater 0. beta Numeric. parameter second exponential term. Must less 0.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"numeric value based double exponential model. t less t1, function returns 0. t t1 t2 (inclusive), function returns exp(alpha * (t - t1)^2) - 1. t greater t2, function returns (exp(alpha * (t2 - t1)^2) - 1) * exp(beta * (t - t2)).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"$$ f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)^2} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\left(e^{\\alpha \\cdot (t_2 - t_1)^2} - 1\\right) \\cdot e^{\\beta \\cdot (t - t_2)} & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_exp2_exp\", params = c(t1 = 35, t2 = 55, alpha = 1 / 600, beta = -1 / 30), interval = c(0, 108), n_points = 2000, auc_label_size = 3, y_auc_label = 0.15 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential Linear Function 2 — fn_exp2_lin","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"Computes value based exponential growth curve linear decay model time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"","code":"fn_exp2_lin(t, t1, t2, alpha, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"t Numeric. time value. t1 Numeric. lower threshold time. Assumed known. t2 Numeric. upper threshold time. alpha Numeric. parameter exponential term. Must greater 0. beta Numeric. parameter linear term. Must less 0.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"numeric value based exponential linear model. t less t1, function returns 0. t t1 t2 (inclusive), function returns exp(alpha * (t - t1)^2) - 1. t greater t2, function returns beta * (t - t2) + (exp(alpha * (t2 - t1)^2) - 1).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"$$ f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)^2} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\beta \\cdot (t - t_2) + \\left(e^{\\alpha \\cdot (t_2 - t_1)^2} - 1\\right) & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_exp2_lin\", params = c(t1 = 35, t2 = 55, alpha = 1 / 600, beta = -1 / 80), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear Function — fn_lin","title":"Linear Function — fn_lin","text":"Computes value based linear function.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear Function — fn_lin","text":"","code":"fn_lin(t, m, b)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear Function — fn_lin","text":"t Numeric value. m Numeric value slope coefficient. b Numeric value intercept coefficient.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear Function — fn_lin","text":"numeric value based linear function.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear Function — fn_lin","text":"$$ f(t; m, b) = m \\cdot t + b $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear Function — fn_lin","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_lin\", params = c(m = 2, b = 10), interval = c(0, 108), n_points = 2000 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear Plateau Linear — fn_lin_pl_lin","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"Linear Plateau Linear","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"","code":"fn_lin_pl_lin(t, t1, t2, t3, k, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"t Numeric. time value. t1 Numeric. lower threshold time. Default 45. t2 Numeric. upper threshold time plateau. Default 80. t3 Numeric. lower threshold time plateau. Default 45. k Numeric. maximum value function. Default 0.9. beta Numeric. Slope linear decay.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"numeric value based linear plateau linear model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"$$ f(t; t_1, t_2, t_3, k, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t_2 \\leq t \\leq t_3 \\\\ k + \\beta \\cdot (t - t_3) & \\text{} t > t_3 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_lin_pl_lin\", params = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"Linear Plateau Linear Constrains","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"","code":"fn_lin_pl_lin2(t, t1, t2, dt, k, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"t Numeric. time value. t1 Numeric. lower threshold time. t2 Numeric. upper threshold time plateau. dt Numeric. dt = t3 - t2. k Numeric. maximum value function. beta Numeric. Slope linear decay.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"numeric value based linear plateau linear model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"$$ f(t; t_1, t_2, dt, k, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t_2 \\leq t \\leq (t_2 + dt) \\\\ k + \\beta \\cdot (t - (t_2 + dt)) & \\text{} t > (t_2 + dt) \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_lin_pl_lin2\", params = c(t1 = 38.7, t2 = 62, dt = 28, k = 0.32, beta = -0.01), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"Linear Plateau Linear Constrains","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"","code":"fn_lin_pl_lin3(t, t1, t2, t3, k, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"t Numeric. time value. t1 Numeric. lower threshold time. Default 45. t2 Numeric. upper threshold time plateau. Default 80. t3 Numeric. lower threshold time plateau. Default 45. k Numeric. maximum value function. Default 0.9. beta Numeric. Slope linear decay.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"numeric value based linear plateau linear model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"$$ f(t; t_1, t_2, t_3, k, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t_2 \\leq t \\leq t_3 \\\\ k + \\beta \\cdot (t - t_3) & \\text{} t > t_3 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_lin_pl_lin3\", params = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":null,"dir":"Reference","previous_headings":"","what":"Piecewise Linear Regression — fn_piwise","title":"Piecewise Linear Regression — fn_piwise","text":"Computes value based linear growth curve reaching plateau time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Piecewise Linear Regression — fn_piwise","text":"","code":"fn_piwise(t, t1 = 45, t2 = 80, k = 0.9)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Piecewise Linear Regression — fn_piwise","text":"t Numeric. time value. t1 Numeric. lower threshold time. Default 45. t2 Numeric. upper threshold time. Default 80. k Numeric. maximum value function. Default 0.9. Assumed known.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Piecewise Linear Regression — fn_piwise","text":"numeric value based threshold model. t less t1, function returns 0. t t1 t2 (inclusive), function returns value 0 k linear trend. t greater t2, function returns k.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Piecewise Linear Regression — fn_piwise","text":"$$ f(t; t_1, t_2, k) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Piecewise Linear Regression — fn_piwise","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_piwise\", params = c(t1 = 34.9, t2 = 61.8, k = 100), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":null,"dir":"Reference","previous_headings":"","what":"Quadratic Function — fn_quad","title":"Quadratic Function — fn_quad","text":"Computes value based quadratic function..","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quadratic Function — fn_quad","text":"","code":"fn_quad(t, a, b, c)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quadratic Function — fn_quad","text":"t Numeric value. Numeric value coefficient . b Numeric value coefficient b. c Numeric value coefficient c.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quadratic Function — fn_quad","text":"numeric value based linear function.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Quadratic Function — fn_quad","text":"$$ f(t; , b, c) = \\cdot t^2 + b \\cdot t + c $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quadratic Function — fn_quad","text":"","code":"library(flexFitR) plot_fn(fn = \"fn_quad\", params = c(a = 1, b = 10, c = 5))"},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":null,"dir":"Reference","previous_headings":"","what":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"Generic function calculating Akaike's ‘Information Criterion’ fitted model object class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"","code":"# S3 method for class 'modeler' AIC(object, ..., k = 2) # S3 method for class 'modeler' BIC(object, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"object object inheriting class modeler resulting executing function modeler() ... parameters. future improvements. k Numeric, penalty per parameter used; default k = 2 classical AIC.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"tibble columns giving corresponding AIC BIC.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"","code":"library(flexFitR) dt <- data.frame(X = 1:6, Y = c(12, 16, 44, 50, 95, 100)) mo_1 <- modeler(dt, X, Y, fn = \"fn_lin\", param = c(m = 10, b = -5)) mo_2 <- modeler(dt, X, Y, fn = \"fn_quad\", param = c(a = 1, b = 10, c = 5)) AIC(mo_1) #> uid logLik df nobs p AIC #> 1 1 -21.45745 3 6 2 48.9149 AIC(mo_2) #> uid logLik df nobs p AIC #> 1 1 -21.00014 4 6 3 50.00028 BIC(mo_1) #> uid logLik df nobs p BIC #> 1 1 -21.45745 3 6 2 48.29017 BIC(mo_2) #> uid logLik df nobs p BIC #> 1 1 -21.00014 4 6 3 49.16732"},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"logLik object class modeler","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"","code":"# S3 method for class 'modeler' logLik(object, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"object object inheriting class modeler resulting executing function modeler() ... parameters. future improvements.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"tibble Log-Likelihood fitted models.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"","code":"library(flexFitR) dt <- data.frame(X = 1:6, Y = c(12, 16, 44, 50, 95, 100)) mo_1 <- modeler(dt, X, Y, fn = \"fn_lin\", param = c(m = 10, b = -5)) plot(mo_1) logLik(mo_1) #> uid logLik df nobs p #> 1 1 -21.45745 3 6 2"},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":null,"dir":"Reference","previous_headings":"","what":"Metrics for modeler — metrics","title":"Metrics for modeler — metrics","text":"Computes various performance metrics modeler object. function calculates Sum Squared Errors (SSE), Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Coefficient Determination (R-squared).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Metrics for modeler — metrics","text":"","code":"metrics(x, by_grp = TRUE)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Metrics for modeler — metrics","text":"x object class `modeler` containing necessary data compute metrics. by_grp Return metrics id? TRUE default.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Metrics for modeler — metrics","text":"data frame containing calculated metrics grouped uid, metadata, variables.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Metrics for modeler — metrics","text":"Sum Squared Errors (SSE): $$SSE = \\sum_{=1}^{n} (y_i - \\hat{y}_i)^2$$Mean Absolute Error (MAE): $$MAE = \\frac{1}{n} \\sum_{=1}^{n} |y_i - \\hat{y}_i|$$Mean Squared Error (MSE): $$MSE = \\frac{1}{n} \\sum_{=1}^{n} (y_i - \\hat{y}_i)^2$$Root Mean Squared Error (RMSE): $$RMSE = \\sqrt{\\frac{1}{n} \\sum_{=1}^{n} (y_i - \\hat{y}_i)^2}$$Coefficient Determination (R-squared): $$R^2 = 1 - \\frac{\\sum_{=1}^{n} (y_i - \\hat{y}_i)^2}{\\sum_{=1}^{n} (y_i - \\bar{y})^2}$$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Metrics for modeler — metrics","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, PH), id = Plot) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(1:2), add_zero = TRUE, max_as_last = TRUE ) plot(mod_1, id = c(1:2)) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.4489 2.0903 3.7317 3.7317 5.3731 7.0145 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61.0 99.8 0.449 #> 2 35.2 60.7 100.0 7.014 #> #> Metrics: #> Groups Timing Convergence Iterations #> 2 0.9089 secs 100% 469 (id) #> metrics(mod_1) #> # A tibble: 2 × 8 #> uid var SSE MAE MSE RMSE r_squared n #> #> 1 1 Canopy 0.449 0.0744 0.0499 0.223 1.00 9 #> 2 2 Canopy 7.01 0.468 0.779 0.883 1.00 9"},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Modeler — modeler","title":"Modeler — modeler","text":"General-purpose optimization techniques non-linear least squares problems.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Modeler — modeler","text":"","code":"modeler( data, x, y, grp, keep, fn = \"fn_piwise\", parameters = NULL, lower = -Inf, upper = Inf, initial_vals = NULL, fixed_params = NULL, method = c(\"subplex\", \"pracmanm\", \"anms\"), return_method = FALSE, subset = NULL, add_zero = FALSE, check_negative = FALSE, max_as_last = FALSE, progress = FALSE, parallel = FALSE, workers = max(1, parallel::detectCores(), na.rm = TRUE), control = list() )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Modeler — modeler","text":"data data.frame wide format. x name column `data` contains x points. y name column `data` contain variable analyzed. Must match var data. grp names columns `data` contains grouping variable. (Optional). keep names columns `data` keep across analysis. fn string specifying name function used curve fitting. Default \"fn_piwise\". parameters named numeric vector specifying initial values parameters optimized. Default NULL. lower Numeric vector specifying lower bounds parameters. Default -Inf parameters. upper Numeric vector specifying upper bounds parameters. Default Inf parameters. initial_vals data frame columns uid, initial parameter values group id. Used providing specific initial values per group id. fixed_params data frame columns uid, fixed parameter values group id. Used fixing certain parameters optimization. method character vector specifying optimization methods used. Check `optimx::checkallsolvers()` available methods. Default c(\"subplex\", \"pracmanm\", \"anms\"). return_method Logical. TRUE, includes optimization method used result. Default FALSE. subset optional vector levels `grp` filter data. Default NULL, meaning groups used. add_zero Logical. TRUE, adds zero value series start. Default FALSE. check_negative Logical. TRUE, converts negative values data zero. Default FALSE. max_as_last Logical. TRUE, appends maximum value reaching maximum. Default FALSE. progress Logical. TRUE progress bar displayed. Default FALSE. Try running function: progressr::handlers(\"progress\", \"beepr\"). parallel Logical. TRUE model fit performed parallel. Default FALSE. workers number parallel processes use. `parallel::detectCores()` control list control parameters passed optimization function. example: list(maxit = 500).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Modeler — modeler","text":"object class modeler, list containing following elements: param data frame containing optimized parameters related information. dt data frame data used fitted values. fn call used fitting models. metrics Metrics summary models. execution Execution time. response Response variable. keep Metadata keep across. fun Name function. parallel List returning parallel workers. fit List fitted models.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Modeler — modeler","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) # Example 1 mod_1 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin\", parameters = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), subset = 195, add_zero = TRUE ) plot(mod_1, id = 195) print(mod_1) #> #> Call: #> GLI_2 ~ fn_lin_pl_lin(x, t1, t2, t3, k, beta) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> -0.011076 -0.002262 0.000000 -0.001676 0.000000 0.002262 #> #> Optimization Results `head()`: #> uid t1 t2 t3 k beta sse #> 195 39.6 68.3 93.3 0.323 -0.01 0.000149 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.9031 secs 100% 901 (id) #> # Example 2 mod_2 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = 195, add_zero = TRUE, max_as_last = TRUE ) plot(mod_2, id = 195) print(mod_2) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> -1.340e-09 0.000e+00 0.000e+00 -9.481e-11 1.391e-10 1.391e-10 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 195 38.7 62 100 1.88e-18 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.5985 secs 100% 349 (id) #>"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot an object of class explorer — plot.explorer","title":"Plot an object of class explorer — plot.explorer","text":"Creates various plots object class explorer. Depending specified type, function can generate plots show correlations variables x, correlations x values variable, evolution variables x.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot an object of class explorer — plot.explorer","text":"","code":"# S3 method for class 'explorer' plot( x, type = \"var_by_x\", label_size = 4, signif = FALSE, method = \"pearson\", filter_var = NULL, id = NULL, n_row = NULL, n_col = NULL, base_size = 13, return_gg = FALSE, add_avg = FALSE, ... )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot an object of class explorer — plot.explorer","text":"x object inheriting class explorer, resulting executing function explorer(). type Character string number specifying type plot generate. Available options : \"var_by_x\" 1 Plots correlations variables x (default). \"x_by_var\" 2 Plots correlations x points variable (y). \"evolution\" 3 Plot evolution variables (y) x. \"xy\" 4 Scatterplot (x, y) label_size Numeric. Size labels plot. Default 4. works type 1 2. signif Logical. TRUE, adds p-values correlation plot labels. Default FALSE. works type 1 2. method Character string specifying method correlation calculation. Available options \"pearson\" (default), \"spearman\", \"kendall\". works type 1 2. filter_var Character vector specifying variables exclude plot. id Optional unique identifier filter evolution type plot. Default NULL. works type 3. n_row Integer specifying number rows use facet_wrap(). Default NULL. works type 1 2. n_col Integer specifying number columns use facet_wrap(). Default NULL. works type 1 2. base_size Numeric. Base font size plot. Default 13. return_gg Logical. TRUE, returns ggplot object instead printing . Default FALSE. add_avg Logical. TRUE, returns evolution plot average trend across groups. Default FALSE. ... graphical parameters future improvements.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot an object of class explorer — plot.explorer","text":"ggplot object invisible data.frame containing correlation table type \"var_by_x\" \"x_by_var\".","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot an object of class explorer — plot.explorer","text":"","code":"library(flexFitR) data(dt_potato) dt_potato <- dt_potato results <- explorer(dt_potato, x = DAP, y = c(Canopy, PH), id = Plot) table <- plot(results, label_size = 4, signif = TRUE, n_row = 2) table #> # A tibble: 7 × 7 #> x col row corr p.value n signi #> #> 1 36 Canopy PH 0.46 8.23e-11 176 *** #> 2 42 Canopy PH 0.67 8.55e-27 196 *** #> 3 56 Canopy PH -0.21 3.65e- 3 196 ** #> 4 76 Canopy PH 0.3 1.41e- 5 196 *** #> 5 92 Canopy PH 0.28 5.96e- 5 196 *** #> 6 100 Canopy PH 0.32 6.45e- 6 196 *** #> 7 108 Canopy PH 0.07 3.14e- 1 196 ns plot(results, type = \"x_by_var\", label_size = 4, signif = TRUE)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot an object of class modeler — plot.modeler","title":"Plot an object of class modeler — plot.modeler","text":"Create several plots object class modeler","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot an object of class modeler — plot.modeler","text":"","code":"# S3 method for class 'modeler' plot( x, id = NULL, type = 1, label_size = 4, base_size = 14, color = \"red\", parm = NULL, n_points = 2000, title = NULL, add_ci = TRUE, add_ribbon = FALSE, color_ribbon = \"blue\", ... )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot an object of class modeler — plot.modeler","text":"x object class modeler, typically result calling modeler(). id optional group ID filter data plotting, useful avoiding overcrowded plots. type Numeric value (1-6) specify type plot generate. Default 1. type = 1 Plot raw data fitted curves. type = 2 Plot coefficients confidence intervals. type = 3 Plot fitted curves, colored group. type = 4 Plot fitted curves confidence intervals. type = 5 Plot first derivative confidence intervals. type = 6 Plot second derivative confidence intervals. label_size Numeric value size labels. Default 4. base_size Numeric value base font size pts. Default 14. color Character string specifying color fitted line type = 1. Default \"red\". parm Character vector specifying parameters plot type = 2. NULL, parameters included. n_points Numeric value specifying number points interpolation along x-axis. Default 2000. title Optional character string add title plot. add_ci Logical value indicating whether add confidence intervals type = 4, 5, 6. Default TRUE. add_ribbon Logical value indicating whether add ribbon confidence intervals type = 4, 5, 6. Default FALSE. color_ribbon Character string specifying color ribbon. Default \"blue\". ... Additional graphical parameters future extensions.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot an object of class modeler — plot.modeler","text":"ggplot object representing specified plot.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot an object of class modeler — plot.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot an object of class modeler — plot.modeler","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) # Example 1 mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(1:3), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.4489 2.3551 4.2612 3.9082 5.6379 7.0145 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61.0 99.8 0.449 #> 2 35.2 60.7 100.0 7.014 #> 3 33.8 59.9 100.0 4.261 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.4614 secs 100% 499.67 (id) #> plot(mod_1, id = 1:2) plot(mod_1, id = 1:3, type = 2, label_size = 10)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Function — plot_fn","title":"Plot Function — plot_fn","text":"function plots user-defined function specified interval annotates plot calculated Area Curve (AUC) parameter values. aim `plot_fn` allow users play different Starting Values functions fitting models.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Function — plot_fn","text":"","code":"plot_fn( fn = \"fn_piwise\", params = c(t1 = 34.9, t2 = 61.8, k = 100), interval = c(0, 100), n_points = 1000, auc = FALSE, x_auc_label = NULL, y_auc_label = NULL, auc_label_size = 4, param_label_size = 4, base_size = 12, color = \"red\", label_color = \"grey30\" )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Function — plot_fn","text":"fn character string representing name function plotted. Default \"fn_piwise\". params named numeric vector parameters passed function. Default c(t1 = 34.9, t2 = 61.8, k = 100). interval numeric vector length 2 specifying interval function plotted. Default c(0, 100). n_points integer specifying number points used plotting. Default 1000. auc Print AUC plot? Default FALSE. x_auc_label numeric value specifying x-coordinate AUC label. Default NULL. y_auc_label numeric value specifying y-coordinate AUC label. Default NULL. auc_label_size numeric value specifying size AUC label text. Default 3. param_label_size numeric value specifying size parameter label text. Default 3. base_size numeric value specifying base size plot's theme. Default 12. color character string specifying color plot lines area fill. Default \"red\". label_color character string specifying color labels. Default \"grey30\".","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Function — plot_fn","text":"ggplot object representing plot.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Function — plot_fn","text":"","code":"# Example usage plot_fn( fn = \"fn_piwise\", params = c(t1 = 34.9, t2 = 61.8, k = 100), interval = c(0, 100), n_points = 1000 ) plot_fn( fn = \"fn_lin_pl_lin\", params <- c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), interval = c(0, 100), n_points = 1000, base_size = 12 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Predict an object of class modeler — predict.modeler","title":"Predict an object of class modeler — predict.modeler","text":"Generate model predictions object class modeler. function allows flexible prediction types, including point predictions, area curve (AUC), first second order derivatives.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Predict an object of class modeler — predict.modeler","text":"","code":"# S3 method for class 'modeler' predict( object, x = NULL, id = NULL, type = c(\"point\", \"auc\", \"fd\", \"sd\"), se_interval = c(\"confidence\", \"prediction\"), n_points = 1000, metadata = FALSE, ... )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Predict an object of class modeler — predict.modeler","text":"object object class modeler, typically result calling modeler() function. x numeric value vector specifying points predictions made. type = \"auc\", x must vector length 2 specifies interval calculate AUC. id Optional unique identifier filter predictions specific group. Default NULL. type character string specifying type prediction. Default \"point\". \"point\" Predicts value y given x. \"auc\" Calculates area curve (AUC) fitted model interval specified x. \"fd\" Returns first derivative (rate change) model given x value(s). \"sd\" Returns second derivative model given x value(s). se_interval character string specifying type interval standard error calculation. Options \"confidence\" (default) \"prediction\". n_points integer specifying number points used approximate area curve (AUC) type = \"auc\". Default 1000. metadata Logical. TRUE, metadata included predictions. Default FALSE. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Predict an object of class modeler — predict.modeler","text":"data.frame containing predicted values, associated standard errors, optionally metadata.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Predict an object of class modeler — predict.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Predict an object of class modeler — predict.modeler","text":"","code":"library(flexFitR) data(dt_potato) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(15, 2, 45), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.002601 0.504829 1.007057 2.674719 4.010777 7.014498 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 2 35.2 60.7 100.0 7.0145 #> 15 38.5 69.4 99.8 1.0071 #> 45 38.3 64.5 100.0 0.0026 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.4932 secs 100% 414 (id) #> # Point Prediction predict(mod_1, x = 45, type = \"point\", id = 2) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 2 45 38.4 0.622 # AUC Prediction predict(mod_1, x = c(0, 108), type = \"auc\", id = 2) #> # A tibble: 1 × 5 #> uid x_min x_max predicted.value std.error #> #> 1 2 0 108 6004. 30.8 # First Derivative predict(mod_1, x = 45, type = \"fd\", id = 2) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 2 45 3.91 0.0741 # Second Derivative predict(mod_1, x = 45, type = \"sd\", id = 2) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 2 45 -0.0000000298 0.0000274"},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Print an object of class modeler — print.modeler","title":"Print an object of class modeler — print.modeler","text":"Prints information modeler function.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print an object of class modeler — print.modeler","text":"","code":"# S3 method for class 'modeler' print(x, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print an object of class modeler — print.modeler","text":"x object fitted function modeler(). ... Options used tibble package format output. See `tibble::print()` details.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print an object of class modeler — print.modeler","text":"object inheriting class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Print an object of class modeler — print.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print an object of class modeler — print.modeler","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, PH), id = Plot) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(1:5), add_zero = TRUE, max_as_last = TRUE ) plot(mod_1, id = c(1:5)) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.000000 0.000049 0.448900 2.344930 4.261203 7.014498 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61.0 99.8 4.49e-01 #> 2 35.2 60.7 100.0 7.01e+00 #> 3 33.8 59.9 100.0 4.26e+00 #> 4 39.3 65.5 99.8 4.60e-18 #> #> Metrics: #> Groups Timing Convergence Iterations #> 5 2.3334 secs 100% 435.2 (id) #>"},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"Extract variance-covariance matrix parameter estimates object class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"","code":"# S3 method for class 'modeler' vcov(x, id = NULL, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"x object class modeler, typically result calling modeler() function. id optional unique identifier filter specific group. Default NULL. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"list matrices, matrix represents variance-covariance matrix estimated parameters group fit.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"","code":"library(flexFitR) data(dt_potato) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(15, 2, 45), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.002601 0.504829 1.007057 2.674719 4.010777 7.014498 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 2 35.2 60.7 100.0 7.0145 #> 15 38.5 69.4 99.8 1.0071 #> 45 38.3 64.5 100.0 0.0026 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.3742 secs 100% 414 (id) #> vcov(mod_1) #> $`2` #> t1 t2 k #> t1 5.694008e-02 -0.02923676 3.683474e-06 #> t2 -2.923676e-02 0.13796365 7.471629e-02 #> k 3.683474e-06 0.07471629 2.922726e-01 #> #> $`15` #> t1 t2 k #> t1 2.636323e-02 -0.02728600 1.691502e-07 #> t2 -2.728600e-02 0.08035361 1.300394e-02 #> k 1.691502e-07 0.01300394 4.196055e-02 #> #> $`45` #> t1 t2 k #> t1 4.956862e-05 -3.526927e-05 4.195078e-11 #> t2 -3.526927e-05 9.453221e-05 2.835289e-05 #> k 4.195078e-11 2.835289e-05 1.083750e-04 #>"},{"path":"https://apariciojohan.github.io/flexFitR/news/index.html","id":"flexfitr-010","dir":"Changelog","previous_headings":"","what":"flexFitR 0.1.0","title":"flexFitR 0.1.0","text":"Initial CRAN submission.","code":""}] +[{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"loading-libraries","dir":"Articles","previous_headings":"","what":"Loading libraries","title":"Modelling Emergence and Maximun Canopy","text":"","code":"library(flexFitR) library(dplyr) library(kableExtra) library(ggpubr) library(purrr)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"exploring-data-explorer","dir":"Articles","previous_headings":"","what":"Exploring data explorer()","title":"Modelling Emergence and Maximun Canopy","text":"","code":"data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = Canopy, id = Plot) names(explorer) #> [1] \"summ_vars\" \"summ_metadata\" \"locals_min_max\" \"dt_long\" #> [5] \"metadata\""},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"data-exploration","dir":"Articles","previous_headings":"","what":"Data exploration","title":"Modelling Emergence and Maximun Canopy","text":"","code":"p1 <- plot(explorer, type = \"evolution\", return_gg = TRUE) p2 <- plot(explorer, type = \"x_by_var\", return_gg = TRUE) ggarrange(p1, p2)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"target-function","dir":"Articles","previous_headings":"","what":"Target Function","title":"Modelling Emergence and Maximun Canopy","text":"fn_piwise() \\[\\begin{equation} f(t; t_1, t_2, k) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t > t_2 \\end{cases} \\end{equation}\\]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"fitting-models","dir":"Articles","previous_headings":"","what":"Fitting Models","title":"Modelling Emergence and Maximun Canopy","text":"","code":"mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(195, 40), add_zero = TRUE ) mod_1 #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 390.5 1004.2 1618.0 1618.0 2231.8 2845.5 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 40 34.8 53.7 72.5 2846 #> 195 38.7 60.0 91.7 390 #> #> Metrics: #> Groups Timing Convergence Iterations #> 2 0.8683 secs 100% 547 (id) plot(mod_1, id = c(195, 40)) kable(mod_1$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"providing-different-initial-values","dir":"Articles","previous_headings":"","what":"Providing different initial values","title":"Modelling Emergence and Maximun Canopy","text":"","code":"initials <- data.frame( uid = c(195, 40), t1 = c(70, 60), t2 = c(40, 80), k = c(100, 100) ) kable(initials) mod_2 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = initials, subset = c(195, 40), add_zero = TRUE ) plot(mod_2, id = c(195, 40)) kable(mod_2$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"fixing-some-parameters-of-the-model","dir":"Articles","previous_headings":"","what":"Fixing some parameters of the model","title":"Modelling Emergence and Maximun Canopy","text":"","code":"fixed_params <- data.frame(uid = c(195, 40), k = c(100, 100)) kable(fixed_params) mod_3 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE ) plot(mod_3, id = c(195, 40)) kable(mod_3$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"correcting-maximun-value","dir":"Articles","previous_headings":"","what":"Correcting Maximun value","title":"Modelling Emergence and Maximun Canopy","text":"","code":"mod_4 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE, max_as_last = TRUE ) plot(mod_4, id = c(195, 40)) kable(mod_4$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/canopy-model.html","id":"comparing-models","dir":"Articles","previous_headings":"","what":"Comparing Models","title":"Modelling Emergence and Maximun Canopy","text":"","code":"rbind.data.frame( 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% 195) |> kable()"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"loading-libraries","dir":"Articles","previous_headings":"","what":"Loading libraries","title":"Modelling Plant Height","text":"","code":"library(flexFitR) library(dplyr) library(kableExtra) library(ggpubr) library(purrr)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"exploring-data-explorer","dir":"Articles","previous_headings":"","what":"Exploring data explorer()","title":"Modelling Plant Height","text":"","code":"data(dt_chips) results <- explorer(dt_chips, x = DAP, y = c(PH, Canopy), id = Plot) names(results) #> [1] \"summ_vars\" \"summ_metadata\" \"locals_min_max\" \"dt_long\" #> [5] \"metadata\""},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"data-exploration","dir":"Articles","previous_headings":"","what":"Data exploration","title":"Modelling Plant Height","text":"","code":"p1 <- plot(results, type = \"evolution\", return_gg = TRUE) p2 <- plot(results, type = \"x_by_var\", return_gg = TRUE) ggarrange(p1, p2, nrow = 2)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"estimating-days-to-emergence","dir":"Articles","previous_headings":"","what":"Estimating days to emergence","title":"Modelling Plant Height","text":"\\[\\begin{equation} f(t; t_1, t_2, k) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t > t_2 \\end{cases} \\end{equation}\\]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"fitting-models-for-canopy","dir":"Articles","previous_headings":"","what":"Fitting models for canopy","title":"Modelling Plant Height","text":"","code":"fixed_params <- data.frame(uid = c(195, 40), k = c(100, 100)) mod_1 <- dt_chips |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE, max_as_last = TRUE ) plot(mod_1, id = c(195, 40)) kable(mod_1$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"target-function-for-plant-height","dir":"Articles","previous_headings":"","what":"Target function for plant height","title":"Modelling Plant Height","text":"fn_exp2_exp() \\[\\begin{equation} f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)^2} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\left(e^{\\alpha \\cdot (t_2 - t_1)^2} - 1\\right) \\cdot e^{\\beta \\cdot (t - t_2)} & \\text{} t > t_2 \\end{cases} \\end{equation}\\]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"fixing-parameters-and-providing-initial-values","dir":"Articles","previous_headings":"","what":"Fixing parameters and providing initial values","title":"Modelling Plant Height","text":"","code":"fixed_params <- mod_1 |> pluck(\"param\") |> select(uid, t1) kable(fixed_params) initials <- mod_1 |> pluck(\"param\") |> select(uid, t1, t2) |> mutate(alpha = 1 / 600, beta = -1 / 30) kable(initials)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/height-model.html","id":"fitting-models-for-plant-height","dir":"Articles","previous_headings":"","what":"Fitting models for plant height","title":"Modelling Plant Height","text":"Using t1 previous model fixed parameter using t2 initial parameter per plot.","code":"mod_2 <- dt_chips |> modeler( x = DAP, y = PH, grp = Plot, fn = \"fn_exp2_exp\", parameters = initials, fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE ) plot(mod_2, id = c(195, 40)) kable(mod_2$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"getting-started","dir":"Articles","previous_headings":"","what":"Getting started","title":"How to start","text":"basic idea vignette illustrate users use flexFitR package. ’ll start basic example: simple linear regression. Although example primary focus package, serve demonstrate use.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"simple-linear-regression","dir":"Articles","previous_headings":"","what":"1. Simple linear regression","title":"How to start","text":"example, ’ll work small dataset consisting 6 observations, X independent variable Y dependent variable. First, define objective function. case, function fn_lm represent linear regression, b intercept m slope regression. plot_fn function, integrated package, allows us plot function parameters provided. useful visualizing shape function fitting model data. fit model, use modeler function. function, pass x independent variable, y dependent variable, vector parameters assign initial values coefficient b coefficient m. model fitted, can examine output, extract estimated parameters, make plots, predict new x values. order get coefficients variance-covariance matrix make use coef vcov function, takes model object argument. Finally, can make predictions using predict function, takes fitted model object X value want make prediction. can compare lm function R, give results similar obtained package.","code":"library(flexFitR) library(dplyr) library(ggpubr) dt <- data.frame(X = 1:6, Y = c(12, 16, 44, 50, 95, 100)) plot(explorer(dt, X, Y), type = \"xy\") fn_lm <- function(x, b, m) { y <- b + m * x return(y) } plot_fn(fn = \"fn_lm\", params = c(b = 10, m = 5)) mod <- dt |> modeler( x = X, y = Y, fn = \"fn_lm\", parameters = c(b = -5, m = 10) ) mod #> #> Call: #> Y ~ fn_lm(x, b, m) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> -12.5905 -6.0762 -0.3476 0.0000 6.1952 12.8952 #> #> Optimization Results `head()`: #> uid b m sse #> 1 -15.5 19.5 449 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.3649 secs 100% 259 (id) a <- plot(mod, color = \"blue\", title = \"Raw data\") b <- plot(mod, type = 4, n_points = 200, color = \"black\") ggarrange(a, b) coef(mod) #> # A tibble: 2 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 1 b -15.5 9.86 -1.57 0.192 #> 2 1 m 19.5 2.53 7.71 0.00152 vcov(mod) #> $`1` #> b m #> b 97.21937 -22.435238 #> m -22.43524 6.410068 predict(mod, x = 4.5) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 1 4.5 72.3 5.01"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"comparison-with-lm","dir":"Articles","previous_headings":"1. Simple linear regression","what":"Comparison with lm","title":"How to start","text":"previous example fairly simple, can consider complex scenario need fit just one function, hundreds functions several groups. can achieved using grp argument modeler function. Additionally, can parallelize processes setting parallel argument TRUE defining number cores use. ’s important note depending functions defined user, parameters may need constrained, required greater less zero. cases, certain parameters might need fixed known values. complex situations, many curves fit working complex functions—whether non linear regressions specific parameter constraints cases parameters fixed group—modeler offers extensive flexibility.","code":"mo <- lm(Y ~ X, data = dt) summary(mo)$coefficients #> Estimate Std. Error t value Pr(>|t|) #> (Intercept) -15.46667 9.859988 -1.568629 0.191812151 #> X 19.51429 2.531811 7.707639 0.001524882 vcov(mo) #> (Intercept) X #> (Intercept) 97.21937 -22.435238 #> X -22.43524 6.410068 predict(mo, newdata = data.frame(X = 4.5), se.fit = TRUE) #> $fit #> 1 #> 72.34762 #> #> $se.fit #> [1] 5.010599 #> #> $df #> [1] 4 #> #> $residual.scale #> [1] 10.59133"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"piece-wise-regression","dir":"Articles","previous_headings":"","what":"2. Piece-wise regression","title":"How to start","text":"following example, although still simple, represents slightly complex function greater number parameters. case, piece-wise regression, parameterized t1, t2, k, defined following expression: fitting model, let’s take look example dataset. can make plot piecewise function fit model using modeler function. fitting model, can examine results, plot fitted curve, extract coefficients associated p-values, obtain variance-covariance matrix, make predictions unknown values x. Finally, illustrate provide different initial values function dealing multiple groups, also show fix parameters objective function.","code":"fun <- function(t, t1 = 45, t2 = 80, k = 0.9) { if (t < t1) { y <- 0 } else if (t >= t1 && t <= t2) { y <- k / (t2 - t1) * (t - t1) } else { y <- k } return(y) } dt <- data.frame( time = c(0, 29, 36, 42, 56, 76, 92, 100, 108), variable = c(0, 0, 0.67, 15.11, 77.38, 99.81, 99.81, 99.81, 99.81) ) plot(explorer(dt, time, variable), type = \"xy\") plot_fn(fn = \"fun\", params = c(t1 = 25, t2 = 70, k = 90)) mod_1 <- dt |> modeler( x = time, y = variable, fn = \"fun\", parameters = c(t1 = 45, t2 = 80, k = 90) ) mod_1 #> #> Call: #> variable ~ fun(x, t1, t2, k) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.00000 0.00000 0.00000 0.07444 0.00000 0.67000 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61 99.8 0.449 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.4007 secs 100% 511 (id) plot(mod_1) # Coefficients coef(mod_1) #> # A tibble: 3 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 1 t1 38.6 0.0779 496. 4.54e-15 #> 2 1 t2 61.0 0.0918 665. 7.82e-16 #> 3 1 k 99.8 0.137 730. 4.47e-16 # Variance-Covariance Matrix vcov(mod_1) #> $`1` #> t1 t2 k #> t1 6.061705e-03 -0.002940001 1.877072e-07 #> t2 -2.940001e-03 0.008431400 4.204939e-03 #> k 1.877072e-07 0.004204939 1.870426e-02 # Making predictions predict(mod_1, x = 45) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 1 45 28.5 0.223"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"providing-initial-values","dir":"Articles","previous_headings":"2. Piece-wise regression","what":"Providing Initial values","title":"How to start","text":"example, don’t grouping variable. However, default, function assigns unique identifier (uid) dataset. , need specify uid = 1 initial values fixed parameters. one group, need modify parameters argument accordingly. approach primarily illustrative purposes.","code":"init <- data.frame(uid = 1, t1 = 20, t2 = 30, k = 0.8) mod_2 <- dt |> modeler( x = time, y = variable, fn = \"fun\", parameters = init ) mod_2 #> #> Call: #> variable ~ fun(x, t1, t2, k) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.00000 0.00000 0.00000 0.07444 0.00000 0.67000 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61 99.8 0.449 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.4342 secs 100% 567 (id) coef(mod_2) #> # A tibble: 3 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 1 t1 38.6 0.0779 496. 4.54e-15 #> 2 1 t2 61.0 0.0918 665. 7.82e-16 #> 3 1 k 99.8 0.137 730. 4.47e-16"},{"path":"https://apariciojohan.github.io/flexFitR/articles/how_to_start.html","id":"fixing-parameters","dir":"Articles","previous_headings":"2. Piece-wise regression","what":"Fixing parameters","title":"How to start","text":"vignette provided basic introduction using flexFitR package, starting simple examples linear regression piecewise regression. goal demonstrate fundamental features flexibility package. However, complex situations can arise working high-throughput phenotypic (HTP) data, involve multiple groups, parameter constraints, advanced modeling scenarios. complex situations illustrated vignettes, use real HTP data showcase full capabilities flexFitR package.","code":"fix <- data.frame(uid = 1, k = 98) mod_3 <- dt |> modeler( x = time, y = variable, fn = \"fun\", parameters = c(t1 = 45, t2 = 80, k = 90), fixed_params = fix ) mod_3 #> #> Call: #> variable ~ fun(x, t1, t2, k) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.0000 0.0000 0.6700 0.8789 1.8100 1.8100 #> #> Optimization Results `head()`: #> uid t1 t2 sse k #> 1 38.6 60.6 13.6 98 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.427 secs 100% 321 (id) coef(mod_3) #> # A tibble: 2 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 1 t1 38.6 0.396 97.5 3.15e-12 #> 2 1 t2 60.6 0.429 141. 2.34e-13 plot(mod_3) rbind(metrics(mod_1), metrics(mod_2), metrics(mod_3)) #> # A tibble: 3 × 8 #> uid var SSE MAE MSE RMSE r_squared n #> #> 1 1 variable 0.449 0.0744 0.0499 0.223 1.00 9 #> 2 1 variable 0.449 0.0744 0.0499 0.223 1.00 9 #> 3 1 variable 13.6 0.879 1.51 1.23 0.999 9"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"loading-libraries","dir":"Articles","previous_headings":"","what":"Loading libraries","title":"Modelling Maturity","text":"","code":"library(flexFitR) library(dplyr) library(kableExtra) library(ggpubr) library(purrr)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"exploring-data-explorer","dir":"Articles","previous_headings":"","what":"Exploring data explorer()","title":"Modelling Maturity","text":"","code":"data(dt_potato) results <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) names(results) #> [1] \"summ_vars\" \"summ_metadata\" \"locals_min_max\" \"dt_long\" #> [5] \"metadata\""},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"data-exploration","dir":"Articles","previous_headings":"","what":"Data exploration","title":"Modelling Maturity","text":"","code":"p1 <- plot(results, type = \"evolution\", return_gg = TRUE) p2 <- plot(results, type = \"x_by_var\", return_gg = TRUE) ggarrange(p1, p2, nrow = 2)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"target-function-for-maturity","dir":"Articles","previous_headings":"","what":"Target function for maturity","title":"Modelling Maturity","text":"fn_lin_pl_lin() \\[\\begin{equation} f(t; t_1, t_2, t_3, k, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t_2 \\leq t \\leq t_3 \\\\ k + \\beta \\cdot (t - t_3) & \\text{} t > t_3 \\end{cases} \\end{equation}\\]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"fitting-models-for-maturity","dir":"Articles","previous_headings":"","what":"Fitting models for maturity","title":"Modelling Maturity","text":"","code":"mod_1 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin\", parameters = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), subset = c(195, 40), add_zero = TRUE ) plot(mod_1, id = c(195, 40)) kable(mod_1$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"fixing-parameters-from-the-canopy-model","dir":"Articles","previous_headings":"","what":"Fixing parameters from the canopy model","title":"Modelling Maturity","text":"","code":"fixed_params <- results |> pluck(\"dt_long\") |> filter(var %in% \"Canopy\" & uid %in% c(195, 40)) |> group_by(uid) |> summarise(k = max(y), .groups = \"drop\") mod_2 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), fixed_params = fixed_params, subset = c(195, 40), add_zero = TRUE, max_as_last = TRUE ) plot(mod_2, id = c(195, 40)) kable(mod_2$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"passing-initial-values","dir":"Articles","previous_headings":"","what":"Passing initial values","title":"Modelling Maturity","text":"","code":"initials <- mod_2 |> pluck(\"param\") |> select(uid, t1, t2) |> mutate(t3 = 100, k = 0.32, beta = -0.01) kable(initials) mod_3 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin\", parameters = initials, subset = c(195, 40), add_zero = TRUE ) plot(mod_3, id = c(195, 40)) kable(mod_3$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/maturity-model.html","id":"adding-constrains-to-the-optimization","dir":"Articles","previous_headings":"","what":"Adding constrains to the optimization","title":"Modelling Maturity","text":"","code":"mod_4 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin2\", parameters = c(t1 = 38.7, t2 = 62, dt = 28, k = 0.32, beta = -0.01), lower = c(-Inf, -Inf, 0, -Inf, -Inf), upper = c(Inf, Inf, Inf, Inf, 0), method = c(\"nlminb\", \"L-BFGS-B\"), subset = c(195, 40), add_zero = TRUE ) plot(mod_4, id = c(195, 40)) kable(mod_4$param)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/plotting.html","id":"example-dataset-and-loading-libraries","dir":"Articles","previous_headings":"","what":"Example dataset and loading libraries","title":"Plotting Options","text":"","code":"library(flexFitR) library(dplyr) library(ggpubr) set.seed(10) dt <- data.frame( time = c(0, 29, 36, 42, 56, 76, 92, 100, 108), variable = c(0, 0, 0.67, 15.11, 77.38, 99.81, 99.81, 99.81, 99.81) ) |> mutate(variable = variable + rnorm(n = n(), mean = 5, sd = 6))"},{"path":"https://apariciojohan.github.io/flexFitR/articles/plotting.html","id":"expectation-function-and-modeling","dir":"Articles","previous_headings":"","what":"Expectation function and modeling","title":"Plotting Options","text":"","code":"fn <- function(t, t0, t1, t2) t0 / (1 + exp((t1 - t) / t2)) mod <- dt |> modeler( x = time, y = variable, fn = \"fn\", parameters = c(t0 = 100, t1 = 50, t2 = 5) ) mod #> #> Call: #> variable ~ fn(x, t0, t1, t2) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> -6.1496 -2.9462 2.1181 0.4716 3.2479 6.7654 #> #> Optimization Results `head()`: #> uid t0 t1 t2 sse #> 1 101 49.2 4.01 169 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.3531 secs 100% 334 (id)"},{"path":"https://apariciojohan.github.io/flexFitR/articles/plotting.html","id":"plotting-predictions-and-derivatives","dir":"Articles","previous_headings":"","what":"Plotting predictions and derivatives","title":"Plotting Options","text":"","code":"a <- plot(mod, color = \"blue\", title = \"Raw data\") b <- plot(mod, type = 4, n_points = 200, color = \"black\") c <- plot(mod, type = 5, n_points = 200, color = \"black\") d <- plot(mod, type = 6, n_points = 200, color = \"black\") ggarrange(a, b, c, d)"},{"path":"https://apariciojohan.github.io/flexFitR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Johan Aparicio. Author, maintainer. Jeffrey Endelman. Author. University Wisconsin Madison. Copyright holder.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Aparicio J, Endelman J (2024). flexFitR: Flexible Non-Linear Least Square Modelling. R package version 0.1.0, https://github.com/AparicioJohan/flexFitR, https://apariciojohan.github.io/flexFitR/.","code":"@Manual{, title = {flexFitR: Flexible Non-Linear Least Square Modelling}, author = {Johan Aparicio and Jeffrey Endelman}, year = {2024}, note = {R package version 0.1.0, https://github.com/AparicioJohan/flexFitR}, url = {https://apariciojohan.github.io/flexFitR/}, }"},{"path":[]},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement johanstevenapa@gmail.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"flexfitr-","dir":"","previous_headings":"","what":"Flexible Non-Linear Least Square Modelling","title":"Flexible Non-Linear Least Square Modelling","text":"flexFitR R package designed efficient modeling analysis large complex datasets. offers powerful tools parameter estimation, model fitting, visualization, leveraging {optimx} package optimization future package parallel processing.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Flexible Non-Linear Least Square Modelling","text":"can install development version flexFitR GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"AparicioJohan/flexFitR\")"},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"Flexible Non-Linear Least Square Modelling","text":"Parameter Estimation: Utilizes {optimx} derivative-free algorithms solve estimate parameters given function. Parallelization: Implements parallel processing using future package, enabling efficient fitting hundreds curves simultaneously. Visualization Tools: Provides variety plots visualize model fits, correlations, predictions, . Statistical Rigor: Offers standard errors p-values coefficients, supporting robust conclusions interpretations. Prediction: Facilitates prediction non-observed data points. Flexibility: Allows users fix certain parameters model specify different initial values per grouping factor. Custom Modeling Functions: Equipped built-modeling functions common analysis tasks, also permitting users supply custom functions.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Flexible Non-Linear Least Square Modelling","text":"’s simple example get started flexFitR. example demonstrates fitting piecewise regression model:","code":"library(flexFitR) dt <- data.frame( time = c(0, 29, 36, 42, 56, 76, 92, 100, 108), variable = c(0, 0, 0.67, 15.11, 77.38, 99.81, 99.81, 99.81, 99.81) ) plot(explorer(dt, time, variable), type = \"xy\") fun <- function(t, t1 = 45, t2 = 80, k = 0.9) { if (t < t1) { y <- 0 } else if (t >= t1 && t <= t2) { y <- k / (t2 - t1) * (t - t1) } else { y <- k } return(y) } # Fitting piecewise regression mod_1 <- dt |> modeler( x = time, y = variable, fn = \"fun\", parameters = c(t1 = 45, t2 = 80, k = 90) ) print(mod_1) Call: variable ~ fun(x, t1, t2, k) Residuals: Min. 1st Qu. Median Mean 3rd Qu. Max. 0.00000 0.00000 0.00000 0.07444 0.00000 0.67000 Optimization Results `head()`: uid t1 t2 k sse 1 38.6 61 99.8 0.449 Metrics: Groups Timing Convergence Iterations 1 0.4068 secs 100% 511 (id) # Auto plot plot(mod_1) # Coefficients coef(mod_1) # A tibble: 3 × 6 uid coefficient solution std.error `t value` `Pr(>|t|)` 1 1 t1 38.6 0.0779 496. 4.54e-15 2 1 t2 61.0 0.0918 665. 7.82e-16 3 1 k 99.8 0.137 730. 4.47e-16 # Variance-Covariance Matrix vcov(mod_1) $`1` t1 t2 k t1 6.061705e-03 -0.002940001 1.877072e-07 t2 -2.940001e-03 0.008431400 4.204939e-03 k 1.877072e-07 0.004204939 1.870426e-02 # Making predictions predict(mod_1, x = 45) # A tibble: 1 × 4 uid x_new predicted.value std.error 1 1 45 28.5 0.223"},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"Flexible Non-Linear Least Square Modelling","text":"detailed documentation examples, visit flexFitR Vignette 1: start Vignette 2: Modeling Canopy Vignette 3: Modeling Plant Height Vignette 4: Modeling VIs","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Flexible Non-Linear Least Square Modelling","text":"Contributions flexFitR welcome! ’d like contribute, please fork repository submit pull request. significant changes, please open issue first discuss ideas.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Flexible Non-Linear Least Square Modelling","text":"Please note flexFitR project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Flexible Non-Linear Least Square Modelling","text":"flexFitR licensed MIT License. See LICENSE file details.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 flexFitR authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"Perform extra sum--squares F-test compare two nested models class modeler. test assesses whether additional parameters full model significantly improve fit compared reduced model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"","code":"# S3 method for class 'modeler' anova(reduced_model, full_model = NULL, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"reduced_model object class modeler representing reduced model fewer parameters. full_model optional object class modeler representing full model parameters. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"tibble containing columns F-statistic corresponding p-values, indicating whether full model provides significantly better fit reduced model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/anova.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extra Sum-of-Squares F-Test for modeler Objects — anova.modeler","text":"","code":"library(flexFitR) dt <- data.frame(X = 1:6, Y = c(12, 16, 44, 50, 95, 100)) mo_1 <- modeler(dt, X, Y, fn = \"fn_lin\", param = c(m = 10, b = -5)) #> Loading required package: foreach #> Loading required package: future plot(mo_1) mo_2 <- modeler(dt, X, Y, fn = \"fn_quad\", param = c(a = 1, b = 10, c = 5)) plot(mo_2) anova(mo_1, mo_2) #> # A tibble: 1 × 9 #> uid RSS_reduced RSS_full n df1 df2 F `Pr(>F)` . #> #> 1 1 449. 385. 6 1 3 0.494 0.533 ns"},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Coefficients of a Modeler Object — coef.modeler","title":"Coefficients of a Modeler Object — coef.modeler","text":"Extract estimated coefficients object class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coefficients of a Modeler Object — coef.modeler","text":"","code":"# S3 method for class 'modeler' coef(x, id = NULL, metadata = FALSE, df = FALSE, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coefficients of a Modeler Object — coef.modeler","text":"x object class modeler, typically result calling modeler() function. id optional unique identifier filter specific group. Default NULL. metadata Logical. TRUE, metadata included along coefficients. Default FALSE. df Logical. TRUE, degrees freedom fitted model returned alongside coefficients. Default FALSE. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coefficients of a Modeler Object — coef.modeler","text":"data.frame containing model's estimated coefficients, standard errors, optional metadata degrees freedom specified.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Coefficients of a Modeler Object — coef.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/coef.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coefficients of a Modeler Object — coef.modeler","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(15, 2, 45), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.002601 0.504829 1.007057 2.674719 4.010777 7.014498 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 2 35.2 60.7 100.0 7.0145 #> 15 38.5 69.4 99.8 1.0071 #> 45 38.3 64.5 100.0 0.0026 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.3482 secs 100% 414 (id) #> coef(mod_1, id = 2) #> # A tibble: 3 × 6 #> uid coefficient solution std.error `t value` `Pr(>|t|)` #> #> 1 2 t1 35.2 0.239 147. 6.57e-12 #> 2 2 t2 60.7 0.371 164. 3.53e-12 #> 3 2 k 100. 0.541 185. 1.68e-12"},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Confidence Intervals for a modeler Object — confint.modeler","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"Extract confidence intervals estimated parameters object class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"","code":"# S3 method for class 'modeler' confint(x, parm = NULL, level = 0.95, id = NULL, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"x object class modeler, typically result calling modeler() function. parm character vector specifying parameters confidence intervals calculated. NULL, confidence intervals parameters returned. Default NULL. level numeric value indicating confidence level intervals. Default 0.95, corresponding 95% confidence interval. id optional unique identifier filter specific group. Default NULL. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"tibble containing lower upper confidence limits specified parameter.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/confint.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Confidence Intervals for a modeler Object — confint.modeler","text":"","code":"library(flexFitR) data(dt_potato) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(15, 35, 45), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.002601 0.504829 1.007057 0.968957 1.452134 1.897212 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 15 38.5 69.4 99.8 1.0071 #> 35 52.2 61.4 100.0 1.8972 #> 45 38.3 64.5 100.0 0.0026 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.9365 secs 100% 410 (id) #> confint(mod_1) #> # A tibble: 9 × 6 #> uid coefficient solution std.error ci_lower ci_upper #> #> 1 15 t1 38.5 0.162 38.1 38.8 #> 2 15 t2 69.4 0.283 68.7 70.1 #> 3 15 k 99.8 0.205 99.3 100. #> 4 35 t1 52.2 2.00 47.3 57.1 #> 5 35 t2 61.4 2.87 54.4 68.5 #> 6 35 k 100. 0.281 99.3 101. #> 7 45 t1 38.3 0.00704 38.3 38.3 #> 8 45 t2 64.5 0.00972 64.4 64.5 #> 9 45 k 100. 0.0104 100. 100."},{"path":"https://apariciojohan.github.io/flexFitR/reference/dot-fitter_curve.html","id":null,"dir":"Reference","previous_headings":"","what":"General-purpose optimization — .fitter_curve","title":"General-purpose optimization — .fitter_curve","text":"function .fitter_curve used internally find parameters requested.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dot-fitter_curve.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"General-purpose optimization — .fitter_curve","text":"","code":".fitter_curve(data, id, fn, method, lower, upper, control, .keep)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/dot-fitter_curve.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"General-purpose optimization — .fitter_curve","text":"data nested data.frame columns . id optional vector IDs filter data. Default NULL, meaning ids used. fn string specifying name function used curve fitting. Default \"fn_piwise\". method character vector specifying optimization methods used. See optimx package available methods. Default c(\"subplex\", \"pracmanm\", \"anms\"). lower Numeric vector specifying lower bounds parameters. Default -Inf parameters. upper Numeric vector specifying upper bounds parameters. Default Inf parameters. control list control parameters passed optimization function. example, list(maxit = 500).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dot-fitter_curve.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"General-purpose optimization — .fitter_curve","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) mod_1 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin\", parameters = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), subset = 195, add_zero = TRUE )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_chips.html","id":null,"dir":"Reference","previous_headings":"","what":"Drone Data in Potato 2022 — dt_chips","title":"Drone Data in Potato 2022 — dt_chips","text":"Vegetative indices biomass related traits potato trial arranged p-rep design.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_chips.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drone Data in Potato 2022 — dt_chips","text":"","code":"dt_chips"},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_chips.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Drone Data in Potato 2022 — dt_chips","text":"tibble 1568 rows 17 variables: Trial chr trial name DAP dbl denoting Days planting Plot dbl denoting unique plot id Row dbl denoting row coordinate Range dbl denoting range coordinate Gen chr denoting genotype id Yield dbl Total Yield measured end season VineMaturity dbl VineMaturity measure season Red - Canopy dbl denoting drone-derived traits","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_chips.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Drone Data in Potato 2022 — dt_chips","text":"UW - Potato Breeding Program","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_potato.html","id":null,"dir":"Reference","previous_headings":"","what":"Drone Data in Potato 2020 — dt_potato","title":"Drone Data in Potato 2020 — dt_potato","text":"Vegetative indices biomass related traits potato trial arranged p-rep design.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_potato.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drone Data in Potato 2020 — dt_potato","text":"","code":"dt_potato"},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_potato.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Drone Data in Potato 2020 — dt_potato","text":"tibble 1372 rows 17 variables: Trial chr trial name DAP dbl denoting Days planting Plot dbl denoting unique plot id Row dbl denoting row coordinate Range dbl denoting range coordinate Gen chr denoting genotype id Yield dbl Total Yield measured end season VineMaturity dbl VineMaturity measure season Red - Canopy dbl denoting drone-derived traits","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/dt_potato.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Drone Data in Potato 2020 — dt_potato","text":"UW - Potato Breeding Program","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":null,"dir":"Reference","previous_headings":"","what":"Explore Data — explorer","title":"Explore Data — explorer","text":"Explores data data frame wide format.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Explore Data — explorer","text":"","code":"explorer(data, x, y, id, metadata)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Explore Data — explorer","text":"data data.frame wide format containing data. x name column `data` contains x points. y names columns `data` contain variables analyzed. id names columns `data` contains grouping variable. metadata names columns `data` keep across analysis.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Explore Data — explorer","text":"object class explorer, list containing following elements: summ_vars data.frame containing summary statistics trait x point, including minimum, mean, median, maximum, standard deviation, coefficient variation, number non-missing values, percentage missing values, percentage negative values. summ_metadata data.frame summarizing metadata. locals_min_max data.frame containing local minima maxima mean y values x. dt_long data.frame long format, columns uid, metadata, var, x, y metadata character vector names variables keep across.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Explore Data — explorer","text":"function helps explore dataset analyzed modeler().","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/explorer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Explore Data — explorer","text":"","code":"library(flexFitR) data(dt_potato) results <- dt_potato |> explorer( x = DAP, y = c(Canopy, PH), id = Plot, metadata = c(Gen, Row, Range) ) names(results) #> [1] \"summ_vars\" \"summ_metadata\" \"locals_min_max\" \"dt_long\" #> [5] \"metadata\" head(results$summ_vars) #> # A tibble: 6 × 12 #> var x Min Mean Median Max SD CV n miss `miss%` #> #> 1 Canopy 29 0 0 0 0 0 NaN 196 0 0 #> 2 Canopy 36 0 2.95 1.84 15.1 3.22 1.09 196 0 0 #> 3 Canopy 42 0.763 23.4 22.9 46.2 9.31 0.398 196 0 0 #> 4 Canopy 56 33.4 75.8 75.2 98.9 12.4 0.164 196 0 0 #> 5 Canopy 76 89.1 99.7 100 100 1.04 0.0104 196 0 0 #> 6 Canopy 92 62.5 97.0 98.4 100. 4.36 0.0449 196 0 0 #> # ℹ 1 more variable: `neg%` plot(results, label_size = 4, signif = TRUE, n_row = 2) # New data format head(results$dt_long) #> # A tibble: 6 × 7 #> uid Gen Row Range var x y #> #> 1 1 W17037-24 1 1 Canopy 29 0 #> 2 1 W17037-24 1 1 PH 29 NA #> 3 1 W17037-24 1 1 Canopy 36 0.67 #> 4 1 W17037-24 1 1 PH 36 0.0154 #> 5 1 W17037-24 1 1 Canopy 42 15.1 #> 6 1 W17037-24 1 1 PH 42 0.0173"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential Exponential Function 1 — fn_exp1_exp","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"Computes value based exponential growth curve exponential decay model time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"","code":"fn_exp1_exp(t, t1, t2, alpha, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"t Numeric. time value. t1 Numeric. lower threshold time. Assumed known. t2 Numeric. upper threshold time. alpha Numeric. parameter first exponential term. Must greater 0. beta Numeric. parameter second exponential term. Must less 0.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"numeric value based double exponential model. t less t1, function returns 0. t t1 t2 (inclusive), function returns exp(alpha * (t - t1)) - 1. t greater t2, function returns (exp(alpha * (t2 - t1)) - 1) * exp(beta * (t - t2)).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"$$ f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\left(e^{\\alpha \\cdot (t_2 - t_1)} - 1\\right) \\cdot e^{\\beta \\cdot (t - t_2)} & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_exp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential Exponential Function 1 — fn_exp1_exp","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_exp1_exp\", params = c(t1 = 35, t2 = 55, alpha = 1 / 20, beta = -1 / 30), interval = c(0, 108), n_points = 2000, auc_label_size = 3, y_auc_label = 0.2 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential Linear Function 1 — fn_exp1_lin","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"Computes value based exponential growth curve linear decay model time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"","code":"fn_exp1_lin(t, t1, t2, alpha, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"t Numeric. time value. t1 Numeric. lower threshold time. Assumed known. t2 Numeric. upper threshold time. alpha Numeric. parameter exponential term. Must greater 0. beta Numeric. parameter linear term. Must less 0.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"numeric value based exponential linear model. t less t1, function returns 0. t t1 t2 (inclusive), function returns exp(alpha * (t - t1)) - 1. t greater t2, function returns beta * (t - t2) + (exp(alpha * (t2 - t1)) - 1).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"$$ f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\beta \\cdot (t - t_2) + \\left(e^{\\alpha \\cdot (t_2 - t_1)} - 1\\right) & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp1_lin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential Linear Function 1 — fn_exp1_lin","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_exp1_lin\", params = c(t1 = 35, t2 = 55, alpha = 1 / 20, beta = -1 / 40), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential Exponential Function 2 — fn_exp2_exp","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"Computes value based exponential growth curve exponential decay model time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"","code":"fn_exp2_exp(t, t1, t2, alpha, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"t Numeric. time value. t1 Numeric. lower threshold time. Assumed known. t2 Numeric. upper threshold time. alpha Numeric. parameter first exponential term. Must greater 0. beta Numeric. parameter second exponential term. Must less 0.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"numeric value based double exponential model. t less t1, function returns 0. t t1 t2 (inclusive), function returns exp(alpha * (t - t1)^2) - 1. t greater t2, function returns (exp(alpha * (t2 - t1)^2) - 1) * exp(beta * (t - t2)).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"$$ f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)^2} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\left(e^{\\alpha \\cdot (t_2 - t_1)^2} - 1\\right) \\cdot e^{\\beta \\cdot (t - t_2)} & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_exp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential Exponential Function 2 — fn_exp2_exp","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_exp2_exp\", params = c(t1 = 35, t2 = 55, alpha = 1 / 600, beta = -1 / 30), interval = c(0, 108), n_points = 2000, auc_label_size = 3, y_auc_label = 0.15 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential Linear Function 2 — fn_exp2_lin","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"Computes value based exponential growth curve linear decay model time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"","code":"fn_exp2_lin(t, t1, t2, alpha, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"t Numeric. time value. t1 Numeric. lower threshold time. Assumed known. t2 Numeric. upper threshold time. alpha Numeric. parameter exponential term. Must greater 0. beta Numeric. parameter linear term. Must less 0.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"numeric value based exponential linear model. t less t1, function returns 0. t t1 t2 (inclusive), function returns exp(alpha * (t - t1)^2) - 1. t greater t2, function returns beta * (t - t2) + (exp(alpha * (t2 - t1)^2) - 1).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"$$ f(t; t_1, t_2, \\alpha, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ e^{\\alpha \\cdot (t - t_1)^2} - 1 & \\text{} t_1 \\leq t \\leq t_2 \\\\ \\beta \\cdot (t - t_2) + \\left(e^{\\alpha \\cdot (t_2 - t_1)^2} - 1\\right) & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_exp2_lin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential Linear Function 2 — fn_exp2_lin","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_exp2_lin\", params = c(t1 = 35, t2 = 55, alpha = 1 / 600, beta = -1 / 80), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear Function — fn_lin","title":"Linear Function — fn_lin","text":"Computes value based linear function.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear Function — fn_lin","text":"","code":"fn_lin(t, m, b)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear Function — fn_lin","text":"t Numeric value. m Numeric value slope coefficient. b Numeric value intercept coefficient.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear Function — fn_lin","text":"numeric value based linear function.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear Function — fn_lin","text":"$$ f(t; m, b) = m \\cdot t + b $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear Function — fn_lin","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_lin\", params = c(m = 2, b = 10), interval = c(0, 108), n_points = 2000 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear Plateau Linear — fn_lin_pl_lin","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"Linear Plateau Linear","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"","code":"fn_lin_pl_lin(t, t1, t2, t3, k, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"t Numeric. time value. t1 Numeric. lower threshold time. Default 45. t2 Numeric. upper threshold time plateau. Default 80. t3 Numeric. lower threshold time plateau. Default 45. k Numeric. maximum value function. Default 0.9. beta Numeric. Slope linear decay.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"numeric value based linear plateau linear model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"$$ f(t; t_1, t_2, t_3, k, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t_2 \\leq t \\leq t_3 \\\\ k + \\beta \\cdot (t - t_3) & \\text{} t > t_3 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear Plateau Linear — fn_lin_pl_lin","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_lin_pl_lin\", params = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"Linear Plateau Linear Constrains","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"","code":"fn_lin_pl_lin2(t, t1, t2, dt, k, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"t Numeric. time value. t1 Numeric. lower threshold time. t2 Numeric. upper threshold time plateau. dt Numeric. dt = t3 - t2. k Numeric. maximum value function. beta Numeric. Slope linear decay.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"numeric value based linear plateau linear model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"$$ f(t; t_1, t_2, dt, k, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t_2 \\leq t \\leq (t_2 + dt) \\\\ k + \\beta \\cdot (t - (t_2 + dt)) & \\text{} t > (t_2 + dt) \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear Plateau Linear with Constrains — fn_lin_pl_lin2","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_lin_pl_lin2\", params = c(t1 = 38.7, t2 = 62, dt = 28, k = 0.32, beta = -0.01), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":null,"dir":"Reference","previous_headings":"","what":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"Linear Plateau Linear Constrains","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"","code":"fn_lin_pl_lin3(t, t1, t2, t3, k, beta)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"t Numeric. time value. t1 Numeric. lower threshold time. Default 45. t2 Numeric. upper threshold time plateau. Default 80. t3 Numeric. lower threshold time plateau. Default 45. k Numeric. maximum value function. Default 0.9. beta Numeric. Slope linear decay.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"numeric value based linear plateau linear model.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"$$ f(t; t_1, t_2, t_3, k, \\beta) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t_2 \\leq t \\leq t_3 \\\\ k + \\beta \\cdot (t - t_3) & \\text{} t > t_3 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_lin_pl_lin3.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linear Plateau Linear Constrains — fn_lin_pl_lin3","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_lin_pl_lin3\", params = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":null,"dir":"Reference","previous_headings":"","what":"Piecewise Linear Regression — fn_piwise","title":"Piecewise Linear Regression — fn_piwise","text":"Computes value based linear growth curve reaching plateau time.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Piecewise Linear Regression — fn_piwise","text":"","code":"fn_piwise(t, t1 = 45, t2 = 80, k = 0.9)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Piecewise Linear Regression — fn_piwise","text":"t Numeric. time value. t1 Numeric. lower threshold time. Default 45. t2 Numeric. upper threshold time. Default 80. k Numeric. maximum value function. Default 0.9. Assumed known.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Piecewise Linear Regression — fn_piwise","text":"numeric value based threshold model. t less t1, function returns 0. t t1 t2 (inclusive), function returns value 0 k linear trend. t greater t2, function returns k.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Piecewise Linear Regression — fn_piwise","text":"$$ f(t; t_1, t_2, k) = \\begin{cases} 0 & \\text{} t < t_1 \\\\ \\dfrac{k}{t_2 - t_1} \\cdot (t - t_1) & \\text{} t_1 \\leq t \\leq t_2 \\\\ k & \\text{} t > t_2 \\end{cases} $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_piwise.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Piecewise Linear Regression — fn_piwise","text":"","code":"library(flexFitR) plot_fn( fn = \"fn_piwise\", params = c(t1 = 34.9, t2 = 61.8, k = 100), interval = c(0, 108), n_points = 2000, auc_label_size = 3 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":null,"dir":"Reference","previous_headings":"","what":"Quadratic Function — fn_quad","title":"Quadratic Function — fn_quad","text":"Computes value based quadratic function..","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quadratic Function — fn_quad","text":"","code":"fn_quad(t, a, b, c)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quadratic Function — fn_quad","text":"t Numeric value. Numeric value coefficient . b Numeric value coefficient b. c Numeric value coefficient c.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quadratic Function — fn_quad","text":"numeric value based linear function.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Quadratic Function — fn_quad","text":"$$ f(t; , b, c) = \\cdot t^2 + b \\cdot t + c $$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/fn_quad.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quadratic Function — fn_quad","text":"","code":"library(flexFitR) plot_fn(fn = \"fn_quad\", params = c(a = 1, b = 10, c = 5))"},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":null,"dir":"Reference","previous_headings":"","what":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"Generic function calculating Akaike's ‘Information Criterion’ fitted model object class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"","code":"# S3 method for class 'modeler' AIC(object, ..., k = 2) # S3 method for class 'modeler' BIC(object, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"object object inheriting class modeler resulting executing function modeler() ... parameters. future improvements. k Numeric, penalty per parameter used; default k = 2 classical AIC.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"tibble columns giving corresponding AIC BIC.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/goodness_of_fit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Akaike's An Information Criterion for an object of class modeler — goodness_of_fit","text":"","code":"library(flexFitR) dt <- data.frame(X = 1:6, Y = c(12, 16, 44, 50, 95, 100)) mo_1 <- modeler(dt, X, Y, fn = \"fn_lin\", param = c(m = 10, b = -5)) mo_2 <- modeler(dt, X, Y, fn = \"fn_quad\", param = c(a = 1, b = 10, c = 5)) AIC(mo_1) #> uid logLik df nobs p AIC #> 1 1 -21.45745 3 6 2 48.9149 AIC(mo_2) #> uid logLik df nobs p AIC #> 1 1 -21.00014 4 6 3 50.00028 BIC(mo_1) #> uid logLik df nobs p BIC #> 1 1 -21.45745 3 6 2 48.29017 BIC(mo_2) #> uid logLik df nobs p BIC #> 1 1 -21.00014 4 6 3 49.16732"},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"logLik object class modeler","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"","code":"# S3 method for class 'modeler' logLik(object, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"object object inheriting class modeler resulting executing function modeler() ... parameters. future improvements.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"tibble Log-Likelihood fitted models.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/logLik.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract Log-Likelihood for an object of class modeler — logLik.modeler","text":"","code":"library(flexFitR) dt <- data.frame(X = 1:6, Y = c(12, 16, 44, 50, 95, 100)) mo_1 <- modeler(dt, X, Y, fn = \"fn_lin\", param = c(m = 10, b = -5)) plot(mo_1) logLik(mo_1) #> uid logLik df nobs p #> 1 1 -21.45745 3 6 2"},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":null,"dir":"Reference","previous_headings":"","what":"Metrics for modeler — metrics","title":"Metrics for modeler — metrics","text":"Computes various performance metrics modeler object. function calculates Sum Squared Errors (SSE), Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Coefficient Determination (R-squared).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Metrics for modeler — metrics","text":"","code":"metrics(x, by_grp = TRUE)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Metrics for modeler — metrics","text":"x object class `modeler` containing necessary data compute metrics. by_grp Return metrics id? TRUE default.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Metrics for modeler — metrics","text":"data frame containing calculated metrics grouped uid, metadata, variables.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Metrics for modeler — metrics","text":"Sum Squared Errors (SSE): $$SSE = \\sum_{=1}^{n} (y_i - \\hat{y}_i)^2$$Mean Absolute Error (MAE): $$MAE = \\frac{1}{n} \\sum_{=1}^{n} |y_i - \\hat{y}_i|$$Mean Squared Error (MSE): $$MSE = \\frac{1}{n} \\sum_{=1}^{n} (y_i - \\hat{y}_i)^2$$Root Mean Squared Error (RMSE): $$RMSE = \\sqrt{\\frac{1}{n} \\sum_{=1}^{n} (y_i - \\hat{y}_i)^2}$$Coefficient Determination (R-squared): $$R^2 = 1 - \\frac{\\sum_{=1}^{n} (y_i - \\hat{y}_i)^2}{\\sum_{=1}^{n} (y_i - \\bar{y})^2}$$","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/metrics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Metrics for modeler — metrics","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, PH), id = Plot) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(1:2), add_zero = TRUE, max_as_last = TRUE ) plot(mod_1, id = c(1:2)) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.4489 2.0903 3.7317 3.7317 5.3731 7.0145 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61.0 99.8 0.449 #> 2 35.2 60.7 100.0 7.014 #> #> Metrics: #> Groups Timing Convergence Iterations #> 2 0.951 secs 100% 469 (id) #> metrics(mod_1) #> # A tibble: 2 × 8 #> uid var SSE MAE MSE RMSE r_squared n #> #> 1 1 Canopy 0.449 0.0744 0.0499 0.223 1.00 9 #> 2 2 Canopy 7.01 0.468 0.779 0.883 1.00 9"},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Modeler — modeler","title":"Modeler — modeler","text":"General-purpose optimization techniques non-linear least squares problems.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Modeler — modeler","text":"","code":"modeler( data, x, y, grp, keep, fn = \"fn_piwise\", parameters = NULL, lower = -Inf, upper = Inf, fixed_params = NULL, method = c(\"subplex\", \"pracmanm\", \"anms\"), return_method = FALSE, subset = NULL, add_zero = FALSE, check_negative = FALSE, max_as_last = FALSE, progress = FALSE, parallel = FALSE, workers = max(1, parallel::detectCores(), na.rm = TRUE), control = list() )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Modeler — modeler","text":"data data.frame wide format. x name column `data` contains x points. y name column `data` contain variable analyzed. Must match var data. grp names columns `data` contains grouping variable. (Optional). keep names columns `data` keep across analysis. fn string specifying name function used curve fitting. Default \"fn_piwise\". parameters Can named numeric vector specifying initial values parameters optimized, data frame columns uid, initial parameter values group id. Used providing specific initial values per group id. Default NULL. lower Numeric vector specifying lower bounds parameters. Default -Inf parameters. upper Numeric vector specifying upper bounds parameters. Default Inf parameters. fixed_params data frame columns uid, fixed parameter values group id. Used fixing certain parameters optimization. method character vector specifying optimization methods used. Check `optimx::checkallsolvers()` available methods. Default c(\"subplex\", \"pracmanm\", \"anms\"). return_method Logical. TRUE, includes optimization method used result. Default FALSE. subset optional vector levels `grp` filter data. Default NULL, meaning groups used. add_zero Logical. TRUE, adds zero value series start. Default FALSE. check_negative Logical. TRUE, converts negative values data zero. Default FALSE. max_as_last Logical. TRUE, appends maximum value reaching maximum. Default FALSE. progress Logical. TRUE progress bar displayed. Default FALSE. Try running function: progressr::handlers(\"progress\", \"beepr\"). parallel Logical. TRUE model fit performed parallel. Default FALSE. workers number parallel processes use. `parallel::detectCores()` control list control parameters passed optimization function. example: list(maxit = 500).","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Modeler — modeler","text":"object class modeler, list containing following elements: param data frame containing optimized parameters related information. dt data frame data used fitted values. fn call used fitting models. metrics Metrics summary models. execution Execution time. response Response variable. keep Metadata keep across. fun Name function. parallel List returning parallel workers. fit List fitted models.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Modeler — modeler","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) # Example 1 mod_1 <- dt_potato |> modeler( x = DAP, y = GLI_2, grp = Plot, fn = \"fn_lin_pl_lin\", parameters = c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), subset = 195, add_zero = TRUE ) plot(mod_1, id = 195) print(mod_1) #> #> Call: #> GLI_2 ~ fn_lin_pl_lin(x, t1, t2, t3, k, beta) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> -0.011076 -0.002262 0.000000 -0.001676 0.000000 0.002262 #> #> Optimization Results `head()`: #> uid t1 t2 t3 k beta sse #> 195 39.6 68.3 93.3 0.323 -0.01 0.000149 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.8988 secs 100% 901 (id) #> # Example 2 mod_2 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = 195, add_zero = TRUE, max_as_last = TRUE ) plot(mod_2, id = 195) print(mod_2) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Residuals: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> -1.340e-09 0.000e+00 0.000e+00 -9.481e-11 1.391e-10 1.391e-10 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 195 38.7 62 100 1.88e-18 #> #> Metrics: #> Groups Timing Convergence Iterations #> 1 0.5793 secs 100% 349 (id) #>"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot an object of class explorer — plot.explorer","title":"Plot an object of class explorer — plot.explorer","text":"Creates various plots object class explorer. Depending specified type, function can generate plots show correlations variables x, correlations x values variable, evolution variables x.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot an object of class explorer — plot.explorer","text":"","code":"# S3 method for class 'explorer' plot( x, type = \"var_by_x\", label_size = 4, signif = FALSE, method = \"pearson\", filter_var = NULL, id = NULL, n_row = NULL, n_col = NULL, base_size = 13, return_gg = FALSE, add_avg = FALSE, ... )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot an object of class explorer — plot.explorer","text":"x object inheriting class explorer, resulting executing function explorer(). type Character string number specifying type plot generate. Available options : \"var_by_x\" 1 Plots correlations variables x (default). \"x_by_var\" 2 Plots correlations x points variable (y). \"evolution\" 3 Plot evolution variables (y) x. \"xy\" 4 Scatterplot (x, y) label_size Numeric. Size labels plot. Default 4. works type 1 2. signif Logical. TRUE, adds p-values correlation plot labels. Default FALSE. works type 1 2. method Character string specifying method correlation calculation. Available options \"pearson\" (default), \"spearman\", \"kendall\". works type 1 2. filter_var Character vector specifying variables exclude plot. id Optional unique identifier filter evolution type plot. Default NULL. works type 3. n_row Integer specifying number rows use facet_wrap(). Default NULL. works type 1 2. n_col Integer specifying number columns use facet_wrap(). Default NULL. works type 1 2. base_size Numeric. Base font size plot. Default 13. return_gg Logical. TRUE, returns ggplot object instead printing . Default FALSE. add_avg Logical. TRUE, returns evolution plot average trend across groups. Default FALSE. ... graphical parameters future improvements.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot an object of class explorer — plot.explorer","text":"ggplot object invisible data.frame containing correlation table type \"var_by_x\" \"x_by_var\".","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.explorer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot an object of class explorer — plot.explorer","text":"","code":"library(flexFitR) data(dt_potato) dt_potato <- dt_potato results <- explorer(dt_potato, x = DAP, y = c(Canopy, PH), id = Plot) table <- plot(results, label_size = 4, signif = TRUE, n_row = 2) table #> # A tibble: 7 × 7 #> x col row corr p.value n signi #> #> 1 36 Canopy PH 0.46 8.23e-11 176 *** #> 2 42 Canopy PH 0.67 8.55e-27 196 *** #> 3 56 Canopy PH -0.21 3.65e- 3 196 ** #> 4 76 Canopy PH 0.3 1.41e- 5 196 *** #> 5 92 Canopy PH 0.28 5.96e- 5 196 *** #> 6 100 Canopy PH 0.32 6.45e- 6 196 *** #> 7 108 Canopy PH 0.07 3.14e- 1 196 ns plot(results, type = \"x_by_var\", label_size = 4, signif = TRUE)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot an object of class modeler — plot.modeler","title":"Plot an object of class modeler — plot.modeler","text":"Create several plots object class modeler","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot an object of class modeler — plot.modeler","text":"","code":"# S3 method for class 'modeler' plot( x, id = NULL, type = 1, label_size = 4, base_size = 14, color = \"red\", parm = NULL, n_points = 2000, title = NULL, add_ci = TRUE, add_ribbon = FALSE, color_ribbon = \"blue\", ... )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot an object of class modeler — plot.modeler","text":"x object class modeler, typically result calling modeler(). id optional group ID filter data plotting, useful avoiding overcrowded plots. type Numeric value (1-6) specify type plot generate. Default 1. type = 1 Plot raw data fitted curves. type = 2 Plot coefficients confidence intervals. type = 3 Plot fitted curves, colored group. type = 4 Plot fitted curves confidence intervals. type = 5 Plot first derivative confidence intervals. type = 6 Plot second derivative confidence intervals. label_size Numeric value size labels. Default 4. base_size Numeric value base font size pts. Default 14. color Character string specifying color fitted line type = 1. Default \"red\". parm Character vector specifying parameters plot type = 2. NULL, parameters included. n_points Numeric value specifying number points interpolation along x-axis. Default 2000. title Optional character string add title plot. add_ci Logical value indicating whether add confidence intervals type = 4, 5, 6. Default TRUE. add_ribbon Logical value indicating whether add ribbon confidence intervals type = 4, 5, 6. Default FALSE. color_ribbon Character string specifying color ribbon. Default \"blue\". ... Additional graphical parameters future extensions.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot an object of class modeler — plot.modeler","text":"ggplot object representing specified plot.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot an object of class modeler — plot.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot an object of class modeler — plot.modeler","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, GLI_2), id = Plot) # Example 1 mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(1:3), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.4489 2.3551 4.2612 3.9082 5.6379 7.0145 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61.0 99.8 0.449 #> 2 35.2 60.7 100.0 7.014 #> 3 33.8 59.9 100.0 4.261 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.4357 secs 100% 499.67 (id) #> plot(mod_1, id = 1:2) plot(mod_1, id = 1:3, type = 2, label_size = 10)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Function — plot_fn","title":"Plot Function — plot_fn","text":"function plots user-defined function specified interval annotates plot calculated Area Curve (AUC) parameter values. aim `plot_fn` allow users play different Starting Values functions fitting models.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Function — plot_fn","text":"","code":"plot_fn( fn = \"fn_piwise\", params = c(t1 = 34.9, t2 = 61.8, k = 100), interval = c(0, 100), n_points = 1000, auc = FALSE, x_auc_label = NULL, y_auc_label = NULL, auc_label_size = 4, param_label_size = 4, base_size = 12, color = \"red\", label_color = \"grey30\" )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Function — plot_fn","text":"fn character string representing name function plotted. Default \"fn_piwise\". params named numeric vector parameters passed function. Default c(t1 = 34.9, t2 = 61.8, k = 100). interval numeric vector length 2 specifying interval function plotted. Default c(0, 100). n_points integer specifying number points used plotting. Default 1000. auc Print AUC plot? Default FALSE. x_auc_label numeric value specifying x-coordinate AUC label. Default NULL. y_auc_label numeric value specifying y-coordinate AUC label. Default NULL. auc_label_size numeric value specifying size AUC label text. Default 3. param_label_size numeric value specifying size parameter label text. Default 3. base_size numeric value specifying base size plot's theme. Default 12. color character string specifying color plot lines area fill. Default \"red\". label_color character string specifying color labels. Default \"grey30\".","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Function — plot_fn","text":"ggplot object representing plot.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/plot_fn.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Function — plot_fn","text":"","code":"# Example usage plot_fn( fn = \"fn_piwise\", params = c(t1 = 34.9, t2 = 61.8, k = 100), interval = c(0, 100), n_points = 1000 ) plot_fn( fn = \"fn_lin_pl_lin\", params <- c(t1 = 38.7, t2 = 62, t3 = 90, k = 0.32, beta = -0.01), interval = c(0, 100), n_points = 1000, base_size = 12 )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Predict an object of class modeler — predict.modeler","title":"Predict an object of class modeler — predict.modeler","text":"Generate model predictions object class modeler. function allows flexible prediction types, including point predictions, area curve (AUC), first second order derivatives.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Predict an object of class modeler — predict.modeler","text":"","code":"# S3 method for class 'modeler' predict( object, x = NULL, id = NULL, type = c(\"point\", \"auc\", \"fd\", \"sd\"), se_interval = c(\"confidence\", \"prediction\"), n_points = 1000, metadata = FALSE, ... )"},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Predict an object of class modeler — predict.modeler","text":"object object class modeler, typically result calling modeler() function. x numeric value vector specifying points predictions made. type = \"auc\", x must vector length 2 specifies interval calculate AUC. id Optional unique identifier filter predictions specific group. Default NULL. type character string specifying type prediction. Default \"point\". \"point\" Predicts value y given x. \"auc\" Calculates area curve (AUC) fitted model interval specified x. \"fd\" Returns first derivative (rate change) model given x value(s). \"sd\" Returns second derivative model given x value(s). se_interval character string specifying type interval standard error calculation. Options \"confidence\" (default) \"prediction\". n_points integer specifying number points used approximate area curve (AUC) type = \"auc\". Default 1000. metadata Logical. TRUE, metadata included predictions. Default FALSE. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Predict an object of class modeler — predict.modeler","text":"data.frame containing predicted values, associated standard errors, optionally metadata.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Predict an object of class modeler — predict.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/predict.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Predict an object of class modeler — predict.modeler","text":"","code":"library(flexFitR) data(dt_potato) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(15, 2, 45), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.002601 0.504829 1.007057 2.674719 4.010777 7.014498 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 2 35.2 60.7 100.0 7.0145 #> 15 38.5 69.4 99.8 1.0071 #> 45 38.3 64.5 100.0 0.0026 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.3572 secs 100% 414 (id) #> # Point Prediction predict(mod_1, x = 45, type = \"point\", id = 2) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 2 45 38.4 0.622 # AUC Prediction predict(mod_1, x = c(0, 108), type = \"auc\", id = 2) #> # A tibble: 1 × 5 #> uid x_min x_max predicted.value std.error #> #> 1 2 0 108 6004. 30.8 # First Derivative predict(mod_1, x = 45, type = \"fd\", id = 2) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 2 45 3.91 0.0741 # Second Derivative predict(mod_1, x = 45, type = \"sd\", id = 2) #> # A tibble: 1 × 4 #> uid x_new predicted.value std.error #> #> 1 2 45 -0.0000000298 0.0000274"},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Print an object of class modeler — print.modeler","title":"Print an object of class modeler — print.modeler","text":"Prints information modeler function.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print an object of class modeler — print.modeler","text":"","code":"# S3 method for class 'modeler' print(x, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print an object of class modeler — print.modeler","text":"x object fitted function modeler(). ... Options used tibble package format output. See `tibble::print()` details.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print an object of class modeler — print.modeler","text":"object inheriting class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Print an object of class modeler — print.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/print.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print an object of class modeler — print.modeler","text":"","code":"library(flexFitR) data(dt_potato) explorer <- explorer(dt_potato, x = DAP, y = c(Canopy, PH), id = Plot) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(1:5), add_zero = TRUE, max_as_last = TRUE ) plot(mod_1, id = c(1:5)) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.000000 0.000049 0.448900 2.344930 4.261203 7.014498 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 1 38.6 61.0 99.8 4.49e-01 #> 2 35.2 60.7 100.0 7.01e+00 #> 3 33.8 59.9 100.0 4.26e+00 #> 4 39.3 65.5 99.8 4.60e-18 #> #> Metrics: #> Groups Timing Convergence Iterations #> 5 2.3763 secs 100% 435.2 (id) #>"},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":null,"dir":"Reference","previous_headings":"","what":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"Extract variance-covariance matrix parameter estimates object class modeler.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"","code":"# S3 method for class 'modeler' vcov(x, id = NULL, ...)"},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"x object class modeler, typically result calling modeler() function. id optional unique identifier filter specific group. Default NULL. ... Additional parameters future functionality.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"list matrices, matrix represents variance-covariance matrix estimated parameters group fit.","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"Johan Aparicio [aut]","code":""},{"path":"https://apariciojohan.github.io/flexFitR/reference/vcov.modeler.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Variance-Covariance matrix for an object of class modeler — vcov.modeler","text":"","code":"library(flexFitR) data(dt_potato) mod_1 <- dt_potato |> modeler( x = DAP, y = Canopy, grp = Plot, fn = \"fn_piwise\", parameters = c(t1 = 45, t2 = 80, k = 0.9), subset = c(15, 2, 45), add_zero = TRUE, max_as_last = TRUE ) print(mod_1) #> #> Call: #> Canopy ~ fn_piwise(x, t1, t2, k) #> #> Sum of Squares Error: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.002601 0.504829 1.007057 2.674719 4.010777 7.014498 #> #> Optimization Results `head()`: #> uid t1 t2 k sse #> 2 35.2 60.7 100.0 7.0145 #> 15 38.5 69.4 99.8 1.0071 #> 45 38.3 64.5 100.0 0.0026 #> #> Metrics: #> Groups Timing Convergence Iterations #> 3 1.3307 secs 100% 414 (id) #> vcov(mod_1) #> $`2` #> t1 t2 k #> t1 5.694008e-02 -0.02923676 3.683474e-06 #> t2 -2.923676e-02 0.13796365 7.471629e-02 #> k 3.683474e-06 0.07471629 2.922726e-01 #> #> $`15` #> t1 t2 k #> t1 2.636323e-02 -0.02728600 1.691502e-07 #> t2 -2.728600e-02 0.08035361 1.300394e-02 #> k 1.691502e-07 0.01300394 4.196055e-02 #> #> $`45` #> t1 t2 k #> t1 4.956862e-05 -3.526927e-05 4.195078e-11 #> t2 -3.526927e-05 9.453221e-05 2.835289e-05 #> k 4.195078e-11 2.835289e-05 1.083750e-04 #>"},{"path":"https://apariciojohan.github.io/flexFitR/news/index.html","id":"flexfitr-010","dir":"Changelog","previous_headings":"","what":"flexFitR 0.1.0","title":"flexFitR 0.1.0","text":"Initial CRAN submission.","code":""}]