8000 GitHub - mpleung/ARD: Code for 'Recovering Network Structure from Aggregated Relational Data Using Penalized Regression'
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ ARD Public

Code for 'Recovering Network Structure from Aggregated Relational Data Using Penalized Regression'

Notifications You must be signed in to change notification settings

mpleung/ARD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains code for simulation experiments and walkthroughs on using the estimator in Alidaee, Auerbach, and Leung (2020), "Recovering Network Structure from Aggregated Relational Data Using Penalized Regression." We provide implementations in Python and R, found in their respective folders. Walkthroughs are given in the notebook files walkthrough.ipynb. The file in the Python folder can be viewed in two ways.

  1. It can be opened in your browser using this binder link: Binder Note that this might take a little bit of time to start up.

  2. You can open the file on your desktop using the notebook viewer nteract. This method requires an installation of Python, the Python kernel, and the required modules (see instructions below), but it also allows you to use your own datasets instead of those provided in our example. To do so, save walkthrough.ipynb, nuclear_norm_module.py, and your datasets in CSV format to the same working directory, open the walkthrough file in nteract, and change the name of the CSVs in the walkthrough within the nteract user interface.

The file in the R folder can also be viewed in nteract after installation of R, the R kernel, and our R package. Instructions are given below.

Contents of Python folder

  • walkthrough.ipynb: walkthrough of Python implementation.
  • ARD_data.csv, type_data.csv: artificial data for the walkthrough.
  • nuclear_norm_module.py: implementation of accelerated gradient descent method. The code builds on this repository.
  • monte_carlo.py: code for simulation experiments summarized in Table 2 of the paper.
  • effective_rank.py: produces Table 1 of the paper, which simulates the effective ranks of M^* under three network formation models.

To run the .py files, we require Python 3 and installation of numpy, pandas, and scipy. See this walkthrough for installing Python via the Anaconda distribution, which also includes the required packages. If Python 3 is already installed on your machine, then you only need to install the packages, which can be done by entering into command line

python3 -m pip install --user numpy scipy pandas

If you are using nteract to view the walkthrough file, you also have to install an ipython kernel. See here for instructions.

To execute monte_carlo.py, download our Python folder and its contents, change your current working directory to the Python folder, and enter into command line

python3 monte_carlo.py

Contents of R folder

  • walkthrough.ipynb: walkthrough of R implementation.
  • ARD_data.csv, type_data.csv: artificial data for the walkthrough.
  • nuclearARD_0.1.tar.gz: R package for our estimator.
  • nuclear_ard: contents of R package.

You can install R here. To install our R package, download our R folder, open the R console, change the working directory to the location of our R folder, and input the following command:

install.packages('nuclearARD_0.1.1.tar.gz', repos=NULL, type='source')

To view the walkthrough file in nteract, you also need to install the IRkernel. Follow the installation instructions here.

About

Code for 'Recovering Network Structure from Aggregated Relational Data Using Penalized Regression'

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0