<s> from pylab import * <EOL> from dream import * <EOL> x = linspace ( - <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT> ) <EOL> fn = lambda p : polyval ( p , x ) <EOL> bounds = ( - <NUM_LIT:20> , - <NUM_LIT:20> , - <NUM_LIT:20> ) , ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> sigma = <NUM_LIT:1> <EOL> data = fn ( ( <NUM_LIT:2> , - <NUM_LIT:1> , <NUM_LIT:3> ) ) + randn ( * x . shape ) * sigma <EOL> n = len ( bounds [ <NUM_LIT:0> ] ) <EOL> model = Simulation ( f = fn , data = data , sigma = sigma , bounds = bounds ) <EOL> sampler = Dream ( model = model , <EOL> population = randn ( <NUM_LIT:5> * n , <NUM_LIT:4> , n ) , <EOL> thinning = <NUM_LIT:1> , <EOL> draws = <NUM_LIT> , <EOL> ) <EOL> mc = sampler . sample ( ) <EOL> figure ( <NUM_LIT:6> ) ; model . plot ( mc . best ( ) [ <NUM_LIT:0> ] ) <EOL> plot_all ( mc ) </s>
