Message-ID: <200304080841.h388fwY10950@punik.econ.au.dk>
Date: 2003-04-08T08:41:58Z
From: Ott Toomet
Subject: density ranges for uniform law
In-Reply-To: <488C02265C6AD611BF200002A542182F022B337C@irnts22.ifp.fr> (message from ZABALZA-MEZGHANI Isabelle on Tue, 8 Apr 2003 10:21:45 +0200)
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
> plot(density(samp, bw=0.1))
> lines(density(samp, bw=0.03), col=2)
> lines(density(samp, bw=0.01), col=3)
best wishes,
Ott
| Could someone explain me what is happening ? Maybe some arguments for
| density estimation need to be set ?
|
| Isabelle.