Hi all. I am trying to write an iteration loop using while loop but it returns nothing. I'm interested in returning b where depends on its previous value and the values of u and v which are also generated by this loop. I have the 1st value of u = mean
m <- 1
b <- mean(x)
#U <- 0
#V <- 1
while(m<=5){
print (b)
u = -(56/b) + (sum(x^2)/b^2)
print(u)
v = 56/b^2 - (2*sum(x^2)/b^3)
print(v)
b = b - (u/V)
}
There are some issues with your loop.
m, the condition of your loop is not modified within your loop, so the loop will never complete.
You also have a division by capital V though this is undefined and your lowecase v is unused