Package 'edgeTransport'

Title: Prepare EDGE Transport Data for the REMIND model
Description: EDGE-T is a fork of the GCAM transport module https://jgcri.github.io/gcam-doc/energy.html#transportation with a high level of detail in its representation of technological and modal options. It is a partial equilibrium model with a nested multinomial logit structure and relies on the modified logit formulation. Most of the sources are not publicly available. PIK-internal users can find the sources in the distributed file system in the folder `/p/projects/rd3mod/inputdata/sources/EDGE-Transport-Standalone`.
Authors: Johanna Hoppe [aut, cre] , Alois Dirnaichner [aut], Marianna Rottoli [aut], Jarusch Muessel [aut]
Maintainer: Johanna Hoppe <[email protected]>
License: GPL-3
Version: 2.9.0
Built: 2024-11-22 09:26:36 UTC
Source: https://github.com/pik-piam/edgeTransport

Help Index


Generate EDGE-Transport Input Data for the REMIND model, madrat interface.

Description

calcEdgeTransportSA() is a wrapper for toolEdgeTransportSA() to make use of madrat caching.

Usage

calcEdgeTransportSA(
  SSPscen,
  transportPolScen,
  isICEban = FALSE,
  demScen = "default",
  gdxPath = NULL,
  outputFolder = NULL,
  isStored = FALSE,
  isTransportReported = TRUE,
  isTransportExtendedReported = FALSE,
  isREMINDinputReported = FALSE,
  isAnalyticsReported = FALSE
)

Arguments

SSPscen

SSP or SDP scenario

transportPolScen

EDGE-T transport policy scenario

isICEban

optional enabling of ICE ban

demScen

Demand scenario, used to apply reduction factors on total demands from the regression

gdxPath

Path to a GDX file to load price signals from a REMIND run

outputFolder

Path to folder for storing output data

isStored

Optional saving of intermediate RDS files

isTransportReported

Optional transport reporting in MIF format

isTransportExtendedReported

Optional extension of transport reporting providing more detailed variables

isREMINDinputReported

Optional reporting of REMIND input data

isAnalyticsReported

Optional reporting of analytics data (e.g. variables over iterations)

Value

Transport input data for REMIND

Author(s)

Jarusch Muessel, Johanna Hoppe


Calculate shares based on discrete choice model.

Description

Function works for the use of generic preferences as well as for inconvenience costs. If no preferences are provided the function sets them to one which is equivalent to pure description by inconvenience costs.

Usage

calculateShares(totPrice, lambda, pref = NULL)

Arguments

totPrice

total price of an option in a branch of the decision tree

lambda

exponent that determines the price sensitivity of the decision model

pref

optional use of generic preference fators

Value

share of option in a branch of the decision tree

Author(s)

Johanna Hoppe


Check a data.table for NAs and duplicates and throw an error if needed

Description

Check a data.table for NAs and duplicates and throw an error if needed

Usage

checkForNAsDups(dt, varname, codePosition)

Arguments

dt

data.table to be checked

varname

name of the variable

codePosition

position in the code to find the bug

Author(s)

Johanna Hoppe


Creates RDS files for iterative REMIND-EDGE runs from csv input files. Existing files are overwritten silently. Does not return anything.

Description

Creates RDS files for iterative REMIND-EDGE runs from csv input files. Existing files are overwritten silently. Does not return anything.

Usage

csv2RDS(filename, inputPath, SSPscenario, demScenario, transportPolScenario)

Arguments

filename

name of the file

inputPath

the path to the folder containing the input (csv-) files

SSPscenario

SSP scenario

demScenario

demand scenario

transportPolScenario

Transport policy scenario


List associated univocalNames for any entry of the decision tree

Description

List associated univocalNames for any entry of the decision tree

Usage

getFilterEntriesUnivocalName(categories, decisionTree)

Arguments

categories

vector of categories to filter

decisionTree

decision tree that contains the univocalNames associated to the category

Value

