Find the probability density of a new data point using “density” function using matlab?
<p>I have two datasets namely reference dataset and new dataset; All datasets have power and speed for a power curve (Power Vs Speed) of wind turbine. Power is in vertical axis and Speed is in horizontal axis. I want to use my new incoming data points of speed to find the probability of its associated power value using pdf function based on my calculation on reference data (Calculated binning, mean value &amp; std value for old data).</p>

<p>In short, this is the code I have written so far and after that I am clueless or not getting what to do next : </p>

<pre><code>numbin = 30;
Edge = linspace(min(Speed_old),max(Speed_old),numbin);
[h,whichBin] = histcounts(Speed_old,Edge);
mu = Speed_mean_Ref;
sigma = std_ref;
f = exp(-(Edge- mu).^2./(2*sigma^2))./(sigma*sqrt(2*pi));
</code></pre>

<p>After that what should I do for a given a new data point (<code>speed_new</code>),  find the probability density of this data point based on the kernel density estimator (or pdf) and then its associated power value.</p>