2 years ago

#13983

test-img

Barbab

How to calculate by hand standard errors and t statistics of minpack.lm::nlsLM?

Let's consider this code as an example:

a = 10
b = 2
c = 1.05
set.seed(123,kind="Mersenne-Twister",normal.kind="Inversion")
x = runif(100)
data = data.frame(X = x, Y = a + b/c * (((1-x)^-c)-1))
fit_sp <- minpack.lm::nlsLM( formula = Y ~ a + b/c * (((1-X)^-c)-1),
                             data = data, start = c(a = 0, b = 0.1, c = 0.01),
                             control = nls.control(maxiter = 1000),
                             lower = c(0.0001,0.0001,0.0001))
fit_sp

Nonlinear regression model
  model: Y ~ a + b/c * (((1 - X)^-c) - 1)
   data: data
    a     b     c 
10.00  2.00  1.05 
 residual sum-of-squares: 1.507e-26

Number of iterations to convergence: 13 
Achieved convergence tolerance: 1.49e-08

summary(fit_sp)

Formula: Y ~ a + b/c * (((1 - X)^-c) - 1)

Parameters:
   Estimate Std. Error   t value Pr(>|t|)    
a 1.000e+01  1.516e-15 6.598e+15   <2e-16 ***
b 2.000e+00  4.372e-16 4.574e+15   <2e-16 ***
c 1.050e+00  5.319e-17 1.974e+16   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.246e-14 on 97 degrees of freedom

Number of iterations to convergence: 13 
Achieved convergence tolerance: 1.49e-08

I know that non linear least squares calculates the coefficients that minimize the sum of squared residuals. But how is it possible to obtain by hand the standard errors and the t-statistics for the parameters estimate?

r

statistics

nls

standard-error

0 Answers

Your Answer

Accepted video resources