gaussian

Plot a contour of multivariate normal PDF of a given MVN in MATLAB?

家住魔仙堡 提交于 2019-12-10 02:22:28
问题 I have a bivariate gaussian I defined as follow: I=[1 0;0 1]; mu=[0,0]; sigma=0.5*I; beta = mvnrnd(mu,sigma,100); %100x2 matrix where each column vector is a variable. now I want to plot a contour of the pdf of the above matrix. What I did: Z = mvnpdf(beta,mu,sigma); %100x1 pdf matrix Now I want to plot a contour of the bivariate gaussian beta. I know I should use the command contour but this one require Z to be a square matrix. how do I solve this? I am very confused and not sure how to plot

MATLAB code for a lot of Gaussian Mixture Model

允我心安 提交于 2019-12-09 22:19:47
问题 I have applied gaussmix function in voicebox MATLAB tools to calculate GMM. However, the code gives me error when I run it for 512 GMM components. No_of_Clusters = 512; No_of_Iterations = 10; [m_ubm1,v_ubm1,w_ubm1]=gaussmix(feature,[],No_of_Iterations,No_of_Clusters); Error using * Inner matrix dimensions must agree. Error in gaussmix (line 256) pk=px*wt; % pk(k,1) effective number of data points for each mixture (could be zero due to underflow) I need 1024 or 2048 Mixtures for Universal

Looking for C/C++ library calculating max of Gaussian curve using discrete values

这一生的挚爱 提交于 2019-12-09 07:56:58
问题 I have some discrete values and assumption, that these values lie on a Gaussian curve. There should be an algorithm for max-calculation using only 3 discrete values. Do you know any library or code in C/C++ implementing this calculation? Thank you! P.S.: The original task is auto-focus implementation. I move a (microscope) camera and capture the pictures in different positions. The position having most different colors should have best focus. EDIT This was long time ago :-( I'just wanted to

Why Gaussian radial basis function maps the examples into an infinite-dimensional space?

瘦欲@ 提交于 2019-12-09 05:04:22
问题 I've just run through the Wikipedia page about SVMs, and this line caught my eyes: "If the kernel used is a Gaussian radial basis function, the corresponding feature space is a Hilbert space of infinite dimensions." http://en.wikipedia.org/wiki/Support_vector_machine#Nonlinear_classification In my understanding, if I apply Gaussian kernel in SVM, the resulting feature space will be m -dimensional (where m is the number of training samples), as you choose your landmarks to be your training

Classify using GMM with MATLAB

喜你入骨 提交于 2019-12-08 10:42:54
问题 I want to perform classification of two classes using Gaussian Mixture Models with MATLAB. I doing training by creating two models with the function gmdistribution.fit NComponents = 1; for class=1:2 model(class).obj = gmdistribution.fit(trainData(class).feature,NComponents,'Regularize',.1); end Then, given test data points, I want to know how to classify them. What I am doing now is to obtain the posterior probability for each point in each model: vectorClasses = zeros(1,2); for class=1:2 Pos

Gaussian distributed random numbers in OpenCL

南楼画角 提交于 2019-12-08 09:25:36
问题 I am running a computational expensive task on the GPU using OpenCL. This task requires many random numbers generated within each worker. Some of those random numbers are supposed to be uniformly generated within a certain interval, but some others have to be gaussian distributed around a (changing) value. Is there any library for this? If not, what's an easy way to implement such a thing? So far I have been creating the random numbers in python and have them passed to OpenCL. However the

Image blurring using gaussian low pass filter

丶灬走出姿态 提交于 2019-12-08 08:45:04
问题 I'm trying to blur a grayscale image using Gaussian low pass filter( 5*5 kernal).I tried the following code. I = imread('Lena.png'); G = fspecial('gaussian',[5 5],2); Ig = imfilter(I,G,'same'); imshow(Ig); But I'm getting an error in file 'meshgrid.m' as follows. Error: File: meshgrid.m Line: 1 Column: 5 The input character is not valid in MATLAB statements or expressions. Error in fspecial (line 145) [x,y] = meshgrid(-siz(2):siz(2),-siz(1):siz(1)); Error in Untitled2 (line 2) G = fspecial(

Python: reduced row echelon form (mod p) of a very large matrix

风流意气都作罢 提交于 2019-12-08 08:10:02
问题 I want to find find a reduced a row echelon form (in field F_q) of a big matrix. I tried the following code. Although I used gmpy2 library to speed up, the program was still out of memory. because my input matrix is very large (100 x 2^15) and p is also very large (|p|=256 bits). Can someone suggest how to reduce the complexity of this alg. Thank you def invmodp(a, p): return gmpy2.invert(a,p) def division_mod(a, b, p): #a/b mod p invert = invmodp(b, p) return (a * invert) %p def row_echelon

Gaussian blur that handles alpha transparency

余生长醉 提交于 2019-12-08 07:31:16
问题 I have been trying to implement an algorithm in C# for a gaussian blur that takes care of transparency. I tried the following two implementations, and each seems to give me different type of results. But neither takes into account the alpha channel. http://code.google.com/p/imagelibrary/downloads/detail?name=ImageLibrary-source-1_2_4.zip&can=2&q= http://www.smokycogs.com/blog/image-processing-in-c-sharp-smoothing-using-convolution/ My test image has a simple circle on a transparent background

Gaussian Basis Function

♀尐吖头ヾ 提交于 2019-12-08 04:43:25
问题 Can you please tell me how can I model a Gaussian Basis Function in a 2 Dimensional Space in order to obtain a scalar output? I know how to apply this with a scalar input, but I don't understand how should I apply it to a 2 dimensional vector input. I've seen many variations of this that I am confused. 回答1: To sample from a multivariate normal distribution, use the MVNRND function from the Statistics Toolbox. Example: MU = [2 3]; %# mean COV = [1 1.5; 1.5 3]; %# covariance (can be isotropic