Skip to main content
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: ...
Richard's user avatar
  • 3,961
4 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 ...
MPIchael's user avatar
  • 2,935
4 votes
Accepted

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

You could use a least-square solver with bounds. ...
nicoguaro's user avatar
  • 8,510
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-...
Peter Frolkovič's 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: $\...
SecretAgentMan's user avatar
3 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 ...
cos_theta's user avatar
  • 451
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 ...
Wolfgang Bangerth's user avatar
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 ...
michael's user avatar
  • 36
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 ...
ajit's 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(\...
VF1's user avatar
  • 211
2 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 $(...
Kirill's user avatar
  • 11.4k
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 ...
Henri Menke's 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 ...
davidhigh's user avatar
  • 3,127
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 ...
Federico Poloni's user avatar
1 vote

How to generate p Sample of GGM of dimension m, for parameter : the weight, the means and the covariance?

Pick an integer i at random with probability p_i, the i-th weight. Then sample from the corresponding multidimensional Gaussian ...
Stéphane Laurent's 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 "...
cos_theta's user avatar
  • 451
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 ...
Charlie S's user avatar
  • 661
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 ...
R zu's 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. ...
juhist's 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 ...
Wolfgang Bangerth's 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)\...
Sean Lake's 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 ...
Wolfgang Bangerth's user avatar

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