Skip to content

Performing non-parametric Parzen Window density estimation with a Gaussian kernel, implementing the method both from scratch and using built-in functions, and compares the results across various window widths and sample sizes.

Notifications You must be signed in to change notification settings

fardinabbasi/ParzenWindow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ParzenWindow

Performing non-parametric Parzen Window estimation on the 'ted_main.csv' dataset, both from scratch and using built-in functions. The duration column of the dataset is extracted to estimate its distribution using Parzen Window with Gaussian kernel.

From Scratch

Here is the implementation of the Parzen Window with Gaussian kernel from scratch.

def ParzenWindow_est(x,x_samples,h):
	k=0
	for xi in x_samples:
		k += norm.pdf((x-xi)/h,loc=0,scale=1)
	p=k/(len(x_samples)*h)
	return p

Below are the results of the distribution estimation for various window widths (h).

h 10 [20, 50, 100]
Estimation

Window width (h) is also known as the smoothing factor. As you can observe, increasing h leads to a smoother distribution.

With Built-in Functions

from sklearn.neighbors import KernelDensity

The table below displays the sample set sizes, ranging from 250 samples to the entire dataset, with increments of 250.

10% of the Dataset 20% of the Dataset 29% of the Dataset 39% of the Dataset 49% of the Dataset
59% of the Dataset 69% of the Dataset 78% of the Dataset 88% of the Dataset 98% of the Dataset

It can be inferred that the larger the sample set, the smoother the distribution becomes, eventually converging to the actual distribution.

Course Description

About

Performing non-parametric Parzen Window density estimation with a Gaussian kernel, implementing the method both from scratch and using built-in functions, and compares the results across various window widths and sample sizes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published