Skip to content
Prev 369894 / 398503 Next

translate formula into R code

Cc'd back to the list... always use reply-all.

You say res should have been LSS but LSS is a scalar so the for loop will only run once. What does a successful output look like for a sample input? How do you (we) know when success has been achieved?

In fact, what is the formula you want to implement?  If your code below is the definition of your "formula" then we are left with no destination. You either need to add a reference (paper citation?) or a set of inputs and corresponding outputs. 

Here are some resources that describe how to make a reproducible example [1][2][3]:

[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

[3] https://cran.r-project.org/web/packages/reprex/index.html