probability- punctual graphs

2 visualizzazioni (ultimi 30 giorni)
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA il 16 Lug 2021
Risposto: Leepakshi il 28 Feb 2025
starting from values of intensity and direction of the wind, I created the graphs relating to the probability of obtaining certain values of intensity and direction of the wind at the same time. I used the bar3 function which creates my instigrams in 3d. is there a function that allows me to calculate the same probability but with a punctual graph? that the numerical values are given back to me.
  2 Commenti
KSSV
KSSV il 16 Lug 2021
You can extract the numbers in the bins and divide with total number.
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA il 16 Lug 2021
I do not understand what you mean

Accedi per commentare.

Risposte (1)

Leepakshi
Leepakshi il 28 Feb 2025
Hey Elisabetta,
To calculate the probability of obtaining certain values of wind intensity and direction without using histograms, you can use kernel density estimation (KDE) or other statistical methods to get a continuous probability density function. In MATLAB, you can use the ksdensity function to perform KDE. Here's a general approach:
  1. Prepare Your Data: Ensure your wind intensity and direction data are in two vectors of the same length.
  2. Use ksdensity: The ksdensity function can be used to estimate the probability density function (PDF) for your data.
Here's a basic example of how you can implement this in MATLAB:
% Sample data for wind intensity and direction
intensity = [/* your intensity data */];
direction = [/* your direction data */];
% Create a grid for evaluation
[intensityGrid, directionGrid] = meshgrid(linspace(min(intensity), max(intensity), 100), ...
linspace(min(direction), max(direction), 100));
% Evaluate the joint probability density function using ksdensity
pdfValues = ksdensity([intensity', direction'], [intensityGrid(:), directionGrid(:)]);
% Reshape the PDF values to match the grid
pdfValues = reshape(pdfValues, size(intensityGrid));
% Plot the result
surf(intensityGrid, directionGrid, pdfValues);
xlabel('Intensity');
ylabel('Direction');
zlabel('Probability Density');
title('Joint Probability Density of Wind Intensity and Direction');
This approach will give you a smooth, continuous representation of the probability densities for wind intensity and direction, allowing you to extract numerical values at any point on the grid.
Hope this helped!

Community Treasure Hunt

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

Start Hunting!

Translated by