Questions tagged [convergence]

303 questions
0
votes
0 answers

Convergence of image reconstruction using genetic algorithm in Matlab

I'm implementing an image reconstruction method using genetic algorithm (for optimization). I randomly opted 10 population(each population is an image with intensity values in row major order) as follows for i = 1:population_size …
Celine
  • 115
  • 1
  • 5
  • 13
0
votes
0 answers

MATLAB While loop for convergence

I'm attempting to write a while loop iteration such that it stops when my value converges. When the new value is only 1% different from the last, I want the code to stop. Here is the iterative relationship: And here is my code thus far: % Given…
Doug Fox
  • 23
  • 1
  • 1
  • 6
0
votes
1 answer

How to keep a simulation from crashing when one application of the lrm function in rms cannot be fit?

I am running a Monte Carlo simulation with 1000 iterations. Within each iteration, I am fitting a weighted logistic regression model using the lrm function from the Harrell's rms package. The model is fit using this code: lrm(y ~ x,…
user66177
0
votes
1 answer

SOR method does not converge

I have a SOR solution for 2D Laplace with Dirichlet condition in Python. If omega is set to 1.0 (making it a Jacobi method), solution converges fine. But using given omegas, target error cannot be reached because solution just goes wild at some…
epicenter
  • 19
  • 5
0
votes
1 answer

Determining convergence rate of fsolve - Matlab

Suppose I'm solving a system of nonlinear equations. A simple example would be: function example x0 = [15; -2]; options = optimoptions('fsolve','Display','iter','TolFun',eps,'TolX',eps); [x,fval,exitflag,output] =…
0
votes
0 answers

MATLAB train function stops immediately

I'm new to Neural Networks and I am trying to train an NN by simply loading two different time series data x and y, which are 300 x 1 vectors. x is the set of values of the predictor variable, and y is the dependent (output) variable. By the way, is…
jeff
  • 13,055
  • 29
  • 78
  • 136
0
votes
0 answers

Mathematica. Integration of an oscillating function

I need help with an integral in Mathematica: I need to calculate the integral of x^(1/4)*BesselJ[-1/4, a*x]*Cos[b*x] in the x variable (a and b are parameters) between 0 and Infinity. The function is complicated and no analytic primitive exist, but…
0
votes
2 answers

Scala: Implementing a mathematical recursion with convergence

Many numerical problems are of the form: initialize: x_0 = ... iterate: x_i+1 = function(x_i) until convergence, e.g., || x_i+1 - x_i || < epsilon I'm wondering whether there is a nice way to write such an algorithm using…
bluenote10
  • 23,414
  • 14
  • 122
  • 178
0
votes
1 answer

Convergence of value iteration

Why the termination condition of value-iteration algorithm ( example http://aima-java.googlecode.com/svn/trunk/aima-core/src/main/java/aima/core/probability/mdp/search/ValueIteration.java ) In the MDP (Markov Desicion Process) is ||Ui+1-Ui||<…
-1
votes
1 answer

initial value error while using gradient descent algorithm

Problem: Initial value is 10000 and the solution is converging to 10000 instead of actual solution 1. import numpy.linalg as nl x_ini=10000 def obj(x): f = x**2 - 2*x + 3 return f def grad(x): df = 2*x - 2 return…
-1
votes
1 answer

Parameter of convergence of bisection method. C code

I stuck with one formula in my code. Changed it many times in different ways but all the time my teacher say that it is not correct. I gave up and have no idea what else I can do. I think I just don't understand the formula correctly that's why I do…
Gelios
  • 15
  • 7
-1
votes
1 answer

Simpson Integration to Python : Can't get the output as expected

I have already implement this even() & simpson(), but can't get the desired output. Secondly getting error ([lambda x:1/x, 1, 11, 6]]) ZeroDivisionError: division by zero, can't understand this error import math import matplotlib import…
Raza
  • 19
  • 4
-1
votes
1 answer

Gelman.diag output decimal places

How can I change the number of decimal places my PSRF is outputted as in the gelman.diag function? enter image description here
-1
votes
1 answer

Different random weight initialization leading to different performances

I'm training a 3D U-Net on an EM dataset of a brain. The objective is to segment neurons in it. During the experiments, I've noticed, different random initialization of the network leads to different performances. I evaluate the performance based on…
-1
votes
3 answers

geometric series in c, wrong solution

I'm getting a wrong solution for this series: (-1/4)^(n+1)*(z-1)^n For |z-1|<4 should the series tend to converge to -1/3+z For z=0.5 should be the solution -2/7, but if i try to plot with c, the result is 0... Here is my code: #include…
1 2 3
20
21