Giter VIP home page Giter VIP logo

residuals_pylab's Introduction

self explainatory:

it makes a classical residual plot, with the residuals at the bottm and the data in the top panel. each plot can be scatter plot, line plot and the data can be errorbars

try it as follows

1.get 100 random numbers b/w 0 and 10 2.get the y as sine(x) plus some linear function of x with some scatter 3.get another array of 100 random numbers b/w 0 and 10 4.get the y for the second set as sine(x) plus some linear function, steeper this time, of x, with some scatter 5.get the residuals of a simple sine fit function (not a fit, just the sin(x)), as percentage 6.and finally plot it

here is the code:

import numpy as np

import pylab as pl

from residplot import plotwresids

x=np.random.rand(100)*10

y=np.sin(x)+0.3*(np.random.rand(100)-0.5)*np.sqrt(x)

x1=np.random.rand(100)*10

y1=np.sin(x1)+(np.random.rand(100)-0.5)*np.sqrt(x1)

res=(y-np.sin(x))

res1=(y1-np.sin(x1))

plotwresids(x,y,res,xlabel= "fake data",ylabel="sin-ish", legend="made up stuff")

plotwresids([x,x1],[y,y1],[res,res1],err=[None,np.sqrt(np.abs(np.sin(x1)))],xlabel= "fake data",ylabel="sin-ish",scatter=[True,True], color=['SteelBlue','DarkOrange'], legend=["madeup stuff","more madeup stuff"])

pl.show()

residuals_pylab's People

Contributors

fedhere avatar fierrozd avatar

Watchers

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