knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This package for calculating Fisher's information follows methods from @cabezas_san_2010, @eason_evaluating_2012, and @ahmad_using_2016. Python code from @ahmad_using_2016 and MATLAB code from @cabezas_san_2010 has been adapted for modelling in R. For reproducibility purposes we use the 'sample_data' provided by @ahmad_using_2016 as an example which is the GDP per capita and total population of the USA from 1960 to 2013. For detailed descriptions on how to conduct Fisher's information see @cabezas_san_2010, @eason_evaluating_2012 and @ahmad_using_2016, we recommend reading these references first if unfamiliar with Fisher's Information.
The fisher
function takes a dataframe as an input and an optional size of state (sos
) dataframe. If a size of state dataframe is not provided one will be created following methods from @cabezas_san_2010, @eason_evaluating_2012 and @ahmad_using_2016.
The fisher
function calculates: 1) the size of state; 2) Fisher's Information; and 3) Fisher's Information smoothed with a block mean of the desired window size. The final output is a dataframe where the last three columns are the Fisher's Information means, Fisher's Information smoothed and time-windows.
NOTE:
Data structure for input dataframe must have the first column as time-steps and following columns containing the variables of interest
NA values will be replaced by 0
Take care with the header
argument if reading in a csv
library(fisheR) df = read.csv("../sample_data.csv", header=F) sos = sost(df) df_FI = fisher(df, sos = sos, display_plot = TRUE)
"To consult the statistician after an experiment is finished is often merely to ask him to conduct a post mortem examination. He can perhaps say what the experiment" - R. A. Fisher [@fisher_presidential_1938]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.