View source: R/calculate_fit.R
calculate_fit | R Documentation |
This is an internal function of the remulator package. It fits a curve to given data. For each region and year it minimizes the function sum((y - (a + b * x ^d))^2
x and y are the data provided by the user, and a, b, and d are the coefficients to be found. So, the fit is y = a+b*x^d
.
calculate_fit(data, initial_values = c(1, 1, 1), form, ...)
data |
MAgPIE object with data to fit. |
initial_values |
Initial values for the parameters to be optimized over. |
form |
Fit function for which least squares will be calaculated using the |
... |
Arguments passed on to the |
MAgPIE object with fit coefficients a, b, and d
David Klein
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.