This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Vincent Carret | |
# Contact: vincent.carret@univ-lyon2.fr | |
# This R script reproduces the figures in the paper "And yet it rocks! Fluctuations and growth in Ragnar Frisch's rocking horse model" (version 3 - online 5 Dec. 2020) | |
# There is an app version accessible here: https://cbheem.shinyapps.io/Frisch/ | |
# The libraries at the beginning are necessary and must be installed | |
library(plotly) | |
library(dplyr) | |
# Functions ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initPoint <- function(z, k){ | |
I <- complex(real = 0, imaginary = 1) | |
tPiKI <- complex(real = 0, imaginary = 2*pi*k) | |
ip <- log(z) + tPiKI - log(log(z) + tPiKI) | |
p <- sqrt(2*(exp(1)*z+1)) | |
if(abs(z - (-exp(-1))) <= 1){ | |
if(k == 0) ip <- -1 + p - 1/3 * p^2 + 11/72 * p^3 | |
if(k == 1 && Im(z) < 0) ip <- -1 - p - 1/3 * p^2 - 11/72 * p^3 | |
if(k == -1 && Im(z) > 0) ip <- -1 - p - 1/3 * p^2 - 11/72 * p^3 |