Coder Social home page Coder Social logo

scalable-crossed-mixed-effects's Introduction

scalable-crossed-mixed-effects

This repository contains Python code for scalable parameter estimation and inference in massive linear mixed models with crossed random effects. The algorithms are taken from our papers:

  1. Katelyn Gao and Art Owen. Efficient moment calculations for variance components in large unbalanced crossed random effects models. Electronic Journal of Statistics, 11(1): 1235-1296, 2017. http://projecteuclid.org/euclid.ejs/1492135234.
  2. Katelyn Gao and Art Owen. Estimation and inference for very large linear mixed effects models. Arxiv e-prints, 2016. http://arxiv.org/abs/1610.08088v2.

We assume that there are two crossed factors; the examples from e-commerce in the papers have as factors users and products. The data are assumed to reside on one machine.

Usage

Requires numpy and cleaned data (no NAs). For the crossed random effects model, download cre.py. For the linear mixed model, download mixed.py.

cre.py

From the command line, run python cre.py fileName.txt.

  1. fileName.txt contains the data in log-file format: (i,j,Yij), where i is the level of the first factor, j is the level of the second factor, and Yij is the response of interest. Each line is an observation and the quantities are separated by spaces.
  2. Prints out estimated variance components and their conservative variances.

mixed.py

From the command line, run python mixed.py fileName.txt

  1. fileName.txt contains the data in log-file format: (i,j,Yij,xij), where i is the level of the first factor, j is the level of the second factor, Yij is the response of interest, and xij are the predictors (be sure to include a '1' if an intercept is desired). Each line is an observation and the quantities are separated by spaces.
  2. Prints out estimated regression coefficients and variance components and their asymptotic variances.

scalable-crossed-mixed-effects's People

Contributors

kxgao avatar

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.