Displaying 2 results from an estimated 2 matches for "tpr2".
Did you mean:
tpr
2017 Jun 20
0
translate formula into R code
...000 at gmail.com> wrote:
>Hi,
>
>well, I know how to use for-loop and create vectors. That is not the
>point. However, implementing this code is - at least for me - not as
>trivial as it seems since you have changes in the signs as well as
>changes in multiplication by TPR1 and TPR2. I spent hours trying to
>get this peace of code sorted out but I just don't get it working. I
>managed to calculate the first two values L2 and L3 but no more. Since
>I am not advanced in R, I was asking for help with basic functions
>which I do know already.
>
>Yes I changed...
2017 Jun 20
3
translate formula into R code
Hello,
I am trying to implement the following formula using for loops and vectors.
I am sure you can use some fancy R code to solve this but I would like to
keep it simple and stick to for and vector/array if that is possible.
TP = 200;
RL = 50;
TPR1 = TP - RL;
TPR2 = TP + RL;
PPO = 0;
LSS = 0.1;
counter = 1;
for(i in res) {
# Even
if(counter %% 2 == 1) {
ls = abs((sum(LSS)* TP)) / (TPR1 - PPO);
LSS = c(LSS,ls);
}
# Odd
if(counter %% 2 == 0) {
ls = abs((sum(LSS)* TPR2)) / (TP - PPO);
LSS = c(LSS,ls);
}
}
-------------- next...