# probability distribution function from datra

8 visualizzazioni (ultimi 30 giorni)
george veropoulos il 5 Lug 2024
Hi
i have a function Z(h) h1<h<h2 how i cant find a pdf (probability distribution finction ) function for Z
The variable h is unifrormly distributred in range [ h1 h1 ]
thank
George
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
george veropoulos il 8 Lug 2024
Spostato: Star Strider il 13 Lug 2024
i find a analytical solution of pdf !
George

Accedi per commentare.

### Risposta accettata

george veropoulos il 8 Ago 2024
thank you
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Più risposte (1)

Shantanu Dixit il 8 Ago 2024
Hi George,
You can estimate the probability density function (PDF) using the 'ksdensity' function in MATLAB. This function can be used for kernel density estimation, allowing to estimate PDF from the sample of data.
Here's a brief example of how 'ksdensity' can be used to estimate the PDF of function 'Z(h)' where h is uniformly distributed in (h1,h2).
h1 = 0;
h2 = 1;
Z = @(h) h.^2; %% Example function
numSamples = 1e6;
h_samples = h1 + (h2 - h1) * rand(numSamples, 1);
Z_samples = Z(h_samples);
[f, xi] = ksdensity(Z_samples, 'Function', 'pdf');
figure;
plot(xi, f, 'LineWidth', 2);
title('Estimated PDF of Z(h) using Kernel Density Estimation');
xlabel('Z');
ylabel('Probability Density');
grid on;
Refer to the below MathWorks documentation for more information regarding 'ksdensity' function:
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Statistics and Machine Learning Toolbox in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by