list of categories and their associated univocalNames e.g. trn_pass as list entry containing a vector c("Compact Car", "HSR", ..)

Author(s)

Johanna Hoppe


EDGE-Transport iterative

Description

Run in the REMIND output folder in between iterations

Usage

iterativeEdgeTransport()

Author(s)

Johanna Hoppe


Apply ICE ban on vehicle types that feature preference factors

Description

Apply ICE ban on vehicle types that feature preference factors

Usage

toolApplyICEbanOnPreferences(preferenceTab, helpers)

Arguments

preferenceTab

data.table including preferences for all levels of the decision tree

helpers

list of helpers

Value

Preferences in accordance to the ICE ban policy

Author(s)

Johanna Hoppe


toolApplyMixedTimeRes

Description

Applies two different temporal resolutions on a data.table object in the edgeTransport data structure and do a linear approximination for the highRes data that is not available

Usage

toolApplyMixedTimeRes(data, helpers, idcols = NULL)

Arguments

data

data.table containing data in in the edgeTransport data structure (at least featuring univocalName, period, value)

helpers

list containing several helpers used throughout the model. It includes dtTimeRes, a data.table containing the temporal resolution for different univocalNames

idcols

optional supply of idcols for using approx_dt

Value

data.table

Author(s)

Johanna Hoppe


Apply scenario specific adjustments to the preference trends

Description

Apply scenario specific adjustments to the preference trends

Usage

toolApplyScenPrefTrends(
  baselinePrefTrends,
  scenParPrefTrends,
  GDPpcMER,
  policyStartYear,
  GDPcutoff,
  helpers,
  isICEban
)

Arguments

baselinePrefTrends

Baseline preference trends

scenParPrefTrends

Scenario parameters to be applied on the preference trends

GDPpcMER

Per capita GDP based on market exchange rate

policyStartYear

Year from which the scenario parameters are applied on the baseline preference trends

GDPcutoff

Threshold used to categorize countries into different mitigation groups based on their GDP

helpers

List containing several helpers used throughout the model

isICEban

Switch to turn on ICE phase out policies

Value

Scenario specific preference trends

Author(s)

Johanna Hoppe


Apply demand scenario specific adjustments to the energy intensity

Description

Apply demand scenario specific adjustments to the energy intensity

Usage

toolApplyScenSpecEnInt(enInt, scenParEnergyIntensity, policyStartYear, helpers)

Arguments

enInt

Energy intensity input data supplied by mrtransport

scenParEnergyIntensity

Transport policy scenario specific energy intensity improvement factors

policyStartYear

Year from which scenario specific transport policies are applied

helpers

List with helpers

Value

data.table with scenario specific energy intensity input data

Author(s)

Johanna Hoppe


Apply demand scenario specific adjustments to the load Factor

Description

Apply demand scenario specific adjustments to the load Factor

Usage

toolApplyScenSpecLoadFactor(
  loadFactor,
  scenParLoadFactor,
  policyStartYear,
  helpers
)

Arguments

loadFactor

load factor input data supplied by mrtransport

scenParLoadFactor

Scenario specific parameters to be applied don the baseline load factor

policyStartYear

Year when scenario differentiation sets in

helpers

List with helpers

Value

Scenario specific load factor

Author(s)

Johanna Hoppe


Calculate annuity for different vehicle types

Description

Calculate annuity for different vehicle types

Usage

toolCalculateAnnuity(annuityCalc, helpers)

Arguments

annuityCalc

input data for interest rate and service Life from edgeTransport

helpers

list with helpers

Author(s)

Johanna Hoppe


Calculate composition of the fleet

Description

This function calculates the fleet composition based on the energy service demand, the composition of new sales each year and the service life of vehicles. With the help of the annual mileage, the absolute numbers of vehicles is calculated. If the remaining stock is sufficient to meet the energy service demand, 10

Usage

toolCalculateFleetComposition(
  ESdemandFVsalesLevel,
  vehDepreciationFactors,
  vehSalesAndModeShares,
  annualMileage,
  loadFactor,
  helpers
)

