Closed mobeets closed 8 years ago
the problem is that once we have a density estimate, we want the conditional density.
sampling from:
Sampling from a kernel density estimate There are times when one wants to draw a random sample from the estimated distribution. This is easy with kernel density estimates, because each kernel is itself a probability density, generally a very tractable one. The general pattern goes as follows. Suppose the kernel is Gaussian, that we have scalar observations x1, x2, . . . xn, and the selected bandwidth is h. Then we pick an integer uniformly at random from 1 to n, and invoke rnorm(1,x[i],h). 4 Using a different kernel, we’d just need to use the random number generator function for the corresponding distribution.
src: http://www.stat.cmu.edu/~cshalizi/350/lectures/28/lecture-28.pdf also: http://stats.stackexchange.com/questions/43674/simple-sampling-method-for-a-kernel-density-estimator
currently reading peter hall paper on conditional kernel density estimation: "Cross-Validation and the Estimation of Conditional Probability Densities"
and:
also: https://scholar.google.com/scholar?hl=en&q=conditional+kernel+density&btnG=&as_sdt=1%2C44&as_sdtp=
(L, by the way, is just another kernel, and they're assuming Y is univariate.)
So m is just an estimate of p(X) (the marginal), and f(X,Y) is the joint. the conditional p(y|X=x) is joint over marginal. so estimating the conditional distribution is just made up estimating those two components.
note, however, that this method is biased for predicting the conditional mean, so there's a two-step estimation procedure given in "Estimating and Visualizing Conditional Densities"
basically for a given X=x, you estimate E[Y | X=x] and then do the above conditional distribution kernel estimation on the zero-mean Ys: Y_i - E[Y | X=x]
and the Hall paper gives a loss function to use for doing cross-validation to pick the bandwidth parameter
(another paper mentions the conditional mean step being unnecessary in their case.)
actually, not gonna do this anymore, because from #112 i can see that actually, things look very gaussian once you condition on thetaGrp
instead of fitting multivariate normals, fit some sort of nonparametric density estimator
we want to do this to handle to skew for some of the distributions