Description Usage Arguments Details Value Warning Note Author(s) References See Also Examples
deamerRO performs a deconvolution estimation of the density of a noisy variable ('y') under
the hypothesis of an unknown density of the noise using an auxiliary sample of replicate observations
("RO" for "replicate observations"). Therefore deamerRO requires two samples: one with single noisy observations and
another with replicate noisy observations (see details).
1 |
y |
Numeric. The vector of noisy observations. |
replicates |
Numeric. A 2-column matrix or 2-column numeric data-frame.
Contains one replicate observation in each row.
The number of rows does not need to match |
grid.length |
Numeric. Optional. The number of points of the grid the estimation is performed on. Defaults to 100. |
from |
Numeric. Optional. The lower bound of the grid the estimation is performed on. Defaults to |
to |
Numeric. Optional. The upper bound of the grid the estimation is performed on. Defaults to |
na.rm |
Logical. Optional. If |
The model is defined as y = x + e, where x and e both have unknown densities.
Replicate observations are defined as
z_1 = x + e_1
z_2 = x + e_2
The main underlying hypotheses are:
Homoscedasticity of the errors.
The errors e_1 and e_2 are independent.
The samples are independent.
Errors are symmetric, 0-mean variables.
Errors e, e_1 and e_2 have the same distribution.
an object of class 'deamer'
deamerRO is not implemented for heteroscedastic errors.
Unlike deamerKE and deamerSE, deamerRO assumes the errors are centered around 0.
deamerRO only allows for 2 replicates per observation for the moment (argument 'replicates' is a 2-column matrix or data-frame).
Future versions should allow using more than 2.
Julien Stirnemann <j.stirnemann@gmail.com>
Stirnemann JJ, Comte F, Samson A. Density estimation of a biomedical variable
subject to measurement error using an auxiliary set of replicate observations.
Statistics in medicine. 2012 May 17 [Epub ahead of print]
Comte F, Samson A, Stirnemann J. Deconvolution estimation of onset of pregnancy
with replicate observations [Internet]. 2011 [cited 2011 Oct 25].
Available from: http://hal.archives-ouvertes.fr/hal-00588235_v2/
deamer,
deamerKE,
deamerSE,
deamer-class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | set.seed(123)
n=1000 #sample size of single noisy observtions
M=500 #sample size of replicate observations
rff=function(x){
u=rbinom(x, 1, 0.5)
X=u*rnorm(x, -2, 1)+(1-u)*rnorm(x,2,1)
return(X)
}
x <- rff(n) #a mixed gaussian distribution
# true density function:
f.true=function(x) (0.5/(sqrt(2*pi)))*(exp(-0.5*(x+2)^2) + exp(-0.5*(x-2)^2))
e <- rnorm(n,0,0.5)
y <- x + e
x. <- rff(M)
e1 <- rnorm(M,0,0.5)
e2 <- rnorm(M,0,0.5)
rep<-data.frame(y1=x.+e1, y2=x.+e2)
est<-deamerRO(y, replicates=rep)
est
plot(est, lwd=2)
curve(f.true(x), add=TRUE, lwd=2, lty=3)
lines(density(y), lwd=2, lty=4)
legend("topleft", bty="n", lty=c(1,3,4), lwd=2, legend=c("deamerRO", "true density",
"kernel density\nof noisy obs."))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.