Arguments

ESdemandFVsalesLevel

Energy service demand on fuel vehicle level for new sales

vehDepreciationFactors

Factors for the depreciation of vehicles in each year of the maximum service Life

vehSalesAndModeShares

Vehicle sales and mode shares for the decision tree

annualMileage

Annual kilometers driven by a vehicle

loadFactor

Persons or tons loaded on each vehicle

helpers

List of helpers

Value

list of fleet composition data

Author(s)

Johanna Hoppe


toolCalculateFS3share

Description

Calculates fuel subsector L3 shares

Usage

toolCalculateFS3share(
  endoCostData,
  timesteps,
  timeValue,
  preferences,
  lambdas,
  helpers
)

Arguments

endoCostData

data.table containing all cost components on technology level

timesteps

years for which to calculate FS3 shares

timeValue

data.table containing mode specific time value costs based on speed and gdp

preferences

data.table containing preference trends

lambdas

data.table containing exponents for discrete choice calculation

helpers

list containing helpers like mappings, decisionTree etc.

Value

data.table containing all cost components on technology level and their respective FS3 shares

Author(s)

Johanna Hoppe


Calculate eneryg service demand on fuel vehicle level

Description

Calculate eneryg service demand on fuel vehicle level

Usage

toolCalculateFVdemand(
  sectorESdemand,
  salesAndModeShares,
  helpers,
  histESdemand = NULL,
  baseYear = NULL
)

Arguments

sectorESdemand

energy service demand on CES node level

salesAndModeShares

vehicle sales and mode shares

helpers

List with helpers

histESdemand

historcial energy service demand for iterative EDGE-T

baseYear

ned year of historical energy service demand

Value

data.table

Author(s)

Johanna Hoppe


Apply regional differences for inconvenience cost start values based on ICE cost differences

Description

Apply regional differences for inconvenience cost start values based on ICE cost differences

Usage

toolCalculateInitialIncoCost(
  combinedCost,
  incoCostStartVal,
  annuity,
  loadFactor,
  annualMileage,
  helpers
)

Arguments

combinedCost

total cost of ownership

incoCostStartVal

start values for inconvenience costs

annuity

calculated annuity for different vehicle types

loadFactor

load factor data

annualMileage

annual mileage data

helpers

list with helpers

Value

data.table including initial inconvenience costs from 1990-2020 for LDV 4W US$/(p|t)km

Author(s)

Johanna Hoppe


Calculate vehicle depreciation factors for fleet tracking

Description

Calculate vehicle depreciation factors for fleet tracking

Usage

toolCalculateVehicleDepreciationFactors(annuityCalc, helpers)

Arguments

annuityCalc

parameters for annualization

helpers

list with helpers

Value

data.table including vehicle depreciation factors over service life#'

Author(s)

Johanna Hoppe


Calibrate the logit share weights to historical data.

Description

Calibrate the logit share weights to historical data.

Usage

toolCalibrateHistPrefs(
  combinedCosts,
  histESdemand,
  timeValueCost,
  lambdas,
  helpers
)

Arguments

combinedCosts

Annualized total cost of ownership

histESdemand

Historical energy service demand data

timeValueCost

Time value cost for passenger transport modes

lambdas

Exponents for discrete choice function

helpers

list with helpers

Value

data.table with calibrated historical preferences


toolCheckAllLevelsComplete

Description

Checks whether data is complete for all levels of decision tree

Usage

toolCheckAllLevelsComplete(data, decisionTree, name)

Arguments

data

data.table containing data in all levels format that should be checked

decisionTree

data.table containing full edgeTransport decision Tree

name

name of variable to be checked

Value

data.table

Author(s)

Johanna Hoppe


Function that converts CAPEX and OPEX into US$/(p|t)km and provides them combined in a structured format

Description

Function that converts CAPEX and OPEX into US$/(p|t)km and provides them combined in a structured format

