Displaying 20 results from an estimated 9000 matches similar to: "density estimation with weighted sample"
2004 May 29
1
Rhelp: Need help interpreting plots in spatstat
Hello everybody--
I have been playing with my data in spatstat, and what I'd like to
present is a basic exploratory spatial analysis. I have used the
following code, using a ppp.object called tsdspoints. The code
develops the simulations and the envelopes I want, but I don't
understand my first plot here, the [tsds.ghat.short$r,
tsds.ghat.short$raw]...I cobbled together this code
2009 Mar 11
3
chisq.test: decreasing p-value
A Likert scale may have produced counts of answers per category.
According to theory I may expect equality over the categories. A
statistical test shall reveal the actual equality in my sample.
When applying a chi square test with increasing number of repetitions
(simulate.p.value) over a fixed sample, the p-value decreases
dramatically (looks as if converge to zero).
(1) Why?
(2) (If
2004 Dec 22
0
weighted kernel density estimation
Dear wizaRds,
I use the MASS::kde2d function to estimate density of the two first
principal components. I do that to have a graphic visualisation of a
"group structure" in my dataset. So far, no problem.
But i would like to estimate that density using weights according to the
COS?? values that tells me if my observation is well represented on the
factorial plan 1-2. I would like to
2006 Mar 15
2
comparing AIC values of models with transformed, untransformed, and weighted variables
Hi there, I have a question regarding model comparisons that seems
simple enough but to which I cannot find an answer. I am interested in
developing a predictive model relating some measure of a tree's stem to
the total leaf area (TLA) of the tree. Predictor variables might
include, for example, the total cross-sectional area of the tree
(commonly referred to as basal area) or the amount
2006 Jun 14
1
Estimate region of highest probabilty density
Estimate region of highest probabilty density
Dear R-community
I have data consisting of x and y. To each pair (x,y) a z value (weight) is assigned. With kde2d I can estimate the densities on a regular grid and based on this make a contour plot (not considering the z-values). According to an earlier post in the list I adjusted the kde2d to kde2d.weighted (see code below) to estimate the
2006 Apr 23
3
bivariate weighted kernel density estimator
Is there code for bivariate kernel density estimation?
For bivariate kernels there is
kde2d in MASS
kde2d.g in GRASS
KernSur in GenKern
(list probably incomplete)
but none of them seems to accept a weight parameter
(like density does since R 2.2.0)
--
Erich Neuwirth, University of Vienna
Faculty of Computer Science
Computer Supported Didactics Working Group
Visit our SunSITE at
2017 Nov 07
2
Fitdistrplus and Custom Probability Density
Dear All,
Apologies for not providing a reproducible example, but if I could, then I
would be able to answer myself my question.
Essentially, I am trying to fit a very complicated custom probability
distribution to some data.
Fitdistrplus does in principle everything which I need, but if require me
to specify not only the density function d, but also the cumulative p and
and inverse cumulative
2010 Jul 19
1
Hurst Exponent Estimation
Dear All,
I am a novice when it comes to time-series analysis and at the moment I
am actually interested in calculating the Hurst exponent of a time
series.
This question has already been asked quite some time ago
http://bit.ly/98dZsi
and I trust some progress has been made ever since.
I was able to find some functions in the packages
http://cran.r-project.org/web/packages/Rwave/index.html
2017 Nov 07
0
Fitdistrplus and Custom Probability Density
Why not define your own functions based on d?
e.g.
myCumDist <- function(x) { integrate(d, lower=-Inf, upper=x)$value }
myQuantile <- function(x) { uniroot(f=function(y) { h(y) - x },
interval=c(-5,5)) } # limits -5,5 should be replaced by your own which
might require some fiddling
e.g.
d <- function(x) { exp(-x^2/2)/(sqrt(2*pi)) } # just an example for you to
test with; use your own
2009 Apr 28
3
truehist and density plots
Hi,
I wanted to plot the histogram of a vector and then, plot the density function of subsets of the vector on the histogram. So I use truehist in MASS package and lines(density) as follows:
length(b) = 1000
truehist(b)
lines(density(b[1:100]))
however the density plot of the first 100 points exceeds the max of y axis (see attached). how is it possible to make a graphics so that the density plot
2006 Apr 06
4
weighted kernel density estimate
Dear R-users,
I intend to do a spatial analysis on the genetic structuring within a
population. For this I had thought to prepare a kernel density estimate
map showing the spatial distribution of individuals, while incorporating
the genetic distances among individuals. I have a dataset of locations
of N unique individuals (XY-coordinates) and an NxN matrix with the
genetic distances given as a
2011 Aug 02
1
density plot for weighted data
I'm trying to create a density plot using census data, where the
weights don't sum to 1.
>plot(density(oh$FINCP,weights=oh$PWGTP))
Warning message:
In density.default(oh$FINCP, weights = oh$PWGTP) :
sum(weights) != 1 -- will not get true density
How would I go about doing this?
Thanks!
2011 Jan 12
0
Weighted Likelihood Estimation of NIG Dist.
Hi All,
I've put together some script which gives me the parameters of a modified
NIG distribution. Now I'd like to include a weighted vector within the
maximization function. The code below gives me parameter estimates which are
implicitly equally weighted.
nig.par.fit <- try(optim(vega, negllh, hessian = se, pdf = density.nig,
tmp.data = data, transf =
2004 Nov 08
2
Nonlinear weighted least squares estimation
Hi there,
I'm trying to fit a growth curve to some data and need to use a weighted least squares estimator to account for heteroscedasticity in the data. A weights argument is available in nls that would appear to be appropriate for this purpose, but it is listed as 'not yet implemented'. Is there another package which could implement this procedure?
Regards,
Robert Brown
2010 Nov 19
1
Sampling from multi-dimensional kernel density estimation
Hi,
I'd like to use a three-dimensional dataset to build a kernel density and
then sample from the distribution.
I already used the npudens function in the np package to estimate the
density and plot it:
fit<-npudens(~x+y+z)
plot(fit)
It takes some time but appears to work well.
How can I use this to evaluate the fitted function at a certain point, e.g.
(x=1, y=1, z=1)?
2007 May 08
5
Weighted least squares
Dear all,
I'm struggling with weighted least squares, where something that I had
assumed to be true appears not to be the case. Take the following
data set as an example:
df <- data.frame(x = runif(100, 0, 100))
df$y <- df$x + 1 + rnorm(100, sd=15)
I had expected that:
summary(lm(y ~ x, data=df, weights=rep(2, 100)))
summary(lm(y ~ x, data=rbind(df,df)))
would be equivalent, but
2012 Feb 15
1
Parameter estimation of gamma distribution
Hi,
I am trying to estiamte parameters for gamma distribution using mle for
below data using fitdist & fitdistr functions which are from "fitdistrplus"
& "MASS"packages . I am getting errors for both functions. Can someone
please let me know how to overcome this issue??
data
y1<-
c(256656, 76376, 6467673, 46446, 3400, 3100, 5760, 4562, 8000, 512, 4545,
4562,
2002 Apr 05
2
weighted 2 or 3 parameter weibull estimation?
I've figured out how to use optim (barely) to estimate 2 parameter =
weibull distributions. I can't get over how easy this is. What I need to =
do is use a weight in the observations.....
For example,=20
the tree diameters and weights are are=20
4.70 , 100
6.00, 98
7.10, 75.0
8.10, 86.3
8.60, 80.456
8.90, 20.5
9.50, 16.6
11.40, 12.657
11.80, 12.47
14.50,
2008 Jan 16
1
Probability weights with density estimation
I am a physician examining an NHANES dataset available at the NCHS
website:
http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/demo_d.xpt
http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/hdl_d.xpt
http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/tchol_d.xpt
Thank you to the R authors and the foreign package authors in
particular. Importing from the SAS export
2011 Mar 02
2
Creating a weighted sample - Help
Hi
I'm new to R and most things I want to do I can do but I'm stuck on how to
weight a sample. I have had a look through the post but I can't find
anything that addresses my specific problem. I am wanting to scale up a
sample which has been taken based on a single variable (perf) which has 4
attributes H,I, J and K. The make up of the sample is shown below:-
Perf Factored