knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This vignette attempts to give a documentation on how to use the package nlsCompare to compare the best parameter values and sum-of-squares involved in solving non-linear least squares (nls) problems with R's existing and new packages' nls functions viz. nls
(base), nlsLM
(minpack.lm), nlxb
(nlsr) and nlsj
(nlsj). The last one is a new package developed during the Google Summer of Code (GSoC), 2021 program.
The GSoC project titled Improvements to nls(). The project student was the author, mentored by Dr. John C. Nash (retired professor, Telfer School of Management, University of Ottawa) and Dr. Heather Turner (Department of Statistics, University of Warwick). nlsCompare is a product of the above project.
As of this writing, only a development version of the package is available on GitHub. The package can be downloaded from GitHub using devtoools
:
# install.packages(devtools) ## uncomment if devtools package is not installed devtools::install_github("ArkaB-DS/nlsCompare")
The following R
code gives a template on how to use the package for testing:
library(nlsCompare) ## load the library machid <- machineId() ## get your machine summary as a string ## uncomment when running this r script # setup_dir() ## setup working directory to store the outputs st <- create_db() ## create dataframe to save the database of problems sr <- create_elog() ## create dataframe to save the error log while solving the problems csv_exists(st, sr) ## see if nlsDatabase.csv and nlsErrorLog.csv already exists in the directory logs <- run(machid, st, sr) ## run the tests write_csvs(logs$database, logs$errorlog) ## write final outputs in the csv files created rm_nls() ## delete objects created by the above functions
Examples of the output csv files - nlsDatabase.csv and nlsErrorLog.csv - are present in https://github.com/ArkaB-DS/nlsCompare/blob/master/vignettes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.