knitr::opts_chunk$set( collapse = TRUE, comment = "#>", dev = "png" )
library(SolowVariants) theme_set(theme_bw()) # Setting up the parameter grid --------------------------------- aux_np <- 200 aux_parameter_grid <- create_parameter_grid( c("B", "alpha", "delta", "n", "s"), c(10, 1 / 3, 0.1, 0.005, 0.22), c(NA, NA, NA, NA, NA), c(NA, NA, NA, NA, NA), aux_np ) # Setting starting values for K and L --------------------------------- aux_startvalues <- list(K = 1, L = 1) # Simulate the basic Solow growth model --------------------------------- aux_simulation <- SimulateBasicSolowModel(aux_parameter_grid, aux_np,aux_startvalues) # Visualise some variables --------------------------------- VisualiseSimulation(aux_simulation, c("YpW", "Y", "KpW"), "free") # Verify whether the economy is 'in' steady state in the final period --------------------------------- steadystate_checker(aux_simulation, aux_parameter_grid, "BS")
# Simulating the BS library(SolowVariants) aux_np <- 200 aux_parameter_grid <- create_parameter_grid( c("B", "alpha", "delta", "n", "s"), c(10, 1 / 3, 0.1, 0.005, 0.22), c(NA, NA, 100, NA, NA), c(NA, NA, 0.05, NA, NA), aux_np ) aux_startvalues <- list(K = 1, L = 1) aux_simulation_BS <- SimulateBasicSolowModel(aux_parameter_grid, aux_np, aux_startvalues) # Simulating the GS aux2_parameter_grid <- create_parameter_grid( c("g", "alpha", "delta", "n", "s"), c(0.05, 1 / 3, 0.1, 0.005, 0.22), c(NA, NA, NA, NA, 50), c(NA, NA, NA, NA, 0.05), aux_np ) aux2_startvalues <- list(A = 1, K = 1, L = 1) aux_simulation_GS <- SimulateGeneralSolowModel(aux2_parameter_grid, aux_np, aux2_startvalues) # Comparing the two simulations (solow variants) --------------------------------- compare_simulations( list(aux_simulation_BS, aux_simulation_GS), c("BS", "GS"), c("logY", "gYpW", "YpEW", "RR") )
| Solow Variant | Simulation Function |
|:--------------------------------------------------------------------------------------- |:------------------------------------------------------ |
| Basic Solow Growth Model | SimulateBasicSolowGrowthModel()
|
| General Solow Growth Model | SimulateGeneralSolowModel()
|
| Extended Solow Growth Model with Human Capital | SimulateExtendedSolowModelHumanCapital()
|
| Extended Solow Growth Model for the Small and Open Economy | SimulateExtendedSolowModelSmallOpenEconomy()
|
| Extended Solow Growth Model with Scarce Resource Land | SimulateExtendedSolowModelScarceResourceLand()
|
| Extended Solow Growth Model with Scarce Resource Oil | SimulateExtendedSolowModelScarceResourceOil()
|
| Extended Solow Growth Model with Scarce Resources Oil and Land | SimulateExtendedSolowModelScarceResourceOilAndLand()
|
| Extended Solow Growth Model with Endogenous Technological Growth | SimulateExtendedSolowModelEndogenousGrowth()
|
| Extended Solow Growth Model with Endogenous Technological Growth (Romer Extension) | SimulateExtendedSolowModelEndogenousGrowthRomer()
|
| Extended Solow Growth Model with Endogenous Technological Growth (Cozzi Extension) | SimulateExtendedSolowModelEndogenousGrowthCozziOne()
|
| Extended Solow Growth Model with Endogenous Technological Growth (Cozzi's Hybrid Model) | SimulateExtendedSolowModelEndogenousGrowthCozziTwo()
|
The table below shows the used abbreviations, so-called model codes, that will be used throughout the package to refer to the respective Solow Growth Model Variants.
| Solow Variant | Simulation Function | |:--------------------------------------------------------------------------------------- |:-------------------:| | Basic Solow Growth Model | BS | | General Solow Growth Model | GS | | Extended Solow Growth Model with Human Capital | ESHC | | Extended Solow Growth Model for the Small and Open Economy | ESSOE | | Extended Solow Growth Model with Scarce Resource Land | ESSRL | | Extended Solow Growth Model with Scarce Resource Oil | ESSRO | | Extended Solow Growth Model with Scarce Resources Oil and Land | ESSROL | | Extended Solow Growth Model with Endogenous Technological Growth | ESEG | | Extended Solow Growth Model with Endogenous Technological Growth (Romer Extension) | ESEGRomer | | Extended Solow Growth Model with Endogenous Technological Growth (Cozzi Extension) | ESEGCozziOne | | Extended Solow Growth Model with Endogenous Technological Growth (Cozzi's Hybrid Model) | ESEGCozziTwo |
| Full Variable Name | Variable | | ------------------------- |:--------:| | Total Factor Productivity | TFP | | Labor Force | L | | (Physical) Capital | K | | Human Capital | H | | Output | Y | | National Output | Yn | | National Savings | Sn | | Consumption | C | | National Wealth | V | | Net Foreign Assets | F | | Energy | E | | Resource Stock | R | | Land | X | | Capital to Output Ratio | CtO | | Wage Rate | WR | | (Capital) Rental Rate | RR | | Land Rental Rate | LR |
| Prefix/Suffix | Meaning | |:-------------:| ---------------------- | | gX | Growth Rate of X | | logX | Logarithm of X | | XpW | X per Worker | | XpEW | X per Effective Worker |
The following hyperlinks link directly to the vignettes that contain explanations on the respective Solow variant.
Remark: You can call any of these directly with, for example, vignette("BS")
.
?compare_simulations
.vignette("SolowVariants"); vignette("ESEG")
Example regarding assignment by position f <- function(x, y){x + y} f(x = 3, y = 3) # argument assignment by name f(3, 3) # argument assignment by position
The following steps are self-contained. Thus, each part can live on its own and does not require the other parts to be implemented.
add_vars_ModelCode
in meta_variables.R
.getRequiredParams
.getRequiredStartingValues
.ModelFunctions.R
.ModelFunctions.R
. (Don't forget to export them!)steadystate_checker
(in HelperFunctions.R
). ModelFunctions.R
.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.