# Questions tagged [numerics]

Also known as Numerical Analysis, Numerics aims to provide methods and algorithms for numerical computations.

134 questions
Filter by
Sorted by
Tagged with
58 views

### Estimate MLE of discrete distribution with two parameters in R [closed]

I want to estimate the MLE of a discrete distribution in R using a numeric method. My data looks like this: data1<-c(5,2,2,3,0,2,1 2,4,4,1) If we assume it ...
81 views

### Avoid numerical problems with product of probabilities when taking logs or subtracting the maximum is not enough

I have to take draws from the discrete posterior distribution: $P(X = x_i |y) \propto P(X = x_i)\prod_{t}^N p(Y_t|X)$ where $P(X = x )$ is the probability mass function of a discrete uniform with ...
191 views

### Get accurate eigenvectors, when eigenvalues are minuscule

I have a symmetric matrix A. I'm not able to compute all the eigenvectors accurately, and I believe it is due to the last few eigenvalues for ...
18 views

### Calculating an ARIMA forecast following a data gap

Suppose I have an ARIMA(p, d, q) fit to some time period, after which some time goes by in which there is no data available, and then data becomes available again. I then want to use my historically ...
48 views

### Numerically PCA implements SVD or SVD implements PCA

How do we numerically implement SVD? I confused the numerically implementations between PCA and SVD (who implements who). Since we know that PCA can be numerically implemented by ...
34 views

### Find the shape parameter for gamma CDF with other parameters known

Is there a reasonably computationally efficient way to find an approximation of the shape parameter (which will always be positive, but not limited to integers) for a gamma CDF (scale = 1) where the ...
38 views

### Are there examples where errors in numerical analysis has caused wrong decisions in statistics?

I read from statistics books that numerical analysis is not in important role in statistics. Are there any examples in history where numerical approximation has been caused wrong decisions in ...
30 views

### Is the QR Algorithm guaranteed to compute eigenvectors?

I'm writing some C++ matrix library for hobby. For computing eigenvalues and eigenvectors, I referred the following "Francis double step QR algorithm": In particular, page 82 of https://...
14 views

### First difference in logs transformation produces biased results on back-transformation [duplicate]

I have a strongly trended series where the trend appears to be exponential and I believe the errors tend to be proportional to the current value. In order to convert it to a stationary series for ...
28 views

### Why Welford’s method is not widely used in statistical library

I just learned about Welford’s method to compute standard deviation using only one pass. However, when I checked the source code of some statistical libraries (e.g., R stats and Numpy), they both use ...
66 views

### What is the correct equation for Newton's Method?

Different publications provide different equations for Newton's method or the Newton-Raphson method. In Giudici, P., Givens, G. H., & Mallick, B. K. (2013). Wiley Series in Computational ...
48 views

### I'm so confused about MLE

In maximum likelihood estimation, we maximise the likelihood. I don't understand how this is possibly: for any reasonable dataset, the likelihood of hitting that EXACT data set is obviously zero! So ...
52 views

### Numeric variable with outliers as a categories

I'm working with a dataset that has a few variables that I'm having difficulty trying to preprocess. So one of them is called MENTHLTH where it is a numeric variable. The point of the variable is to ...
35 views

### Seeking algorithms for fast, simple linear regressions

I am working on a project which requires me to work in a proprietary programming language. Unfortunately, this language lacks a matrix algebra library. In this environment, I would like to perform a ...
25 views

### Discrete correlation function (sample cross-covariance)

The continuous correlation function for the random variable $A(t)$ at a instant of time $t$ is given by \begin{equation} C_{AA}(\tau) =\frac{1}{T} \int_{0}^T d\bar{t} A(\bar{t})A(\bar{t}+\tau) \end{...
170 views

### How to plot $x^{1700}(1-x)^{300}$?

I'm trying to plot a Bernoulli likelihood function on R: $$x^{1700}(1-x)^{300}$$ But when I try to plot this function on R it looks like this: I think the maximum should be at 0.85, but it shows me a ...
66 views

86 views

### Algorithm for simple linear regression that is efficient and numerically stable

I'm developing an application that is fed with continuous data while older data is discarded. I'm using some algorithms to compute simple linear regression on these data with Perl. Basically that ...
43 views

### Equivalent of log sum exp trick for subtraction [duplicate]

I have two small positive real numbers $u, w$ such that $u > w$. Given $\log(u), \log(w)$ I'd like to find a numerically stable way to calculate $\log(u - w)$. One possible way of transforming the ...
67 views

### Why did the log likelihood decrease with additional parameters?

I'm trying to decide the effect of some factors on the time for an event to happen . Specifically, I am looking at how long it takes for the subject to pass a test (recognize the stimulus) when ...
667 views

### Expectation of $\ln(1 + e^x)$, where $x$ is normally distributed

I need to evaluate the following integral: $$\int_{-\infty}^\infty\mathrm d x \exp\left(-\frac{(x-\mu)^2}{2\nu}\right) \ln(1+e^x)$$ where $\mu$ is a finite real number and $\nu > 0$. This is just ...
11 views

### How does the choice of norm affect the condition of a problem?

we know that for a differentiable problem, the absolute condition number is the norm of its jacobian i.e. ||J||. We also know that a well-conditioned problem typically has a small condition number. ...
651 views

### Inverse-normal CDF approximation in Excel, Python or R

I read that the implementations of Inverse-normal cumulative distribution function (CDF) /quantile / ppf in R, Python (scipy) and Excel give similar results. However, I can't find the very formulae ...
83 views

### Why does lasso return unstable features when using the same data?

I am using scikit-learn to shrink my data set having around 800 features. It is a very noisy data (market and economic data) To my best knowledge, lasso returns same features for the same data set. ...
168 views

### Intuition about a coupon problem were we ask for the distribution of the unique coupons when the number of draws is fixed

Alternative viewpoint of the coupon collectors problem In the coupon collectors problem we draw from a collection of $n$ coupons, with replacement and ask the question how many draws $K$ it takes to ...
265 views

### Why is it much quicker to compute ridge regression than regular linear regression?

By my understanding, for a matrix with n samples and p features: Ridge regression using cholesky takes O(p^3) time Ordinary linear regression takes O(p^3) time Singular value decomposition if u, v ...
337 views

730 views

### adding a small constant to the diagonals of a matrix to stabilize

I have a large correlation matrix (110x110) with some small eigenvalues (about 20 < 0.1). It has been suggested that adding a constant (about 0.1) to the diagonals will help to stabilize the matrix....
214 views

### downsampling a kde / combining kde and histogram

I'm calculating a KDE of one parameter (y, particle density) in bins of another parameter (x, distance from the origin). At ...
31 views

### Model or numerical inaccuracy in R package distr

With the goal to have an "outlier"-aware normal distribution, I build a simple univariate mixing model of normal and uniform distributions: ...
I'm currently working to adapt the No U-Turn Sampler from this paper for a model I'm working on. The No-U Turn sampler augments the typical hamiltonian system by incorporating a slice variable $u$ ...