Usage

toolCombineCAPEXandOPEX(
  CAPEXtrackedFleet,
  nonFuelOPEXtrackedFleet,
  CAPEXother,
  nonFuelOPEXother,
  fuelCosts,
  subsidies,
  energyIntensity,
  loadFactor,
  annualMileage,
  annuity,
  helpers
)

Arguments

CAPEXtrackedFleet

CAPEX data for vehicle types that feature fleet tracking: Cars, trucks, busses

nonFuelOPEXtrackedFleet

non-fuel OPEX data for vehicle types that feature fleet tracking: Cars, trucks, busses

CAPEXother

CAPEX data for other vehicle types

nonFuelOPEXother

non-fuel OPEX data for other vehicle types

fuelCosts

fuel cost data

subsidies

purchase price subsidy data

energyIntensity

energy intensity data

loadFactor

load factor data

annualMileage

annual mileage data

annuity

calculated annuity for different vehicle types

helpers

list with helpers

Value

data.table including total costs of ownership in US$/(p|t)km


Energy service demand projection

Description

Energy service demand projection

Usage

toolDemandRegression(
  historicalESdemand,
  GDPperCapitaPPP,
  POP,
  genParDemRegression,
  scenParDemRegression,
  scenParRegionalDemRegression,
  scenParDemandFactors,
  baseYear,
  policyStartYear,
  helpers
)

Arguments

historicalESdemand

Historical energy service demand

GDPperCapitaPPP

GDP per capita based on purchase power parity

POP

Population data

genParDemRegression

General regression factors

scenParDemRegression

Scenario specific general regression factors

scenParRegionalDemRegression

Scenario specific regionally differentiated regression factors

scenParDemandFactors

Demand scenario factors

baseYear

End year of historical energy service demand data

policyStartYear

Start year of scenario differentiation

helpers

list with helpers

Value

Scenario specific energy service demand for all model years on CES level

Author(s)

Johanna Hoppe


Calculate vehicle sales shares and mode shares for all levels of the decisionTree.

Description

Function that traverses each level of the decision tree and calculates the shares according to the discrete choice approach

Usage

toolDiscreteChoice(input, generalModelPar, updatedEndoCosts, helpers)

Arguments

input

dataset for discrete choice module

generalModelPar

general model parameter

updatedEndoCosts

updated endogenous costs

helpers

list of helpers

Value

calculated shares

Author(s)

Johanna Hoppe


Energy Demand Generator (EDGE)- Transport Model

Description

The Edge Transport Model includes the transport specific input data preparation, a choice model to determine transport mode and technology shares, a demand regression and a fleet tracking for cars, busses and trucks

Usage

toolEdgeTransportSA(
  SSPscen,
  transportPolScen,
  isICEban = FALSE,
  demScen = "default",
  gdxPath = NULL,
  outputFolder = NULL,
  isStored = TRUE,
  isTransportReported = TRUE,
  isTransportExtendedReported = FALSE,
  isREMINDinputReported = FALSE,
  isAnalyticsReported = FALSE
)

Arguments

SSPscen

SSP or SDP scenario

transportPolScen

EDGE-T transport policy scenario

isICEban

optional enabling of ICE ban

demScen

Demand scenario, used to apply reduction factors on total demands from the regression

gdxPath

Path to a GDX file to load price signals from a REMIND run

outputFolder

Path to folder for storing output data

isStored

Optional saving of intermediate RDS files

isTransportReported

Optional transport reporting in MIF format

isTransportExtendedReported

Optional extension of transport reporting providing more detailed variables

isREMINDinputReported

Optional reporting of REMIND input data

isAnalyticsReported

Optional reporting of analytics data (e.g. variables over iterations)

Value

Transport input data for REMIND

Author(s)

Johanna Hoppe, Jarusch Müßel, Alois Dirnaichner, Marianna Rottoli


Read and build the complete structure of the edgeTransport decision tree

Description

