Displaying 10 results from an estimated 10 matches for "nrd0".
Did you mean:
nbd0
2011 Apr 03
3
kernel density plot
I am using the following commands for plotting kernel density for three
kinds of crops
density(s22$Net_income_Total.1, bw="nrd0",adjust=1,
kernel=c("gaussian"))->t
plot(t, xlim=c(-30000,40000), main="Net Income Distribution", axes=F,
ylim=c(0,0.00035). xlab="Value in Rupees")
par(new=T)
density(s33$Net_income_Total.1, bw="nrd0",adjust=1,
kernel=c("gaussian"))->u
p...
2018 Feb 20
0
Unwanted behaviour of bw.nrd: sometimes, zero is returned as a valid bandwidth
Dear all,
Sorry if I am posting to the wrong place, but I could not find the link for
registration on the bug tracker, that?s why I am writing here.
I think there is inconsistency between two R functions from the stats
package, bw.nrd0 and bw.nrd.
Consider the following vector:
D <- c(0, 1, 1, 1, 1)
bw.nrd(D) returns zero bandwidth for this object even without a warning.
Considering the fact that in most cases, one divides something by the
bandwidth, it is highly undesirable that these function return zero
bandwidth without...
2008 Feb 07
0
Help w/ density() usage
...to Bhattacharya, 1967): analysis of length-frequency distribution of fish larvae to id cohorts and later estimate growh rates!
I've trouble with the 1st step: using kernel density estimation (KDE) function to examine size-freq distributions (variable sl):
> density(sl[dofyr==139],bw="nrd0") (dofyr means day of year and refers to a particular sampling date)
> kd139
Call:
density.default(x = sl[dofyr == 139], bw = "nrd0")
Data: sl[dofyr == 139] (55 obs.); Bandwidth 'bw' = 0.4234
x y
Min. : 4.870 Min. :...
2009 Aug 22
1
kernel density estimates
...ulated the value of q ( a certain fn in the sample observations), and thus I was left with 1000 values of q and I don't know the distribution of q.
Hence, I used the given code for kernel density estimation to estimate the density of q
>options(scipen=4)
> d <- density(q, bw = "nrd0",kernel="gaussian")
> d
> plot(d)
But what I'm really intersed in is to estimate the probability that q is greater than a certain value , for ex.,P(q>11000), using the kernel density estimate I obtained.
Could u help me with a fn or some document to do this?
Thank u...
2009 Aug 19
1
Fw: Hist & kernel density estimates
...pen=4)
> ylim<-range(dens$y)
> h<-hist(q,breaks="scott",freq=FALSE,probability=TRUE,
+? right=FALSE,xlim=c(9000,16000),ylim=ylim,main="Histogram of q(scott)")
> lines(dens)
>box()
?
For the kernel estimate>options(scipen=4)
> d <- density(q, bw = "nrd0",kernel="gaussian")
> d
> plot(d)
?
In fact the variable q is a vector of 1000 simulated values; that is I generated 1000 samples from the pareto distribution, from each sample I calculated the value of q ( a certain fn in the sample observations), and thus I was left with 1000...
2012 Jul 26
2
density
...mination. Below are the different ways in R on deciding the bandwidth.
Can anyone give an idea on which ones are preferred.
Also, how can I take a look at the source code for the density function?
Thank you very much.
Hannah
x <- rnorm(1000)
> bw.nrd(x)
[1] 0.2688588
> bw.nrd0(x)
[1] 0.2282763
> bw.ucv(x)
[1] 0.2112366
> bw.bcv(x)
[1] 0.2890085
Warning message:
In bw.bcv(x) : minimum occurred at one end of the range
> bw.SJ(x)
[1] 0.2716242
> density(x, give.Rkern=T, kernel="gaussian")
[1] 0.2820948
> density(x, kernel="gaussian&...
2012 Mar 21
1
enableJIT() and internal R completions (was: [ESS-bugs] ess-mode 12.03; ess hangs emacs)
Hello,
JIT compiler interferes with internal R completions:
compiler::enableJIT(2)
utils:::functionArgs("density", '')
gives:
utils:::functionArgs("density", '')
Note: no visible global function definition for 'bw.nrd0'
Note: no visible global function definition for 'bw.nrd'
Note: no visible global function definition for 'bw.ucv'
Note: no visible global function definition for 'bw.bcv'
Note: no visible global function definition for 'bw.SJ'
Note: no visible global functi...
2003 Mar 01
2
density(), with argument of length 1 (PR#2593)
The following is from version 1.6.2 of R under Windows,
or 1.6.1 under Mac OSX/X11
> density(1)
Error in if (!(lo <- min(hi, IQR(x)/1.34))) (lo <- hi) || (lo <- abs(x[1])) || :
missing value where logical needed
I am not sure how this should be handled. I encountered it
in connection with densityplot(). In that connection, it
might be enough to modify density() so that it
2011 Jan 20
0
Bandwidth - Kernel Density Estimation
...41,0.97,
0.82,0.11,0.53,0.80,0.71,0.31,0.70,0.00,0.90,0.88,0.15,0.49,0.54,0.89,0.07,0.09,0.34,
0.20,0.73,0.37,0.94,0.49,0.40,0.55,0.68,0.89,0.00,0.42,0.94,0.06,0.53,0.46,0.11,0.96,
0.41,0.69)
I need to find out the bandwidth and I have two ways of doing it
as
# as per the stats package
bw1 = bw.nrd0(recovery_rates) # which gives me bw1 = 0.1050780
# as per the KernSmooth package
bw2 = dpik(recovery_rates) # which gives bw2 = 0.1027932
I am bit confused which bandwidth is to be used. Is it that "statistics package" deal with univariate data whil...
2008 Jul 29
2
Help interpreting density().
I issue the following:
> d <- density(rnorm(1000))
> d
and get:
Call:
density.default(x = rnorm(1000))
Data: rnorm(1000) (1000 obs.); Bandwidth 'bw' = 0.2235
x y
Min. :-3.5157 Min. :2.416e-05
1st Qu.:-1.6892 1st Qu.:1.129e-02
Median : 0.1373 Median :7.267e-02
Mean : 0.1373 Mean :1.367e-01
3rd Qu.: 1.9639