Hui Han
2005-Apr-18 23:12 UTC
[R] longer object length, is not a multiple of shorter object length in: kappa * gcounts
Hi, I was using a density estimation function as follows: > est <- KernSmooth::bkde(x3, bandwidth=10) When setting bandwidth less than 5, I got the error "longer object length, is not a multiple of shorter object length in: kappa * gcounts ". I wonder if there is anybody who can explain the error for me? Thanks! Hui
Hui Han
2005-Apr-18 23:19 UTC
[R] Re: longer object length, is not a multiple of shorter object length in: kappa * gcounts
Hi, Another phenomenon is that if I don't sort the data vector x3, I get the same error regardless of the bandwidth value: "longer object length, is not a multiple of shorter object length in: kappa * gcounts ". Thanks in advance for any help you can give me! Hui Hui Han wrote:> Hi, > > I was using a density estimation function as follows: > > est <- KernSmooth::bkde(x3, bandwidth=10) > When setting bandwidth less than 5, I got the error "longer object > length, is not a multiple of shorter object length in: kappa * > gcounts ". > > I wonder if there is anybody who can explain the error for me? > > Thanks! > Hui > >
Liaw, Andy
2005-Apr-19 00:37 UTC
[R] longer object length, is not a multiple of shorter object length in: kappa * gcounts
I suspect you set the bandwidth too small. Consider:> x <- sort(runif(100)) * 100 > min(diff(x))[1] 0.001700642> library(KernSmooth)KernSmooth 2.22 installed Copyright M. P. Wand 1997> dx <- bkde(x, bandwidth=.001)Warning message: longer object length is not a multiple of shorter object length in: kappa * gcounts Andy> From: Hui Han > > Hi, > > I was using a density estimation function as follows: > > est <- KernSmooth::bkde(x3, bandwidth=10) > When setting bandwidth less than 5, I got the error "longer object > length, is not a multiple of shorter object length in: kappa > * gcounts ". > > I wonder if there is anybody who can explain the error for me? > > Thanks! > Hui > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > > >
Hui Han
2005-Apr-19 01:03 UTC
[R] longer object length, is not a multiple of shorter object length in: kappa * gcounts
I see. Thanks, Andy! Hui Liaw, Andy wrote:>I suspect you set the bandwidth too small. Consider: > > > >>x <- sort(runif(100)) * 100 >>min(diff(x)) >> >> >[1] 0.001700642 > > >>library(KernSmooth) >> >> >KernSmooth 2.22 installed >Copyright M. P. Wand 1997 > > >>dx <- bkde(x, bandwidth=.001) >> >> >Warning message: >longer object length > is not a multiple of shorter object length in: kappa * gcounts > >Andy > > > >>From: Hui Han >> >>Hi, >> >>I was using a density estimation function as follows: >> > est <- KernSmooth::bkde(x3, bandwidth=10) >>When setting bandwidth less than 5, I got the error "longer object >>length, is not a multiple of shorter object length in: kappa >>* gcounts ". >> >>I wonder if there is anybody who can explain the error for me? >> >>Thanks! >>Hui >> >>______________________________________________ >>R-help at stat.math.ethz.ch mailing list >>https://stat.ethz.ch/mailman/listinfo/r-help >>PLEASE do read the posting guide! >>http://www.R-project.org/posting-guide.html >> >> >> >> >> > > > >------------------------------------------------------------------------------ >Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. >------------------------------------------------------------------------------ > > > > >
Hi, I have been looking for a method of estimating a parametric model from the output (x, y) from the R function "density". Below is my thought and wonder if it looks OK. Suppose that we build a single gaussian model for each input data point x (x is the mean), the overal model may be a sum of these gaussian models built on each x, i.e. P(y) = \sum_x P(y|x, \sigma), where y is any new data point. Is this right? Any normalization is applied? Thanks in advance for any suggestion that you may offer me! Best regards, Hui