probability-density

Matconvnet output of deep network's marix is uniform valued instead of varying values?

扶醉桌前 提交于 2020-02-27 13:05:24
问题 Im trying to achieve a density map from network output of dimension 20x20x1x50. Here 20x20 is the output map and 50 is the batch size. The issue is that the value of output X is equal 0.098 across each output matrix..20x20. There is no gaussian shape like density map but a flat similar valued output map 20x20x1x50. The issue is shown in the figure attached. What am i missing here? The euclidean loss for backpropagation is given as: case {'l2loss'} res=(c-X); n=1; if isempty(dzdy) %forward Y =

Error: operator *: nonconformant arguments (op1 is rxc, op2 is rxc )

核能气质少年 提交于 2020-02-16 05:29:23
问题 I have implemented the following function to estimate Parzen Density of a matrix, parzen.m function [retval] = parzen (matrix, dataPoint, variance) [r c] = size(matrix); A = ones(r, c)*dataPoint; sub = matrix - A; up = sub.^2; dw = 2 * variance; firstPart = 1/(sqrt(2*pi*variance)); retval = firstPart * exp((-1)*(up/dw)); Error >> parzen(train, test, 0.25) error: parzen: operator *: nonconformant arguments (op1 is 1824x8, op2 is 1824x8 ) error: called from parzen at line 3 column 4 >> How can

Estimating the parameters of a custom distribution using mle()

泪湿孤枕 提交于 2020-02-03 04:15:31
问题 I have the following code that I wish to estimate the parameters of a custom distribution. For more details on the distribution. Then using the estimated parameters I want to see if the estimated PDF resembles the distribution of the given the data (it is supposed to match the distribution of the given data). [EDIT]: 'x' now holds a sample of data and not a PDF The main code is: x = [0.0320000000000000 0.0280000000000000 0.0280000000000000 0.0270000000000000 0.0320000000000000 0

Why does this Kernel Density Estimation have values over 1.0?

*爱你&永不变心* 提交于 2020-01-06 04:53:08
问题 I'm trying to analyse the features of the Pima Indians Diabetes Data Set (follow the link to get the dataset) by plotting their probability density distributions. I haven't yet removed invalid 0 data, so the plots sometimes show a bias at the very left. For the most part, the distributions look accurate: I have a problem with the look of the plot for DiabetesPedigree, which shows probabilities over 1.0 (for x ~ between 0.1 and 0.5). As I understand it, the combined probabilities should equal

Smooth line on histograms in gnuplot

余生颓废 提交于 2020-01-05 04:38:10
问题 I want to make a smooth line over histograms. So far I have tried all the smooth functions but I am not able to get the result. For the histograms I am using: plot "file.scatter" u (hist($2,width)):(1.0) smooth freq w boxes notitle and the result is: But when I ask gnuplot to draw a smooth line over these: plot "file.scatter" u (hist($2,width)):(1.0) smooth freq w l notitle I get: I want the line plot to look smooth like a probability density function(of course the values will have to be

Plot normalized uniform mixture

牧云@^-^@ 提交于 2020-01-04 02:15:09
问题 I need to reproduce the normalized density p(x) below, but the code given does not generate a normalized PDF. clc, clear % Create three distribution objects with different parameters pd1 = makedist('Uniform','lower',2,'upper',6); pd2 = makedist('Uniform','lower',2,'upper',4); pd3 = makedist('Uniform','lower',5,'upper',6); % Compute the pdfs x = -1:.01:9; pdf1 = pdf(pd1,x); pdf2 = pdf(pd2,x); pdf3 = pdf(pd3,x); % Sum of uniforms pdf = (pdf1 + pdf2 + pdf3); % Plot the pdfs figure; stairs(x,pdf,

Plot normalized uniform mixture

醉酒当歌 提交于 2020-01-04 02:15:08
问题 I need to reproduce the normalized density p(x) below, but the code given does not generate a normalized PDF. clc, clear % Create three distribution objects with different parameters pd1 = makedist('Uniform','lower',2,'upper',6); pd2 = makedist('Uniform','lower',2,'upper',4); pd3 = makedist('Uniform','lower',5,'upper',6); % Compute the pdfs x = -1:.01:9; pdf1 = pdf(pd1,x); pdf2 = pdf(pd2,x); pdf3 = pdf(pd3,x); % Sum of uniforms pdf = (pdf1 + pdf2 + pdf3); % Plot the pdfs figure; stairs(x,pdf,

Calculating a 2D joint probability distribution

笑着哭i 提交于 2020-01-02 07:44:11
问题 I have many points inside a square. I want to partition the square in many small rectangles and check how many points fall in each rectangle, i.e. I want to compute the joint probability distribution of the points. I am reporting a couple of common sense approaches, using loops and not very efficient: % Data N = 1e5; % number of points xy = rand(N, 2); % coordinates of points xy(randi(2*N, 100, 1)) = 0; % add some points on one side xy(randi(2*N, 100, 1)) = 1; % add some points on the other

calculate area of overlapping density plot by ggplot using R

吃可爱长大的小学妹 提交于 2019-12-30 09:57:10
问题 How can I get the area under overlapping density curves? How can I solve the problem with R? (There is a solution for python here: Calculate overlap area of two functions ) set.seed(1234) df <- data.frame( sex=factor(rep(c("F", "M"), each=200)), weight=round(c(rnorm(200, mean=55, sd=5), rnorm(200, mean=65, sd=5))) ) (Source: http://www.sthda.com/english/wiki/ggplot2-density-plot-quick-start-guide-r-software-and-data-visualization ) ggplot(df, aes(x=weight, color=sex, fill=sex)) + geom_density

Random sampling from data quantiles, while preserving original probability distribution

假装没事ソ 提交于 2019-12-25 14:23:32
问题 Following my previous question titled: "Random sampling from a dataset, while preserving original probability distribution", I want to sample from a set of >2000 numbers, gathered from measurement. I want to perform several tests (I take maximum of 10 samples in each tests), while preserving probability distribution in overall testiong process, and in each test (as much as possible). Now, instead of completely random sampling, I partition data into 5 quantiles, and in 10 tests, I sample 2