emulator | R Documentation |
This function fits a function of the form y = a + b * x ^ d
for the given data.
emulator(
data,
name_x,
name_y,
name_modelstat = NULL,
treat_as_feasible = c(2, 7),
userfun = function(param, x) return(param[[1]] + param[[2]] * x^param[[3]]),
initial_values = c(0, 0, 1),
outlier_range = 1.5,
n_suff = 1,
fill = FALSE,
output_path = "emulator",
fitname = "linear",
create_pdf = TRUE,
...
)
data |
MAgPIE object containing at least two variables and the modelstatus |
name_x |
Name of the variable in |
name_y |
Name of the variable in |
name_modelstat |
Name of the variable that contains the modelstatus |
treat_as_feasible |
GAMS model status codes that will be regarded feasible. See https://www.gams.com/24.8/docs/userguides/mccarl/modelstat_tmodstat.htm |
userfun |
Function to fit. User can provide a functional form using the following
syntax: |
initial_values |
Vector with initial values of the fit coefficients. |
outlier_range |
Before the actual fit a linear pre-fit is performed. Based on their distance to this
pre-fit the data points are allocated to quartiles. A data point is considered an outlier if it is more
than |
n_suff |
Minial number (default=1) of data points in a specific year and region that will be regarded as sufficient to perform a fit. If the number of available data points is less no fit will be generated for this year and region. |
fill |
Logical (default=FALSE) indicating whether data will be copied from subsequent year if in the current year not enough data points are avaialbe. |
output_path |
Path to save the output to |
fitname |
Name that describes the fit (default: linear) and will be used for naming the output folders. |
create_pdf |
Logical indicating whether a pdf should be produced that compiles all figures. |
... |
Arguments passed on to the |
MAgPIE object containning fit coefficients
David Klein
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.