Read and build the complete structure of the edgeTransport decision tree

Usage

toolLoadDecisionTree(regionAggregation = "iso")

Arguments

regionAggregation

choose one of the different options for regional aggregation (iso|regionCode21|regionCode12)

Value

data.table of full spatially extended edgeTransport decision tree

Author(s)

Johanna Hoppe


Load all inputs that are required to run the model

Description

Load all inputs that are required to run the model

Usage

toolLoadInputs(SSPscen, transportPolScen, demScen, gdxPath, hybridElecShare)

Arguments

SSPscen

SSP or SDP scenario

transportPolScen

EDGE-T transport policy scenario

demScen

Demand scenario, used to apply reduction factors on total demands from the regression

gdxPath

Path to a GDX file to load price signals from a REMIND run

hybridElecShare

Share of electricity in Hybrid electric vehicles

Value

list with different input data sets

Author(s)

Johanna Hoppe


Load iterative inputs

Description

Load iterative inputs

Usage

toolLoadIterativeInputs(
  edgeTransportFolder,
  inputFolder,
  inputFiles,
  numberOfRegions,
  SSPscenario,
  transportPolScenario,
  demScenario
)

Arguments

edgeTransportFolder

transport folder

inputFolder

the path to the folder containing the input (csv-) files

inputFiles

names of the input files

numberOfRegions

regional resolution

SSPscenario

SSP scenario

transportPolScenario

Transport policy scenario

demScenario

demand scenario


Load GDP and Population data from mrdrivers

Description

Load GDP and Population data from mrdrivers

Usage

toolLoadmrdriversData(SSPscen, helpers)

Arguments

SSPscen

SSP scenario for which the mrdrivers input data shall be loaded

helpers

list containg several helpers used throughout the model. It includes dtTimeRes, a data.table containing the temporal resolution for different univocalNames

Value

list of data.tables containing mrdrivers input data


Load data from mrremind

Description

Load data from mrremind

Usage

toolLoadmrremindData(helpers)

Arguments

helpers

list containg several helpers used throughout the model. It includes dtTimeRes, a data.table containing the temporal resolution for different univocalNames

Value

list of data.tables containing mrremind input data


Load input data from the mrtransport package

Description

Load input data from the mrtransport package

Usage

toolLoadmrtransportData(SSPscen)

Arguments

SSPscen

SSP scenario for which the mrtransport input data should be loaded

Value

list of data.tables with the mrtransport input data


Load input data from the edgeTransport package and choose data according to SSP and transport policy scenario

Description

Load input data from the edgeTransport package and choose data according to SSP and transport policy scenario

Usage

toolLoadPackageData(SSPscenario, transportPolScenario, demScenario = NULL)

Arguments

SSPscenario

SSP scenario for which the package data should be loaded

transportPolScenario

transport policy scenario for which the package data should be loaded

demScenario

demand scenario for which the package input data should be loaded

Value

list of data.tables with the package input data


Load REMIND energy service demand

Description

Load the energy service demand from a REMIND fulldata.gdx on sector level (CES level) in [bn (p|t)km/yr] and the requested temporal resolution

Usage

toolLoadREMINDesDemand(gdxPath, helpers)

Arguments

gdxPath

path to REMIND fulldata.gdx

helpers

list of helpers


Load fuel prices from a REMIND fulldata.gdx in [US$/MJ] and map them on to the edgeTransport decision tree. The output is provided in the same spatial resolution as the transferred gdx file and the temporal resolution is set according to the param yrs.

Description

Load fuel prices from a REMIND fulldata.gdx in [US$/MJ] and map them on to the edgeTransport decision tree. The output is provided in the same spatial resolution as the transferred gdx file and the temporal resolution is set according to the param yrs.

Usage

toolLoadREMINDfuelCosts(gdxPath, hybridElecShare, helpers)

Arguments

gdxPath

path to REMIND fulldata.gdx

hybridElecShare

Share of electricity in Hybrid electric vehicles

helpers

