Git Product home page Git Product logo

smoke-plot's Introduction

SmokePlot

A function (smokeplot.R) for visualizing results uncertainty. The function draws from a user-supplied posterior distribution p(θ|y), generally in the form of three column vectors: (1) covariate values, (2) mean estimates and (3) error estimates. The draws are then graphed with visual weighting so that areas of the posterior with concentrated uncertainty are emphasized, whereas areas with diffuse uncertainty are less prominent.

The aim is to avoid emphasizing the limits of the confidence interval at the expense of regions that are more information-rich. The function uses geom_raster and interpolation to produce smaller files with smoother edges. Traditional confidence intervals, a median line, and spaghetti lines can be added as options.

The code is adapted from Felix Schönbrodt and is motivated by Solomon Hsiang's paper.

Usage

  mat <- as.matrix(read.table("https://raw.github.com/george-wood/SmokePlot/master/example_matrix.txt", header=FALSE))
  source("https://raw.github.com/george-wood/SmokePlot/master/smokeplot.R")
  smokeplot(mat, palette=magma(10), slices=1000, smoke.alpha=0.5,
             ylim=c(-4, 1), title='color spectrum')

Examples

Ex1

Dependencies

  • ggplot2
  • ggthemes
  • reshape2
  • viridis
  • plyr

smoke-plot's People

Contributors

george-wood avatar

Watchers

 avatar

Forkers

pamato

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.