Description Usage Arguments Details Examples
Fits a piecewise nonlinear curve with one breakpoint There is one breakpoint, it is estimated using strucchange::breakpoints
1 | fit_nlsb(WSEw, h = 10, maxiter = 100)
|
WSEw |
WSEw data (at a given level of exposure) |
h |
minimum distance from either of the WSE-w curve where the breakpoint is constrained to be |
See attributes(fit)$ef for error flags. Value 0 means no error, 1 means not enough data points, 2 means singular gradient at initial guess for nlsLM 9999 means utter failure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | rWSEw <- readRDS("./Outputs/p4_newfits/rWSEw.rds")
r <- 5
WSEw <- observe(rWSEw[[r]], exposure = 0.4)
plot(WSE~w, WSEw)
nn <- length(WSEw$w)
fits <- fit_nlsb(WSEw)
sb.ind <- attributes(fits)$sb.ind
lines(WSEw$w[1:sb.ind], predict(fits[[1]]))
lines(WSEw$w[sb.ind:nn], predict(fits[[2]]))
Find an error case and see if it is handled better now
Did not manage to actually find such an error case
z0.error <- readRDS("./Outputs/p4_newfits/z0_error.rds")
z0.error.nlsb <- z0.error$nlsb
r <- 4
k <- 9
z0.error.nlsb[r,k,]
m <- 12
fit1 <- fit_nlsb(WSEw_obs[[k]][[m]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.