list with helpers

Value

fuel costs on technology level


Normalize preferences so that the maximum in each branch of the decision tree equals 1

Description

Normalize preferences so that the maximum in each branch of the decision tree equals 1

Usage

toolNormalizePreferences(preferenceTab)

Arguments

preferenceTab

data.table including preferences for all levels of the decision tree

Value

Normalized preferences

Author(s)

Johanna Hoppe


toolOrderandCheck

Description

sort data.table according to edgeTransport data structure and check for NAs If checkCompletness is activated it is further checked, if the full data set is provided. In case of fleetVars == TRUE the full data set is reduced to the vehicle types that feature fleet tracking

Usage

toolOrderandCheck(
  data,
  decisionTree,
  yrs = NULL,
  checkCompleteness = FALSE,
  fleetVars = FALSE
)

Arguments

data

data.table containing data in all levels format that should be checked

decisionTree

data.table containing full edgeTransport decision Tree

yrs

temporal resolution

checkCompleteness

if activated it is further checked, if the full data set is provided

fleetVars

if activated the full data set is reduced to vehicle types that feature fleet tracking

Value

data.table

Author(s)

Johanna Hoppe


Format all cost components

Description

Format all cost components

Usage

toolPrepareDataEndogenousCosts(inputData, lambdas, helpers)

Arguments

inputData

List containing inputData

lambdas

exponents for discrete choice calculation

helpers

List with helpers

Value

data.table including all cost components

Author(s)

Johanna Hoppe


Apply transport scenario specific adjustments to input data

Description

Apply transport scenario specific adjustments to input data

Usage

toolPrepareScenInputData(
  genModelPar,
  scenModelPar,
  inputDataRaw,
  policyStartYear,
  GDPcutoff,
  helpers,
  isICEban
)

Arguments

genModelPar

General model parameters

scenModelPar

Transport scenario (SSPscen + demScen + polScen) specific model parameters

inputDataRaw

Raw input data

policyStartYear

Year when scenario differentiation sets in

GDPcutoff

GDP cutoff to differentiate between regions

helpers

List with helpers

isICEban

optional enabling of ICE ban

Value

List of data.tables with scenario specific input data

Author(s)

Johanna Hoppe


Calculate data for the next higher level of the decision tree.

Description

Function that aggregates the data for the next higher level of the decision tree

Usage

toolTraverseDecisionTree(data, upperLevel, decisionTree)

Arguments

data

data.table containing the data of the lower level

upperLevel

name of the upper level in the decision tree

decisionTree

full edgeTransport decision tree

Value

data.table

Author(s)

Johanna Hoppe


toolUpdateEndogenousCosts

Description

Provides updates for endogenous cost components e.g. inconvenience costs for cars

Usage

toolUpdateEndogenousCosts(
  dataEndoCosts,
  depreciationFactors,
  scenParIncoCost,
  policyStartYear,
  timeValue,
  preferences,
  lambdas,
  helpers,
  isICEban,
  vehiclesPerTech = NULL
)

Arguments

dataEndoCosts

data.table containing all cost components for cars over the full range of policy years in a yearly resolution. Exogenous CAPEX and OPEX are provided over the full range. Endogenous cost components and FS3 shares are provided until policyStartYear. Rest is filled with NA.

depreciationFactors

data.table containing vehicle depreciation factor for each year of service Life

scenParIncoCost

data.table containing scenario specific parameters for inconvenience costs policy mask

policyStartYear

year from which scenario-specific differentiation begins

timeValue

data.table containing mode specific time value costs based on speed and gdp

preferences

preference factor trends

lambdas

data.table containing exponents for discrete choice calculation

helpers

list containing helpers like mappings, decisionTree etc.

isICEban

optional enabling of ICE ban

vehiclesPerTech

data.table containing total number of vehicles for all years and regions

Value

list containing data.table with endogenous cost components over the full time span and additional data.tables for model behavior analysis

Author(s)

Johanna Hoppe