magclass (version 4.107.0)

convergence: convergence

Description

Cross-Fades the values of one MAGPIE object into the values of another over a certain time

Usage

convergence(origin, aim, start_year = NULL, end_year = NULL,
  direction = NULL, type = "smooth", par = 1.5)

Arguments

origin

an object with one name-column

aim

Can be twofold: An magpie object or a numeric value.

start_year

year in which the convergence from origin to aim starts. If set to NULL the the first year of aim is used as start_year

end_year

year in which the convergence from origin to aim shall be (nearly) reached. If set to NULL the the last year of aim is used as end_year.

direction

NULL, "up" or "down". NULL means normal convergence in both directions, "up" is only a convergence if origin<aim, "down" means only a convergence if origin>aim

type

"smooth", "s", "linear" or "decay". Describes the type of convergence: linear means a linear conversion , s is an s-curve which starts from origin in start_year and reaches aim precisely in end_year. After 50 percent of the convergence time, it reaches about the middle of the two values. Its based on the function min(1, pos^4/(0.07+pos^4)*1.07) smooth is a conversion based on the function x^3/(0.1+x^3). In the latter case only 90% of convergence will be reached in the end year, because full convergence is reached in infinity. decay is a conversion based on the function x/(1.5 + x)*2.5.

par

parameter value for convergence function; currently only used for type="decay"

Value

returns a time-series with the same timesteps as origin, which lineary fades into the values of the aim object

See Also

lin.convergence

Examples

Run this code
# NOT RUN {
data(population_magpie)
population <- add_columns(population_magpie,"MIX")
population[,,"MIX"]<-convergence(population[,,"A2"],population[,,"B1"])


# }

Run the code above in your browser using DataCamp Workspace