Skip to content
Prev 30317 / 398503 Next

density ranges for uniform law

Hi,

 | From: ZABALZA-MEZGHANI Isabelle <Isabelle.ZABALZA-MEZGHANI at ifp.fr>
 | Date: Tue, 8 Apr 2003 10:21:45 +0200 
 | Hello,
 | 
 | I would have some details and explanations about the results I get.
 | In fact, I start with a uniform sample between -1 and 1, and then plot its
 | density.
 | My problem is that the density ranges are much more longer than I expected :
 | 
 | samp <- runif(10000,-1,1)
 | plot(density(samp))
 | 
 | Instead of varying between -1 and 1, the density varies between approximaly
 | -1.5 and 1.5

The density is positive in the interval about (-1.3, 1.3) using the
default bandwidth.  Its value is around 0.5.  I guess you should try
to change bandwidth.  Try
best wishes,

Ott

 | Could someone explain me what is happening ? Maybe some arguments for
 | density estimation need to be set ?
 | 
 | Isabelle.
Message-ID: <200304080841.h388fwY10950@punik.econ.au.dk>
In-Reply-To: <488C02265C6AD611BF200002A542182F022B337C@irnts22.ifp.fr> (message from ZABALZA-MEZGHANI Isabelle on Tue, 8 Apr 2003 10:21:45 +0200)