Questions tagged [convergence]

303 questions
2
votes
1 answer

Matlab's fsolve converges *but* seems to give wrong solution

I am trying to solve a system of non linear equations using fsolve; lets say F(x;lambda) = 0, where lambda is a vector of parameters, and x the vector I want to solve for. I am using Matlab's fsolve. I have 2 values of the parameter lambda, that I…
George
  • 21
  • 1
  • 2
1
vote
2 answers

Enhance convergence of mean computation of cosine or sine function

I'm computing the mean of values obtained from a*cos(ωt)+μ but it doesn't converge as I would expect. There is a residual error in the order of 10^-4 which I find quite big for 64 bit precision computation. I would expect that the computed mean…
chmike
  • 20,922
  • 21
  • 83
  • 106
1
vote
2 answers

How to visually assess the convergence of a mixed-effects model by plotting various optimizers

To assess whether convergence warnings render the results invalid, or on the contrary, the results can be deemed valid in spite of the warnings, Bates et al. (2023) suggest refitting models affected by convergence warnings with a variety of…
Pablo Bernabeu
  • 402
  • 4
  • 23
1
vote
0 answers

Convergence warning: how to do action after it?

I am esing the ElasticNet from sklearn. With the typical commands enet = ElasticNet(alpha=a, l1_ratio=l, random_state=42, tol=1e-8) enet.fit(X_train, y_train) sometimes the model does not converge, i.e. I get the following ConvergenceWarning:…
user9875321__
  • 195
  • 12
1
vote
0 answers

Optimize for a target value at specific position inside a 2D array

I have been trying to find a method to optimize a function that gives me a 2D-array for a temperature field such that the value at a specific position within that array corresponds to a target…
mango091
  • 11
  • 3
1
vote
1 answer

How do I fix my code to find the convergence rate

The IBVP is u_t+2u_x=0 , 00 u(x,0)=sin(pi*x) u(0,t)=g(t)=sin(-2*pi*t) I have to first implement the scheme using 4th-order central difference SBP operator in space and RK4 in time with spacing xi=i*h, i=0,1,...,N and update g(t) at every…
1
vote
1 answer

Parameters do not converge at a lower tolerance in nonlinear least square implementation in python

I am translating some of my R codes to Python as a learning process, especially trying JAX for autodiff. In functions to implement non-linear least square, when I set tolerance at 1e-8, the estimated parameters are nearly identical after several…
Fred
  • 579
  • 2
  • 4
  • 13
1
vote
0 answers

Problem of convergence when trying to implement a basic batch gradient descent algortihm in python

I am working with this dataset and I want to plot the training error as a function of the number of iterations of gradient descent with square loss. Here is my attempt : import numpy as np import scipy.io import matplotlib.pyplot as plt mat =…
Skywear
  • 53
  • 4
1
vote
1 answer

Testing program for convergence?

So, I'm pretty inexperienced with calculus, and in C++, so please bear with me if I'm misunderstanding this completely. I'm supposed to be testing this Taylor series program for convergence, which I'm told is when the output value does no change.…
AstralV
  • 119
  • 7
1
vote
1 answer

How do I implement a while loop until convergence in R?

I want to code a while loop which iteratively fills values in a vector until its values converge. Here is a reproducible example : vector <- c() # initalize first and 2nd element vector[1] <- 1 vector[2] <- 1 + exp(-2) The ith element of the vector…
outofthegreen
  • 352
  • 1
  • 13
1
vote
1 answer

How to improve model's performance base on XAI methods

I'm learning about explainable AI (XAI) and some of papers I've read say that we can use XAI to improve model's performance. It seems quite a new problem cuz I think when the model has already converged, it's impossible to find a new global minimum…
1
vote
0 answers

Order of convergence Runge-Kutta changes with time

I wrote a program in Python to solve the 1D wave equation by treating it as a first-order in time linear system, where the spatial variables are discretized (using 2nd order methods) and I integrate in time using a 4th-order Runge-Kutta. My problem…
moonknight
  • 334
  • 1
  • 7
1
vote
1 answer

How to prevent simulation stopping when lmer model does not converge

I run a simulation in which I have a loop similar to this simulate_study <- function(params){ pats <- simulate_pats(params) # a function that simulate the pats data frame model <- lmer(SFD ~ group*month + (1 + month|id), data=pats, REML=TRUE) …
Yossi Levy
  • 79
  • 1
  • 5
1
vote
0 answers

Markov Chain does not converge

i am trying to model car urban mobility by using Markov chains. I am trying to figure out why my Markov Chain model will not converge to a steady state distribution, assuming that it follows the assumptions of aperiodocity, ergodicity etc. I tried…
Fillip
  • 31
  • 2
1
vote
1 answer

How to properly train batch-wise in VowpalWabbit?

We are trying to train a VowpalWabbit (VW) model in an online-fashion. However, due to our system architecture and needs to scale, we have to train batch-wise and cannot do an online-update each time we predict. My question is, what is the best way…