Re: [R] Dequantizing

From: Greg Snow <>
Date: Thu, 20 Nov 2008 10:21:23 -0700

The logspline package has tools for estimating a density function for interval censored data (the old methods), you could use those to estimate the density of your data, then compare that density to the theoretical density.

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare

> -----Original Message-----
> From: [mailto:r-help-bounces_at_r-
>] On Behalf Of Stavros Macrakis
> Sent: Thursday, November 20, 2008 8:43 AM
> To:
> Subject: [R] Dequantizing
> I have some data measured with a coarsely-quantized clock. Let's say
> the real data are
> q<- sort(rexp(100,.5))
> The quantized form is floor(q), so a simple quantile plot of one
> against the other can be calculated using:
> plot(q,type="l"); points(floor(q),col="red")
> which of course shows the characteristic stair-step. I would like to
> smooth the quantized form back into an approximation of the underlying
> data.
> The simplest approach I can think of adds a uniform random variable of
> the size of the quantization:
> plot(q,type="l"); points(floor(q),col="red");
> points(floor(q)+runif(100,0,1),col="blue")
> This gives pretty good results for uniform distributions, but less
> good for others (like exponential). Is there a better
> interpolation/smoothing function for cases like this, either Monte
> Carlo as above or deterministic?
> Thanks,
> -s
> ______________________________________________
> mailing list
> PLEASE do read the posting guide
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.
Received on Thu 20 Nov 2008 - 17:24:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 20 Nov 2008 - 17:30:27 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive