I want to solve a non linear function in R using a loop for 71 years of data.
The equation looks like this:
y(i) == -1/k*log(1-k(xi - beta/alpha))
where xi
is the value present in the dataset.
For the first data the equation looks like this:
y(1) == -1/k*log(1-k(95 - beta/alpha))
where 95 is the first value of the list.
The value of K
, alpha
and beta
are already known.
Thank you!
I wrote a loop which will take the values from the list
for (i in list) {
y(i) <- -1/k* log(1-k(xi - beta/alpha))
print(y1)
}
Unfortunately its not working.