8
votes
Polynomial approximation
$\mathbf{A}$ is an $(n+1) \times (n+1)$ matrix. It can be obtained as follows:
$\textbf{A} = \left[ \matrix{1 & 1 & 1 & \cdots & 1 \cr
x_0 & x_1 & x_2 & \...
- 2,169
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 ...
- 52.4k
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 ...
- 11.4k
5
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 ...
- 3,043
4
votes
Is there a relationship between the covariance matrix and the partial derivative?
Let $\mathbf{\theta}$ be a Gaussian random vector with mean $\mathbf{\mu}$ and covariance matrix $\mathbf{\Sigma}_\mathbf{\theta}$. Let $\mathbf{p}_\theta$ denote the joint PDF.
Let $J_\mathbf{\...
- 2,169
4
votes
Accepted
Polynomial approximation
You can easily do this with for loops. Just use n to define your loop limits. Here's a fully functional solution for MATLAB (just define n and x first):
...
- 4,571
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}|}{\...
- 1,262
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 $(...
- 11.4k
3
votes
Data for Tracy-Widom distribution
Mathematica has the TW distributions:
http://reference.wolfram.com/language/ref/TracyWidomDistribution.html
- 31
3
votes
Accepted
Sum over very small exponentials: Underflow
You may use Kahan summation algorithm [1]
The idea is to reschedule the sum operations in such a way precision loss is limited. The code is very simple (reproduced from [1] below).
If this does not ...
- 2,285
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 ...
- 10k
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 ...
- 85
2
votes
Sum over very small exponentials: Underflow
You are adding positive terms, so you don't need to worry about the imprecision of the final result as if you had negative terms: (10^100+5)-(10^100+3)=2 but (10^100+5)+(10^100+3)=2*10^100 (as long ...
- 231
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....
- 133
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$...
- 52.4k
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.
- 18.2k
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 ...
- 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 ...
- 121
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, ...
- 2,077
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 ...
- 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 ...
- 298
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}$$
...
- 111
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 ...
- 52.4k
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. ...
- 3,788
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 ...
- 991
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 (...
- 5,359
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, ...
- 52.4k
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 ...
- 52.4k
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)\...
- 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....
- 481
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
statistics × 97linear-algebra × 10
data-analysis × 10
probability × 10
optimization × 9
algorithms × 9
python × 8
regression × 8
numerics × 6
machine-learning × 6
random-number-generation × 6
matlab × 5
fluid-dynamics × 5
matrix × 4
simulation × 4
c++ × 3
performance × 3
monte-carlo × 3
computational-physics × 2
scipy × 2
eigensystem × 2
error-estimation × 2
numpy × 2
visualization × 2
floating-point × 2