Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How I accept generated [x,y] samples that fall into a probability density function or an equivalent area?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I generate samples in 2-d space, i.e. x,y coordinates. I have a normal pdf and I want to keep/accept the samples that fall inside the pdf. Let as denote this area W. Is there a specific command for this? How can I implement it? I found in Matlab inpolygon command , but it works only for polygonal region and not on curves, such as pdf .
2 comentarios
Star Strider
el 14 de Oct. de 2017
The normal distribution extends from -Inf to +Inf. All the real values you create are by definition ‘inside the PDF’.
Respuestas (1)
Image Analyst
el 14 de Oct. de 2017
I'm not sure you mean "fall inside the pdf" since, of course, all values generated must come from the PDF. I think you mean "fall inside the area", presumably one defined by some limits on x and y
% Get x and y somehow
if x < x1 || x > x2 || y < y1 || y > y2
% Coordinate is out of bounds. Skip this one.
continue;
end
% Else do something with it.
2 comentarios
DIMITRIS GEORGIADIS
el 15 de Oct. de 2017
Editada: DIMITRIS GEORGIADIS
el 15 de Oct. de 2017
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!