Fit learning curve for accuracy matrix

learningCurve(
  accMat,
  n,
  auto_initial = TRUE,
  a = NULL,
  b = NULL,
  c = NULL,
  d_list = NULL,
  fitmodel = c("nls", "nls_mix", "gam"),
  plot = TRUE,
  verbose = TRUE
)

Arguments

accMat

Matrix of accuracy rate where column indicate different sample size

n

Vector indicates the sample size

auto_initial

whether automatical intialise

a

input the parameter a starting point

b

input the parameter a starting point

c

input the parameter a starting point

d_list

range of d

fitmodel

"nls", "nls_mix", "gam"

plot

indicates whether plot or not

verbose

indicates whether verbose or not

Value

list of results

Examples

set.seed(2019) n <- seq(20, 10000, 100) accMat <- do.call(cbind, lapply(1:length(n), function(i){ tmp_n <- rep(n[i], 50) y <- -2/(tmp_n^0.8) + 0.95 + rnorm(length(tmp_n), 0, 0.02) })) res <- learningCurve(accMat = accMat, n)
#> #> Formula: acc ~ I(1/n^(c) * a) + b #> #> Parameters: #> Estimate Std. Error t value Pr(>|t|) #> a.(Intercept) -1.8730006 0.1480680 -12.65 <2e-16 *** #> c.log(max(acc) + 0.001 - acc) 0.7759121 0.0248888 31.18 <2e-16 *** #> b 0.9496806 0.0005534 1716.21 <2e-16 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Residual standard error: 0.003151 on 97 degrees of freedom #> #> Number of iterations to convergence: 6 #> Achieved convergence tolerance: 1.49e-08 #> #> #> Formula: acc ~ I(1/n^(c) * a) + b #> #> Parameters: #> Estimate Std. Error t value Pr(>|t|) #> a.(Intercept) -1.9661577 0.1927579 -10.20 <2e-16 *** #> c.log(max(acc) + 0.001 - acc) 0.7936628 0.0309733 25.62 <2e-16 *** #> b 0.9360079 0.0006414 1459.30 <2e-16 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Residual standard error: 0.003764 on 97 degrees of freedom #> #> Number of iterations to convergence: 11 #> Achieved convergence tolerance: 1.49e-08 #> #> #> Formula: acc ~ I(1/n^(c) * a) + b #> #> Parameters: #> Estimate Std. Error t value Pr(>|t|) #> a.(Intercept) -1.8151635 0.1898262 -9.562 1.18e-15 *** #> c.log(max(acc) + 0.001 - acc) 0.7702072 0.0328869 23.420 < 2e-16 *** #> b 0.9624993 0.0007365 1306.788 < 2e-16 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Residual standard error: 0.004153 on 97 degrees of freedom #> #> Number of iterations to convergence: 5 #> Achieved convergence tolerance: 1.49e-08 #>
N <- getN(res, acc = 0.9)