Questions tagged [gaussian]
For issues related to any of the uses of the Gaussian function. Don't forget to add additional tags to clarify the context.
1,817
questions
0
votes
0
answers
13
views
Gaussian filter on neural dataset
I've been trying to implement a gaussian filter on my neural dataset. The dataset records the number of spikes within each timebin. It has dimension (N x M x T) where N is the number of neurons, M is ...
0
votes
0
answers
8
views
Problem in applying 2D gaussian method to a raster
I am applying the 2D Gaussian method to a raster image of LST but facing errors. the first plot is empty, opt has an infinite value, and no proper final output is shown.
gaussian2d <- function(x, y,...
1
vote
2
answers
86
views
Fitting a Gaussian to a probability distribution to find the standard deviation, in python using matplotlib
Plot of one distribution
I'm quite new to coding so please be patient.
I'm trying to model different probability distributions, and I would like to fit a Gaussian to each one and then find the ...
0
votes
1
answer
60
views
How to create a kernel matrix from a pandas dataframe?
I have a pandas dataframe in which the rows are the observations (data points) and the columns are the features. I want to create a kernel matrix from this dataframe using a Gaussian kernel. Therefore ...
0
votes
1
answer
27
views
Contour plotting with gaussian_kde. It always draws 0.000 line. How to avoid it?
I'm trying to plot some equipotential lines with gaussian_kde function. However, i noticed that it always draws the most outer line with probability 0.000. I cannot find anyway to avoid it.
An example ...
0
votes
1
answer
35
views
How to create a 2D array python
I have to build a2D array in python starting from a 1D array, where I use each element to start a new "orthogonal" 1D array. Suppose that I have an array that for each x gives me the ...
0
votes
0
answers
64
views
Multiplying Tensor with Lazy Tensor
I am trying to compute KNN neighbours with Mahalanobis distance instead of L1 or L2 norm
I am getting the error of multiplying Tensor with Lazy Tensor.
Any ideas how solve this problem using Lazy ...
0
votes
1
answer
107
views
Gaussian blur in C using SDL
I'm trying to create a Gaussian blur in C using SDL.
Here is my function:
We admit that the param surface is a grayscale image (that's why i only use the r).
SDL_Surface* gaussian_blur(SDL_Surface* ...
0
votes
0
answers
13
views
black-box optimization problem in a unstable environment
My experiment is based on an online ab test system. A typical situation is that, I generate some candidates with some algorithm (CEM, GP etc) and push them to different experiment buckets (around 10). ...
3
votes
1
answer
113
views
Why is my Gauss-Seidel function slightly off?
I've written a Gauss Seidel function that takes in a coefficient matrix, a vector array holding the constants, and an integer n, where n-1 is the length of the matrix. It returns an array that holds ...
0
votes
1
answer
70
views
How would a 1D gaussian smoothing filter look like as a convolution
I am new to image smoothing and I want to check if I understood correctly how a 2D image processing filter works. I learned that Gaussian smoothing filters can be described as convolutions. For a 2D ...
0
votes
0
answers
16
views
Fitting a 1D Gaussian using pymc
I have a 1D array that has a a signal with a peak. The peak looks like a 1D Gaussian, hence I am trying to find the x value for the signal's peak (or the mean of the fit 1D Gaussian) using pymc. Below ...
0
votes
1
answer
42
views
mutiple Gaussian Curves to fit scipy optimize curve_fit ,
Refer, https://github.com/shuyu-wang/DSC_analysis_peak_separation/tree/main/DSC-Automatic%20multimodal%20decomposition
Consider X is a sum of Multiple Gaussin Function, and if we have to curve fit, I ...
0
votes
0
answers
46
views
Identify peaks without a priori knowledge of curve shape?
I have a dataset with a profile that change over time. It seems to always be roughly Gaussian in shape, but the way the Gaussian "points" (whether the Gaussian rises then falls, or falls ...
0
votes
2
answers
75
views
Trying to calculate the value of the gamma function using Gauss-Laguerre quadrature without inbuilt functions
Im trying to write a program that calculates the value of the gamma function(defined by integral(t^(n-1)*e^(-t)*dt) ) for any value n in python. However, my answers are very wrong and I don't know ...
0
votes
0
answers
12
views
Issue with Fuzzy Output - Gaussian
enter image description hereI'm experiencing an issue with my fuzzy output. In the 'view rules' section, the returned value doesn't seem to correspond to the output area.
I have a fuzzy logic system ...
0
votes
1
answer
72
views
Modifying R code for getting the augmented coefficient matrix for 5 or more equations and unknown variables
Can anyone help me in modifying this code? I am stuck in this ever since last week. I am trying to make this code work for these following equations yet nothing works.
Also, I am doing this so I can ...
0
votes
0
answers
11
views
Additive gaussian process regression with interaction
I'm wondering if there's a good R package that will fit a regression model of the form y=f(z) + g(x)t, where z are baseline variables, x are variables that may impact treatment effectiveness, t is a ...
0
votes
0
answers
35
views
manipulate 2d gaussian in matlab
I wish to plot 2d gaussian in matlab, and here is the code and generated graph.
x=0:.02:1; y=x;
r = 0.2; %set standard deviation
[X,Y]=meshgrid(x,y);
Z=exp(-((X-0.5).^2+(Y-0.5).^2)/(2*r^2));
mesh(X,...
0
votes
0
answers
52
views
Is there a code to keep track of multiplications and divisions performed in R?
I'm doing a project where we are given the size of a Hilbert matrix, and we are to use Hx=b and Gaussian elimination to find b, and to recalculate our exact solution for x with what we had calculated ...
1
vote
1
answer
61
views
Overflow error in np.exp function for a curve_fit
I'm trying to fit a combined gaussian using the following code:
def curve_f(x,a,b,c,d,e,f):
return (a*np.exp(((x-b)**2)/(2*-c**2)))+(d*np.exp(((x-e)**2)/(2*f**2)))
The problem is that when I put ...
0
votes
0
answers
34
views
Use gaussian function only in the masked area of original image
I have a segmented mask of vessel and original image. Trying to use gaussian function to erode out that region into a lower intensity. I read the image and mask segment (black/white) then pass it over ...
0
votes
0
answers
92
views
Extract data from gaussian log file by python
I have a log file (n_10_osf.log) I want to extract HOMO -LUMO , total energy and other parameters from this log file by python?
i want to print all these values which i needed by a python code by ...
0
votes
0
answers
29
views
Getting error while compiling the Fortran code to generate Gaussian random numbers [duplicate]
program Gaussian_random_number
implicit none
integer, parameter :: N = 1000
integer, parameter :: idum = -123456789
real(kind=8), parameter :: AA = 0.1d0
real(kind=8) :: noise
...
0
votes
0
answers
168
views
Generating a Gaussian point spread function using Python
I wrote this function to generate a Gaussian point spread function using Python, I wonder if my approach is correct or needs modification.
I wrote this function, but not sure if my approach is correct:...
1
vote
2
answers
205
views
How to draw 2D Gaussian blob on an OpenCV image?
There are various available examples with a formula for a 2D Gaussian Blob and drawing it via Pyplot, for example:
How to generate 2D gaussian with Python? and How to plot a 2d gaussian with different ...
1
vote
0
answers
115
views
Equation for rotated 2D flat-top Gaussian distribution
I'm in need for an equation for rotated 2D flat-top Gaussian distribution.
What is my problem: I have data images that look like this (image on the left):
What I'm trying to do is to fit a function ...
0
votes
0
answers
32
views
Fitting a Gaussian Mixture Model with known share of noise/outliers
Question was moved to stats.stackexchange
A Gaussian Mixture model is fitted by the Expectation-Maximization algorithm.
This fairly simple algorithm consists of two steps and the initialization.
...
2
votes
1
answer
111
views
Is there a way to create a 'truer' random outcome using a Gaussian normal distribution in C++?
I've scoured stack overflow for some descriptions, explanations, and snippets of the std::normal_distribution<> variable(mean, stddev) function, and have found one instance in particular, listed ...
0
votes
2
answers
79
views
Orthogonal Distance Regression in Python for Gaussian fitting
I am trying to do a 1D Gaussian fitting using ODR in Python, but keep getting wrong fitting results.
For simplicity, assume that I have a set of 19 data points. These are the data I want to fit:
...
1
vote
0
answers
66
views
How can I adjust my Gaussian Mixture Model (GMM)? (If it's wrong)
I have 1 dimensional data of clinical analysis such as leukocytes in blood. Regardless of the type of analysis they look more or less this way.
Histogram
Our guess (which is more than a guess) is that ...
0
votes
0
answers
74
views
2D diffusion model - forward process
Im trying to build the forward process :
my data is 2000 2D points uniformly distributed , inside a square, ranging from x = −1, y = −1 to x = 1, y = 1.
and my Scheduler: σ(t) = e5(t−1)., T: 1000 (...
0
votes
1
answer
42
views
An example usage for tf.keras.layers.GaussianDropout in TensorFlow2 for deep GRU network
There are not much example of using
tf.keras.layers.GaussianDropout
in TensorFlow 2, and I am just converting my code from Tensorflow1.15 to Tensorflow 2, and having some difficulty to understand ...
1
vote
1
answer
32
views
Absurd Results in SciPy Curve Fitting
I have a really huge array named diff and I have used np.histogram to generate its histogram hist.
I want to fit diff to a gaussian for which I wrote this function:
def gauss(x,disp,amp,mu,sigma):
...
0
votes
0
answers
59
views
Is there an R function that would produce results similar to SciPy’s gaussian_filter?
I’m working to recreate some Python code in R. How can I replicate the results of gaussian_filter() from the SciPy package in R (here)? I’ve tried a number of different functions from a number of ...
0
votes
0
answers
37
views
Modeling Data using Gaussian process Regression , not getting good results
I am trying to model my given data using GPR and have got following results. I am unable to capture that steep change in the gradient no matter what. Can anyone please give me some pointers ?
Here is ...
0
votes
0
answers
54
views
How to deal with a 'ZeroDivisionError: float division by zero' error in my gaussian elimination code?
I have a code for gaussian elimination that works for most matrices. However, some matrices, when run through the code, will return the last row of that matrix as 0s. Obviously, you don't want that, ...
0
votes
1
answer
206
views
Evaluating a 2d Gaussian distribution along a line
I have a 2d multi-variate gaussian distribution is intersected somewhere by a straight line. I would now like to evaluate the 2d Gaussian along this one line. If I'm not mistaken, this should be a ...
1
vote
0
answers
54
views
Modelling 2D gaussian in python using numpy
I am trying to model a 2D gaussian function using the code below
import numpy as np
def gauss_2d(x, y, amp, x0, y0, sigma_x, sigma_y, theta):
a_gauss_2d = ((np.cos(theta)**2) / (2*sigma_x**2)) + (...
0
votes
1
answer
26
views
How to change a tensor object from gaussian process library into an numpy array?
I want to convert a tensor object, in this case predicted values obtained by using a gaussian process model, into a numpy array.
I was writing this block of coding that goes as follows.
# Predict ...
2
votes
1
answer
323
views
Trying to fit a gaussian with scipy
I have a diffractogram, and I need to fit a given peak to a gaussian function, I'm trying to use curve_fit from scipy.optimize for that but I'm getting some errors. First at all, because of my data, I'...
0
votes
0
answers
74
views
How to integrate 2D gaussian kde (pdf function)?
I wanna integrate the 2d probability density function calculated from Gaussian kde.
I use the kernel density function from stats.gaussian_kde()
x = location["longitude"]
y = location["...
0
votes
1
answer
168
views
Sklearn Gaussian Mixture predict_proba: difficulties to understand resulting probabilities
We have two two-dimensional, well separable clusters as seen in the figure below:
Running on that dataset sklearns GMM:
import numpy as np
from sklearn.mixture import GaussianMixture
gm = ...
1
vote
2
answers
255
views
scipy.stats.multivariate_normal.pdf() vs.scipy.stats.normal.pdf()
I am probably missing something, but I'm struggling to understand how scipy.stats.multivariate_normal.pdf() and scipy.stats.norm.pdf() are different.
import jax.scipy.stats as stats
from jax import ...
0
votes
1
answer
136
views
Solving system of equations using Sympy on GPU
I am currently solving the following problem (Gaussian tail approximation) using solve() :
x, y = symbols('x y')
l_bound = np.mean(self.data[j]) - 3 * np.std(self.data[j]) # e.g. 4
u_bound = np.mean(...
1
vote
1
answer
63
views
How can I add the Gaussian fit function back to originlab?
I needed to do a project for school to fit multiple peaks using the Gaussian function. The problem is that I remove the function accidentally from the peak functions list.This is preaty much all am I ...
0
votes
1
answer
39
views
Calculcating probabilities in a gaussian distribution
For a school project, I have to calculate the probabilities of P(Y=2), P(Y=3), and P(Y=4) based on:
Y = stats.norm(loc=3.0, scale = 2.0)
My approach was:
p2 = Y.pdf(2) p3 = Y.pdf(3) p4 = Y.pdf(4)
...
0
votes
0
answers
50
views
Standard deviation and mean of Multi-sensor fusion of sensors with Gaussian noise
Let us assume that we are measuring a temperature in a room. The real temperature is constant, T. We have n temperature sensors of different quality, and they read T1, T2, ..., Tn. Each of those ...
0
votes
1
answer
99
views
Smooth Gaussian Fit with small data
I want to apply a gaussian fit as shown in my code below. The problem is that i only got a small amount of data points to fit so the curve does not look like a proper gaussian curve.
import numpy as ...
1
vote
0
answers
153
views
Multiple peaks data fitting. How to effectively fit different distributions in the same data?
I have this data of hydrogen desorption as a function of temperature, that has 4 peaks:
I want to fit a distribution curve to each peak to extract information like area below each peak. For peaks 1, ...