Skip to contents

par_est_FOMT estimates the starting values of the parameters of the first-order multi-target model from a data-set.

Usage

par_est_FOMT(x, y = NULL)

Arguments

x

A data-frame with time and concentration in the first and second columns,respectively. Alternatively, it could be an array of time and y an array of concentrations.

y

Optional, an array of concentrations. To be inserted only if x is an array.

Value

The function returns an array with the suggested initial values of parameters.

See also

Examples

t <- seq(0, 30, by = 6)
k <- 0.3
n <- 40
set.seed(100)
y <- FOMTm(t, k, n) * (1 + rnorm(length(t), 0, 0.05))

nlsFOMT <- nls(y ~ FOMTm(t, k, n),
  data = list(y = y, t = t),
  start = par_est_FOMT(t, y)
)
summary(nlsFOMT)
#> 
#> Formula: y ~ FOMTm(t, k, n)
#> 
#> Parameters:
#>   Estimate Std. Error t value Pr(>|t|)    
#> k  0.29233    0.01432  20.416  3.4e-05 ***
#> n 36.21827    6.92417   5.231  0.00638 ** 
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> Residual standard error: 0.01309 on 4 degrees of freedom
#> 
#> Number of iterations to convergence: 3 
#> Achieved convergence tolerance: 4.983e-06
#>