search for: simple_linear_regress

Displaying 2 results from an estimated 2 matches for "simple_linear_regress".

2009 Jul 08
0
typo in ts detrending implementation in spec.pgram?
...lt;- 1L:N - (N + 1)/2 sumt2 <- N * (N^2 - 1)/12 for (i in 1L:ncol(x)) x[, i] <- x[, i] - mean(x[, i]) - sum((x[, i]-mean(x[,i]) * t) * t/sumt2 } Note x[, i]-mean(x[,i]) instead of x[,i] only as in repository. Here is a quick reference http://en.wikipedia.org/wiki/Simple_linear_regression#Estimating_the_regression_line . Note $\hat b$ there. It has not x in summation, but x-mean(x). Perhaps, the even better solution would be resid(lm(x[,i] ~ seq(along = x[,i]))) . See http://tolstoy.newcastle.edu.au/R/help/05/01/10115.html Mikhail
2009 Jul 09
2
How to Populate List
...lt;- 1L:N - (N + 1)/2       sumt2 <- N * (N^2 - 1)/12       for (i in 1L:ncol(x))             x[, i] <- x[, i] - mean(x[, i]) - sum((x[, i]-mean(x[,i]) * t) * t/sumt2     } Note x[, i]-mean(x[,i]) instead of x[,i] only as in repository. Here is a quick reference http://en.wikipedia.org/wiki/Simple_linear_regression#Estimating_the_regression_line . Note $\hat b$ there. It has not x in summation, but x-mean(x). Perhaps, the even better solution would be resid(lm(x[,i] ~ seq(along = x[,i]))) . See http://tolstoy.newcastle.edu.au/R/help/05/01/10115.html Mikhail ------------------------------ Message: 77...