Fit Kernel Distribution to Data with Boundary Condition
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Michael König
 el 8 de Mzo. de 2021
  
    
    
    
    
    Respondida: the cyclist
      
      
 el 8 de Mzo. de 2021
            I need to fit a distribution to a data set I created and decided on a kernel density distribution. For this I use 
    fitdist(data,'Kernel','Kernel','epanechnikov');
My data set has only values greater than zero. Unfortunately, my current implementation of the kernel fit ignores that boundary condition. From literature and also this great youtube video I know that it is possible to create a kernel distribution that respects such a boundary condition by using a mirroring method.
Is there a possibility within the fitdist function or by some other method to easily implement this boundary condition? 
0 comentarios
Respuesta aceptada
  the cyclist
      
      
 el 8 de Mzo. de 2021
        I would do this by using the ksdensity function. Specifically, see this section about using the reflection boundary condition.
Here is an example, distilled from that documentation:
rng('default') % For reproducibility
% Create some data
pd = makedist('HalfNormal','mu',0,'sigma',1);
x = random(pd,50,1);
pts = linspace(0,5,1000); % points to evaluate the estimator
[f,xi] = ksdensity(x,pts,'Support','positive','BoundaryCorrection','reflection');
figure
hold on
plot(x,zeros(numel(x),1),'.')
plot(xi,f)
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!
