Giter Site home page Giter Site logo

anthonyhung / mixsqp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stephenslab/mixsqp

0.0 1.0 0.0 21.09 MB

R package for fast maximum-likelihood estimation of mixture proportions using SQP.

Home Page: https://bit.ly/2NtYHWT

License: Other

R 74.39% Shell 0.57% C++ 23.95% C 1.08%

mixsqp's Introduction

mixsqp: Fast maximum-likelihood estimation of mixture proportions using sequential quadratic programming

CRAN status badge Travis Build Status Appveyor Build status codecov

The mixsqp R package provides algorithms based on sequential quadratic programming for maximum likelihood estimation of the mixture proportions in a finite mixture model where the component densities are known. The SQP algorithm is expected to obtain solutions that are at least as accurate as the state-of-the-art MOSEK interior-point solver (called via the "KWDual" function in the REBayes package), and is expected to compute these solutions much more quickly in large data sets.

For more details on the methods, please see the journal paper or the arXiv preprint.

The methods were originally implemented in Julia; please see here for the Julia implementation.

If you find a bug, or you have a question or feedback on our work, please post an issue.

Citing this work

If you find the mixsqp package or any of the source code in this repository useful for your work, please cite:

Youngseok Kim, Peter Carbonetto, Matthew Stephens and Mihai Anitescu. A fast algorithm for maximum likelihood estimation of mixture proportions using sequential quadratic programming. To appear in the Journal of Computational and Graphical Statistics.

License

Copyright (c) 2017-2020, Youngseok Kim, Peter Carbonetto, Matthew Stephens and Mihai Anitescu.

All source code and software in this repository are made available under the terms of the MIT license.

Quick Start

Install mixsqp from CRAN:

install.packages("mixsqp")

For more detailed installation instructions, see the "Setup" section below.

Once you have installed the package, load the package in R:

library(mixsqp)

Next, run the small example provided with the mixsqp function:

example("mixsqp")

For a more detailed illustration of the SQP algorithm applied to the problem of computing maximum-likelihood estimates for a mixture model, read through the introductory vignette.

To learn more, visit the package website, or view the "mixsqp" help page:

help("mixsqp")

Setup

To install mixsqp from CRAN, in R run:

install.packages("mixsqp")

Alternatively, to install the latest version of the mixsqp package from GitHub, use devtools:

install.packages("devtools")
library(devtools)
install_github("stephenslab/mixsqp",build_vignettes = TRUE)

This command should automatically install all required packages if they are not installed already.

If you have cloned the repository locally, you can install the package with the install_local function from devtools. Assuming your working directory contains the mixsqp repository, run this code to install the package:

library(devtools)
install_local("mixsqp")

Additional setup notes

  • Compiling the mixsqp package from source will require a C++ compiler setup that is appropriate for the the R installed on your computer. For details, refer to the CRAN documentation. For Mac computers, see these notes.

  • To use the (optional) alternative solver, "mixkwdual", which is mostly useful for comparisons of the different optimization methods, you will need to install the REBayes package. The REBayes package, in turn, requires the Rmosek package. Refer to the MOSEK documentation for instructions on installing the Rmosek package. Once you have followed these steps, you can run this example to verify that Rmosek is correctly installed. Installation of the REBayes package also allows you to build the vignette and view it locally:

devtools::install_github("stephenslab/mixsqp",build_vignettes = TRUE)
library(mixsqp)
vignette("mixsqp-intro")

Developer notes

Testing the package

To install and test the mixsqp R package, run the following commands in the shell:

R CMD build mixsqp
R CMD INSTALL mixsqp_0.3-31.tar.gz
R CMD check --as-cran mixsqp_0.3-31.tar.gz

Note that these commands require that the dependencies have already been installed. See the DESCRIPTION file for details.

Updating the C++ source and documentation

When any changes are made to roxygen2 markup or to the C++ code in the src directory, simply run devtools::document() to update the RcppExports.cpp, the NAMESPACE file, and the package documentation files in the man directory.

Updating the pkgdown site

Run this line of R code to build the website (make sure you have an Internet connection while running the code):

pkgdown::build_site()

Version 1.4.1 of pkgdown was used.

Other developer notes

Add file pre-commit to .git/hooks in the git repository to prevent commits that don't include a change to the package version.

Credits

The mixsqp R package was developed by Youngseok Kim and Peter Carbonetto at the University of Chicago, with contributions from Matthew Stephens and Mihai Anitescu.

Changes!

mixsqp's People

Contributors

pcarbo avatar youngseok-kim avatar stephens999 avatar anthonyhung avatar kant avatar

Watchers

James Cloos 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.