7 votes
Accepted

Estimate the number of self-avoiding walks of length $n$

Background The number of self-avoiding walks of length N on a square lattice is: ...
user avatar
  • 3,131
7 votes
Accepted

Learning parameters of noise and filter coefficients from data where data and noise both have Gaussian distributions

So the way I went about formulating the problem was to essentially write the following equations: The state that will be estimated, which is defined as a column vector, is the following: $$w = [vec(A)...
user avatar
  • 3,683
6 votes
Accepted

Python: What is a good way to generate a 1D particle field with a gaussian distribution?

This doesn't randomly sample points, but instead chooses representative points deterministically. scipy.stats.norm.ppf(np.linspace(0, 1, 1000+2)[1:-1])
user avatar
  • 772
5 votes

solving for unknown inside an expectation

Since you are assuming $\eta$ is normal what i would do is try to compute the expectation as fast as possible for every $\theta$. So I would compute the expectation using any numerical integration I ...
user avatar
5 votes
Accepted

How do I generate Maxwell-Boltzmann variates using a uniform distribution random number generator?

The initial velocities are drawn from a Gaussian distribution with variance $$\sigma_i^2=\frac{k_{\textrm{B}}T}{m_i},$$ where $k_{\textrm{B}}$ denotes Boltzmann's constant, $T$ is the temperature and $...
user avatar
4 votes
Accepted

How to add extra constraints to a linear system for probabilities?

You could use a least-square solver with bounds. ...
user avatar
  • 8,110
4 votes
Accepted

Numerical integration of Fokker-Planck equation allowing for negative drift?

I am familiar with the equation in a different application, it is a so called convection-diffusion equation. There is no problem to solve it for negative values of B. The scheme you mention (Chang-...
user avatar
4 votes

How can I generate half-normal variates in MATLAB?

If $X\sim \text{Normal}(\mu,\sigma)$, then the $Y\sim \text{Half-Normal}$ is obtainable via several approaches. Absolute Value: $\quad Y = |X|\quad $ (As pointed out by @DavidZ.) Truncation: $\...
user avatar
4 votes
Accepted

Different questions about "Inverse Physics problems"

As I understand, your ultimate goal is to solve an inverse problem (i.e., infer some parameters from given data / observations). To this end, you want to apply Bayesian Inference, which relates the ...
user avatar
  • 401
3 votes
Accepted

What are the Exact Rules for Significant Figures, Precision, and Uncertainty?

The rules of significant figures are rule-of-thumb way to communicate errors and should only be seen as a primite first step to talk about uncertainties and measurement errors. You gave the excellent ...
user avatar
  • 2,121
3 votes
Accepted

Verifying that ODE integration generates Theoretical Stationary distribution

In general, your type of question would be called a "multivariate goodness of fit test". If $F(x_1,\ldots,x_n)$ is the $n$-dimensional CDF for the theoretical distribution, and the random variables $(...
user avatar
  • 11.4k
3 votes

Computing expectations

Let's first rewrite this. From your formulas, you have that $$ A_{t+1} = A_t^\rho \exp(e_t) $$ where $A_t$ is just the previous value and, consequently, just a fixed parameter. So what you need to ...
user avatar
3 votes
Accepted

Efficient and stable computation of inverse CDF

The assumptions you have are no more specific than what you need to assume to make something like Newton's method work. In fact, you don't even assume enough to make the problem unique: you only ...
user avatar
2 votes

Metropolis Monte Carlo integration of Area with unknown normalization

I don't think you're missing anything, MCMC is used to sample points from a given distribution, known up to a normalization constant, and to evaluate expectations w.r.t. that distribution (not ...
user avatar
  • 11.4k
2 votes

Python: What is a good way to generate a 1D particle field with a gaussian distribution?

NumPy comes with a nifty random library with various distributions, including normal (Gaussian). From the Numpy documentation: ...
user avatar
  • 2,473
2 votes

GPGPU/FPGA programming for Combinatorial Analysis

I am writing a general answer about porting a program running on a CPU to a GPU or FPGA. Both GPU programs (using say CUDA) and CPU programs are written in high level languages like C, C++. Therefore ...
user avatar
  • 121
2 votes
Accepted

Kernel-based differentiation

Posting a partial answer in hopes of inspiring a full one. For simplicity take $f(x)=x$. Reparameterize to $\xi\sim N(0,I)$. We are then interested in the quality of this approximation: $$ \nabla V(\...
user avatar
  • 201
2 votes
Accepted

How is KDE used in stochastic tomography

How is the KDE used for calculating the new residual value here? Assume that you have already processed $n$ samples $x_1,x_2,\ldots,x_n \in \mathbb{R}^3$. Then the residual images $r_j : \mathbb{R}^2 ...
user avatar
  • 36
2 votes

How to generate Poisson-distributed random numbers quickly and accurately?

If you can use C++11 you can use the built-in Poisson distribution ...
user avatar
2 votes

How to solve system of equations with almost-zero determinant?

Basic linear algebra states that $\det(I-S)$ must be non-zero so that a solution to your linear system exists. On the other hand, if your determinant is (numerically) zero, the basis vectors in your ...
user avatar
  • 2,792
2 votes

How to solve system of equations with almost-zero determinant?

You cannot solve what has no solutions That matrix is singular, so the system has either zero or infinite solutions. In the case of your system, I think some Perron-Frobenius theory can be used to ...
user avatar
1 vote

Importance Sampling for multidimensional integrals and random numbers from multivariable pdf's

Let's recap what you want to do: You have some set $V \subset \mathbb{R}^5$ and want to approximate the integral of some function $f\colon V \to \mathbb{R}$: $$ \int_V f(x) \,\mathrm{d}x $$ The "...
user avatar
  • 401
1 vote

Different questions about "Inverse Physics problems"

The previous answer pretty sums up my understanding on this problem. I just want to add 2 solid references on this regard (Both are from an astrophysics context). The paper by Hogg et al provides a ...
user avatar
  • 11
1 vote

Non-negative least squares with very small numbers

To tackle your issue of very, very small numbers, you need to use a arbitrary precision arithmetic library, like MPFR. https://www.mpfr.org/ MPFR is awesome and will continually jack up the precision ...
user avatar
  • 576
1 vote

Change of random variables and check by plot

Nevermind, I fix it. The line in the update_histogram(...) function should be: histogram[index[0], index[1]] += weight instead ...
user avatar
  • 163
1 vote

How to generate Poisson-distributed random numbers quickly and accurately?

I found the answer from the book Numerical Recipes in C, but unfortunately the code in that book is copyrighted. So, I re-derived a similar code that is slightly different but does the same thing. ...
user avatar
  • 151
1 vote
Accepted

Using physical parameter as a Gaussian random variable in a simple Poisson problem

In the loop over your instances of 100 random values for $k$, you could write the value for $k$ into a file, and call your finite element code; the finite element code could then open the file, read ...
user avatar
1 vote

Optimize custom probability distribution in Python

Mathematically, the probability density function ($\operatorname{PDF}$) for $Z$ is given by the integral: $$\operatorname{PDF}(Z) = \int \delta\left(Z - f_a(X,Y)\right) \operatorname{PDF}(X,Y)\...
user avatar
  • 143
1 vote

Probability of reconstructing a word using c substrings from a random sample

I don't know the answer to your question, but there is almost certainly a large amount of literature on it in the computational biology community. This is because your problem is in essence how ...
user avatar
1 vote

How to plot probability density function in MATLAB?

Matlab R2014b has this 'histogram' function which has the 'normalization' property, it may give what you want. http://www.mathworks.com/help/matlab/ref/histogram.html#namevaluepairarguments
user avatar
  • 63

Only top scored, non community-wiki answers of a minimum length are eligible