Re: [sage-support] [Characteristic function of an interval] Heaveside too slow ?

2012-03-19 Thread Vegard Lima
On Wed, Mar 14, 2012 at 8:34 AM, Laurent moky.m...@gmail.com wrote: #! /usr/bin/sage -python # -*- coding: utf8 -*- from sage.all import * from scipy import stats import numpy X=stats.norm.rvs(size=300) K=((heaviside(x+1)-heaviside(x-1))).function(x) f = sum( [   K(  (Xi-x) ) for Xi in

Re: [sage-support] [Characteristic function of an interval] Heaveside too slow ?

2012-03-14 Thread Laurent
Il 14/03/2012 08:09, Vegard Lima ha scritto: Hi, On Wed, Mar 14, 2012 at 7:56 AM, Laurentmoky.m...@gmail.com wrote: I'm searching for a function f(x)=1 if x in [a,b], =0 otherwise how about using the Heaviside step function? oh yes, of course it works. Thanks. ... well My residual