knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
spfit (Single Parameter Fit) is an R implementation of Laurent Boué's Real numbers, data science and chaos: How to fit any dataset with a single parameter. It can take any data and fit a continuous and differenciable model with just one parameter with arbitrary accuracy:
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("eliocamp/spfit")
Fit the rise of CO2 perfectly with one parameter
library(spfit) data("co2") co2 <- c(co2) co2_fit <- sp_fit(co2) co2_pred <- predict(co2_fit) plot(co2, type = "l") points(predict(co2_fit), col = "red")
What's our alpha parameter?
as.character(co2_fit, digits = 30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.