Speeding up the ksdensity function
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Anjali
el 13 de Jun. de 2016
Respondida: the cyclist
el 13 de Jun. de 2016
Hi!
I need to calculate a kernal density estimate on a [81000*1] vector of random variables. I need the density estimates on the exact data points themselves. Hence my support is also the same [81000*1] vector of input random variables. When I use the ksdensiy function as,
[f,~] = ksdensity(data,data);
% length(data)=81000
it seems to take forever to get the density estimate. Is there a faster method I could use for this?
Thanks.
0 comentarios
Respuesta aceptada
the cyclist
el 13 de Jun. de 2016
I don't know the algorithmic complexity of the kernel density function, but I know that one needs to do function evaluations at not just the input points, but "nearby" points as well. I can imagine that things blow up fast.
I can imagine it might be faster to use ksdensity at only, say, 1/10 of the points, and then interpolate (using, e.g. interp1) at the points in between. I don't know how much accuracy you would lose, though.
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!