Created
September 23, 2012 19:56
-
-
Save cartazio/3772844 to your computer and use it in GitHub Desktop.
golf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- assumes hmatrix installed | |
module Main where | |
import Numeric.LinearAlgebra | |
import Graphics.Plot | |
x:: Vector Double | |
x = linspace 2000 (-10.0,10.0) | |
randomSeed= 7331 --because its funny, also because i don't want to break in some io for a simple example | |
rnorm :: Int -> Double -> Double -> Vector Double | |
rnorm size mean sd = flatten $ (gaussianSample randomSeed size $ constant mean 1 ) $ fromLists [[sd]] | |
y = scale 2 x + rnorm 2000 0.0 2.0 | |
main = do | |
mplot [x,y] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment