Description Format Details Source Examples
The Eckerle4
data frame has 35 rows and 2 columns giving
transmittance as a function of wavelength.
This data frame contains the following columns:
A numeric vector of transmittance values.
A numeric vector of wavelengths.
These data are the result of a NIST study involving circular interference transmittance. The response variable is transmittance, and the predictor variable is wavelength.
Eckerle, K., NIST (197?). Circular Interference Transmittance Study.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | Try <- function(expr) if (!inherits(val <- try(expr), "try-error")) val
plot(y ~ x, data = Eckerle4)
## should fail - ridiculous starting value for b3
Try(fm1 <- nls(y ~ (b1/b2) * exp(-0.5*((x-b3)/b2)**2), Eckerle4,
trace = TRUE,
start = c(b1 = 1, b2 = 10, b3 = 500)))
Try(fm1a <- nls(y ~ (b1/b2) * exp(-0.5*((x-b3)/b2)**2), Eckerle4,
trace = TRUE, alg = "port",
start = c(b1 = 1, b2 = 10, b3 = 500)))
Try(fm2 <- nls(y ~ (b1/b2) * exp(-0.5*((x-b3)/b2)**2),
Eckerle4, trace = TRUE,
start = c(b1 = 1.5, b2 = 5, b3 = 450)))
Try(fm2a <- nls(y ~ (b1/b2) * exp(-0.5*((x-b3)/b2)**2),
Eckerle4, trace = TRUE, alg = "port",
start = c(b1 = 1.5, b2 = 5, b3 = 450)))
## should fail - ridiculous starting value for b3
Try(fm3 <- nls(y ~ (1/b2) * exp(-0.5*((x-b3)/b2)**2),
Eckerle4, trace = TRUE,
start = c(b2 = 10, b3 = 500), algorithm = "plinear"))
Try(fm4 <- nls(y ~ (1/b2) * exp(-0.5*((x-b3)/b2)**2), Eckerle4, trace = TRUE,
start = c(b2 = 5, b3 = 450), algorithm = "plinear"))
|
0.7223027 : 1 10 500
0.6999249 : 0.1164977 11.0440477 501.1919978
0.6948258 : 0.4043154 42.0375222 542.3624023
0.6935116 : 165.3319 7018.9224 17639.7963
Error in nls(y ~ (b1/b2) * exp(-0.5 * ((x - b3)/b2)^2), Eckerle4, trace = TRUE, :
singular gradient
0: 0.36115133: 1.00000 10.0000 500.000
1: 0.34996243: 0.116498 11.0440 501.192
2: 0.34741292: 0.404315 42.0375 542.362
3: 0.29959768: 4.02960 179.578 421.407
4: 0.24739017: 12.0880 160.021 435.036
5: 0.24689459: 7.53998 97.9094 499.076
6: 0.24313543: 7.64688 92.2972 478.023
7: 0.24140992: 6.99697 83.0422 467.618
8: 0.23611339: 5.68742 63.2372 457.585
9: 0.12266011: 1.70829 10.8485 449.406
10: 0.084419610: 1.71448 8.87144 451.281
11: 0.0015330945: 1.60921 4.00755 451.545
12: 0.00073236009: 1.55375 4.08248 451.545
13: 0.00073179610: 1.55432 4.08852 451.541
14: 0.00073179437: 1.55438 4.08883 451.541
15: 0.00073179437: 1.55438 4.08883 451.541
Nonlinear regression model
model: y ~ (b1/b2) * exp(-0.5 * ((x - b3)/b2)^2)
data: Eckerle4
b1 b2 b3
1.554 4.089 451.541
residual sum-of-squares: 0.001464
Algorithm "port", convergence message: X-convergence (3)
0.05668291 : 1.5 5.0 450.0
0.00722609 : 1.563149 4.374689 451.974368
0.001525831 : 1.551040 4.091636 451.488425
0.001463731 : 1.554819 4.091467 451.541251
0.001463589 : 1.554395 4.088899 451.541108
0.001463589 : 1.554384 4.088839 451.541216
0.001463589 : 1.554383 4.088832 451.541218
Nonlinear regression model
model: y ~ (b1/b2) * exp(-0.5 * ((x - b3)/b2)^2)
data: Eckerle4
b1 b2 b3
1.554 4.089 451.541
residual sum-of-squares: 0.001464
Number of iterations to convergence: 6
Achieved convergence tolerance: 1.39e-06
0: 0.028341454: 1.50000 5.00000 450.000
1: 0.0036130449: 1.56315 4.37469 451.974
2: 0.00076291557: 1.55104 4.09164 451.488
3: 0.00073186561: 1.55482 4.09147 451.541
4: 0.00073179454: 1.55440 4.08890 451.541
5: 0.00073179437: 1.55438 4.08884 451.541
6: 0.00073179437: 1.55438 4.08883 451.541
Nonlinear regression model
model: y ~ (b1/b2) * exp(-0.5 * ((x - b3)/b2)^2)
data: Eckerle4
b1 b2 b3
1.554 4.089 451.541
residual sum-of-squares: 0.001464
Algorithm "port", convergence message: X-convergence (3)
0.6996961 : 1.000000e+01 5.000000e+02 2.599947e-03
0.699693 : 13.12231111 503.56476809 0.01632532
0.6996754 : 15.27996998 506.99922176 0.05166793
0.6995764 : 18.1827590 512.4698443 0.1679627
0.6990543 : 22.7767103 522.8167482 0.6327205
0.6963754 : 31.677045 547.551144 3.657081
0.6809651 : 56.14726 636.40852 87.57622
0.5864412 : 187.1014 1319.3595 374236.3999
0.5102738 : -1.627890e+03 -1.597383e+04 -1.485301e+24
0.4985389 : 2.539069e+06 5.125588e+07 5.923357e+93
Error in nls(y ~ (1/b2) * exp(-0.5 * ((x - b3)/b2)^2), Eckerle4, trace = TRUE, :
singular gradient
0.05086068 : 5.00000 450.00000 1.65696
0.004539377 : 4.471095 451.669974 1.621837
0.001478679 : 4.085508 451.514686 1.553734
0.001463615 : 4.089948 451.541333 1.554595
0.001463589 : 4.088856 451.541172 1.554387
0.001463589 : 4.088835 451.541217 1.554383
0.001463589 : 4.088832 451.541218 1.554383
Nonlinear regression model
model: y ~ (1/b2) * exp(-0.5 * ((x - b3)/b2)^2)
data: Eckerle4
b2 b3 .lin
4.089 451.541 1.554
residual sum-of-squares: 0.001464
Number of iterations to convergence: 6
Achieved convergence tolerance: 1.28e-06
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.