6 votes
Accepted

Computing square root of diag(u)-uu'?

Would a decomposition of the form $A = XX^T$ suffice? This would be enough, e.g., if the end goal is sampling from the Gaussian distribution with this given covariance. If so, you can use the ...
Nick Alger's user avatar
  • 3,143
6 votes
Accepted

Tikhonov (Ridge) Regression and Normalization

It's a question of how you choose $\lambda$ and $\Gamma$ (of course). Think for a moment about what happens if you choose $\Gamma=I$ and make $\lambda$ large: in that case you say that it is more ...
Wolfgang Bangerth's user avatar
5 votes
Accepted

Data for Tracy-Widom distribution

It's actually not all that complicated to calculate the Tracy-Widom CDF just from its definition: see On The Numerical Evaluation Of Fredholm Determinants by Folkmar Bornemann. The Wikipedia page ...
Kirill's user avatar
  • 11.4k
4 votes

How to define a dimensionless Objective function for determining how peaked a curve is?

Let $f(\omega)$ be your power spectrum. Then maybe something like $$ \frac{\|f\|_{L^\infty}\|f\|_{L^0}}{\|f\|_{L^1}} = \frac{\mathrm{max}_{\omega\in\Omega} f(\omega)\cdot|\omega_{max}-\omega_{min}|}{\...
whpowell96's user avatar
  • 2,443
3 votes

Beta function and integral value

I've tried to implement your equation \begin{align} f(a,b) = \frac{1}{2}\int_0^1 \left|\frac{p^{a-1}(1-p)^{b-1}}{\beta(a,b)}-1\right| \, \text{d}p, \end{align} using four different methods of ...
mmikkelsen's user avatar
3 votes
Accepted

Reconstructing statistics of $x\otimes y$ from E[XX'], E[YY'] and E[XY']

(Converted to an answer from my comments and expanded.) Basically you need to compute the fourth moments $E[x_i x_j y_k y_l]$ for all $i,j,k,l$, given the second moments. These fourth moments are not ...
Federico Poloni's user avatar
3 votes

Data for Tracy-Widom distribution

Mathematica has the TW distributions: http://reference.wolfram.com/language/ref/TracyWidomDistribution.html
Craig Tracy's user avatar
2 votes

Force a line through the origin

I think that what you are trying to do is to find a line passing through a set of data which is able to best fit that set of data. A Least Square approach, for instance, could be used for this purpose....
FancyPants's user avatar
2 votes

Normalize data so that the sum of squares = 1

It's not entirely clear to me what step you struggle with. But for the sake of explanation, assume you have data $x_i, i=1...N$ and you want to compute the normalized data $y_i, i=1...N$ from the $x_i$...
Wolfgang Bangerth's user avatar
2 votes

How are the outcomes that generated from different predictive models combined to get more accurate predictions?

Bagging, Boosting, and Bayesian Model Averaging/Combination are all widely used techniques for doing this. These are discussed in many textbooks on machine learning.
Brian Borchers's user avatar
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
Accepted

Which statistical method should I use for comparing machine run-time of two algorithms?

This is a typical use case for a paired t-test. The idea is to consider only the runtime difference $\Delta t$ for each problem and test for the null hypothesis $E(\Delta t)=0$. For a step-by-step ...
cdalitz's user avatar
  • 481
2 votes

Best way to convert a sparse (containing zeros) covariance matrix into a correlation matrix?

What about the following? Dinv = np.diag(1.0 / np.sqrt(np.diag(cov_matrix))) corr = Dinv @ cov_matrix @ Dinv The above avoids any division except by the diagonal ...
schneiderfelipe's user avatar
2 votes

SciPy ODR "Ordinary" Least Squares?

Based on the ODRPACK Documentation it seems clear that by "ordinary least squares", the authors mean least squares in which the errors are (considered to be) only in the dependent variables, ...
Mark L. Stone's user avatar
2 votes

Tools to compare two matrices with same dimensions

Welcome to Scicomp! You might be interested in the field of (multimodal) medical image registration. In medical contexts one often wants to register a CT image with an MR or PET-Scan. The amplitudes ...
MPIchael's user avatar
  • 2,935
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

Parameter explained by many distributions

Your question is ill-posed. Take just the data points corresponding to one label. I think that when you say "for each label, we have several data distributions associated to it" that what ...
Wolfgang Bangerth's user avatar
1 vote

Weighted moving variance

I believe that we can compute using the vectorized form, assuming a vector of weights w and a vector of values x: ...
Ertxiem - reinstate Monica's user avatar
1 vote

How to optimize sampling for parameter estimation

The computational costs of sensitivity analysis for a considerably large simulation is attributed to two main phenomena. Firstly, as it's mentioned in the body of the question, due to a large number ...
JNo's user avatar
  • 41
1 vote
Accepted

Is there any robust criteria for this kind of outlier?

If the histogram you're displaying is representative than you could methods which are used for binarization in Image Processing. For instance, using Otsu's Method will probably be a robust way to set ...
Royi's user avatar
  • 332
1 vote

Using the PAST algorithm to find eigenvectors

If the identity matrix is a feasible solution, then clearly it is an optimal solution. However, most of the time, the identity matrix is not a feasible solution. $$W\in \mathbb{R}^{m \times d}$$ ...
Siong Thye Goh's user avatar
1 vote
Accepted

will this methodology end up giving me a nonsense regression equation.

That depends on (i) how many random samples you draw, and (ii) how good a regression you want to have. The point of finding the best fit regression is that you want the best model out of all possible ...
Wolfgang Bangerth's user avatar
1 vote

How are the outcomes that generated from different predictive models combined to get more accurate predictions?

Provided you have raw data you could use in this process, one could use the various different models and treat them as basis functions of sorts that you wish to merge together in a least square sense. ...
spektr's user avatar
  • 4,248
1 vote

1-D turbulent energy spectra in homogeneous direction (non-isotropic)

I think there is something wrong with your program. First, the fft(u).*conjg(fft(u)) is equal to fft(R), ...
Yaohui Nie's user avatar
1 vote
Accepted

Legendre expansion of $r(x) = f(x)/g(x)$ using a finite number of samples from $f(x)$ and $g(x)$

I believe you are asking how to compute $$\frac{f(x)}{g(x)}\approx\sum_{n=0}^p a_n P_n(x).$$ You could interpolate your samples of $f$ and $g$ to a uniform grid on $[-1,1]$, calculate the ratios at ...
coolguy1000000's user avatar
1 vote

Data Analysis - Cooling Efficiency

An efficiency metric You could use, $$\eta = p_{\text{out}}/p_{\text{in}}$$ where the power out ($p_{\text{out}}$) is defined as the heat per second from the room to the environment, and, power in (...
boyfarrell's user avatar
  • 5,409
1 vote
Accepted

Parameter identification for regression model

You can just write it as a least squares minimization problem. That leads to a quadratic problem that is easy to solve. The problem is, in general, underdetermined since you only have $Nn$ equations, ...
Wolfgang Bangerth's user avatar
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
Accepted

Is resampling more accurate than block average for statistical analysis of data?

I guess that you are not actually interested in the variance, but in a confidence interval for your observable $\theta$. It should be noted that computing the confidence interval from the variance (i....
cdalitz's user avatar
  • 481

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