gaussian

Computationally simple pseudo-Gaussian distribution with varying mean and standard deviation?

做~自己de王妃 提交于 2019-12-08 01:48:39
问题 This picture from Wikipedia has a nice example of the sort of functions I'd ideally like to generate: Right now I'm using the Irwin-Hall Distribution, which is more or less a polynomial approximation of the Gaussian distribution...basically, you use uniform random number generator and iterate it x times, and take the average. The more iterations, the more like a Gaussian Distribution it is. It's pretty nice; however I'd like to be able to have one where I can vary the mean. For example, let's

How can I fit multiple Gaussian curved to mass spectrometry data in Python?

家住魔仙堡 提交于 2019-12-08 01:48:34
问题 I would like to fit multiple Gaussian curves to Mass spectrometry data in Python. Right now I'm fitting the data one Gaussian at a time -- literally one range at a time. Is there a more streamlined way to do this? Is there a way I can run the data through a loop to plot a Gaussian at each peak? I'm guessing there's gotta be a better way, but I've combed through the internet. My graph for two Gaussians is shown below. My example data can be found at: http://txt.do/dooxv And here's my current

How to choose Gaussian basis functions hyperparameters for linear regression?

↘锁芯ラ 提交于 2019-12-08 01:26:28
问题 I'm quite new in machine learning environment, and I'm trying to understand properly some basis concept. My problem is the following: I have a set of data observation and the corresponding target values { x , t }. I'm trying to train a function with this data in order to predict the value of unobserved data and I'm trying to achieve this by using the maximum posterior (MAP) technique (and so Bayesian approach) with Gaussian basis function of the form: \{Phi}Gaussian_{j}(x)=exp((x−μ_{j})^2/2

Accessing negative pixel values OpenCV

戏子无情 提交于 2019-12-08 00:53:32
问题 I am attempting to perform a zero-crossing edge detection on an image in OpenCV. I blur and use the cvLaplace() then scale it from (0, max). My question is: How can I access the pixel values in that image in such a way as to correctly identify negative values? Using the function provided by OpenCV (cvPtr2D) returns unsigned chars. Any ideas or comments? Thank you 回答1: Pixels are stored internally as IPL_DEPTH_8U, which means 8-bit unsigned char, ranging from 0 to 255. But you could also pack

1D -> 2D Array W/Normal Curve Sub-Array Lengths

天涯浪子 提交于 2019-12-07 23:43:15
问题 I am trying to break a 1D array into a 2D array where the sub-arrays are of varying lengths. This variance should follow the gaussian curve [or a mound shape]. So, say the 2D array variable we make is named gaussianCurve. The array within gaussianCurve[0] & gaussianCurve[n] would be of length 1, and gaussianCurve[n/2] would be a maximum provided by a parameter "maxArrayLength". This forces the number of gaussianCurve indexes to become variable. Say I have the following psuedo-code: function

Gaussian Noise in emgucv

久未见 提交于 2019-12-07 20:40:08
问题 How can I add gaussian noise ( with a particular mean and variance ) to an image using emgucv ? 回答1: I'm not sure quite what your asking as a Gaussian filter tends to be there to remove noise. To use a custom kernel you can use the following code. If you wish to add noise with a set mean and variance then you may have to resort to looping through the my_image.Data property and add it that way. Here is the code for using a custom Kernel if it's not quite what your after let me know and I'll

fit (triple-) gauss to data python

懵懂的女人 提交于 2019-12-07 11:27:41
问题 The short version of my problem is the following: I have a histogram of some data (density of planets) which seems to have 3 peeks. Now I want to fit 3 gaussians to this histogram. I am expecting this outcome. I used different methods to fit my gauss: curve_fit, least square and GaussianMixture from sklearn.mixture. With Curve_fit I get a pretty good fit but it isn't good enough if you compare it to my expected outcome. With least square I get a "good fit" but my gaussians are nonsense, and

Gaussian Basis Function

吃可爱长大的小学妹 提交于 2019-12-07 09:35:28
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. 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/diagonal/full) p = mvnrnd(MU, COV, 1000); %# sample 1000 2D points plot(p(:,1), p(:,2), '.') %# plot them

How to convert log probability into simple probability between 0 and 1 values using python

泪湿孤枕 提交于 2019-12-07 06:11:00
问题 I am using Gaussian mixture model for speaker identification. I use this code to predict the speaker for each voice clip. for path in file_paths: path = path.strip() print (path) sr,audio = read(source + path) vector = extract_features(audio,sr) #print(vector) log_likelihood = np.zeros(len(models)) #print(len(log_likelihood)) for i in range(len(models)): gmm1 = models[i] #checking with each model one by one #print(gmm1) scores = np.array(gmm1.score(vector)) #print(scores) #print(len(scores))

Generating samples from a two-Gaussian mixture in r (code given in MATLAB)

自闭症网瘾萝莉.ら 提交于 2019-12-07 05:45:16
问题 I'm trying to create (in r) the equivalent to the following MATLAB function that will generate n samples from a mixture of N(m1,(s1)^2) and N(m2, (s2)^2) with a fraction, alpha, from the first Gaussian. I have a start, but the results are notably different between MATLAB and R (i.e., the MATLAB results give occasional values of +-8 but the R version never even gives a value of +-5). Please help me sort out what is wrong here. Thanks :-) For Example: Plot 1000 samples from a mix of N(0,1) and