Code Monkey home page Code Monkey logo

validate-forecast-methods's Introduction

validate-forecast-methods

validate-forecast-methods provides the R source code used in the project:

Bohk-Ewald, Christina, Peng Li, and Mikko Myrskylä (2017). Assessing the accuracy of cohort fertility forecasts. Presented in session: Statistical methods in demography at the PAA 2017 Annual Meeting, Chicago, IL, USA, April 27-April 29, 2017

How to run

The code needs to be executed in eight steps, as defined by step-*.R files in the root directory. You can run these scripts separately or all at once with step-0-all-steps-at-once.R

Prerequisites

  • The .txt files in ./input-data/ contain empty lists due to copyrights. You will need to put in fertility data yourself. See comments for step 2 in [step-0-all-steps-at-once.R].

  • Make sure you have configured the correct paths (in each of the nine step-*.R files).

Execution

You can run all steps all at once step-0-all-steps-at-once.R (recommended) or you can run the step-*.R scripts in the root directory in the prescribed order.

How to cite

If you use this code for academic research, please cite the above conference talk.

How to contribute

Please note that this source code is an academic project. We welcome any issues and pull requests.

License

The source code of validate-forecast-methods is published under the GNU General Public License version 3.

validate-forecast-methods's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mpascariu txiao95

validate-forecast-methods's Issues

Step 4 Warnings: NaNs produced

I run the following code using data downloaded from HFD today.

run_projection_for_selected_methods(asfr_period,
                                    expos_period,
                                    JOYs=2013:2014,
                                    validation_methods_info,
                                    forecasts_by_method_folder="results/forecasts-by-method-test")

The process is completed successfully. However, the following warnings are returned too:

There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In pt(abs(tstat), df = ndof) : NaNs produced
2: In pt(abs(tstat), df = ndof) : NaNs produced
3: ...

Is this a normal behaviour?

Step 1 nuptfer

The nuptfer package can be found only on GitHub.
Maybe you should let the users know about this.

Step 4 Error

Hi Christina,

Very nice paper, very nice code.
I am trying to reproduce your results. And I encountered the following error in step 4.

Method09_PeristeraKostaki2007M2: 2013  2014  Extract results
Calculate CFR...done.
Method10_MyrskylaGoldstein2013: Error in source("basic-scripts-forecast-methods/Method10_MyrskylaGoldstein2013/Method10_MyrskylaGoldstein2013.R") : 
  invalid multibyte character in parser at line 384

Going to line 384 in can see

                method="Myrskyl? and Goldstein (2013)",

Replacing ? with a would solve the issue.

I suspect that this problem is generated by the fact that your PC might use a different encoding system that supports special characters (german letters etc.). The solution would be to avoid using special characters, otherwise on a UTF-8 character encoding these will be replaced with ?.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.