Displaying 1 result from an estimated 1 matches for "adjrsqrfunc".
2010 Jul 19
0
Calculation optimization advice needed
...inations(14, 3)
# Elements of matrix are whole vectors of factors' returns each row
corresponds to the combination of factors from matrix "factors"
AAA <- matrix(as.list(factors.r[, t(fact)]), nrow = 364, ncol = 3)
# Function to calculate R-squared for the linear regression model
AdjRsqrFunc <- function(x, a){
summary(lm(a ~ x[[1]] + x[[2]] + x[[3]]))$adj.r.squared
}
max.seq <- NA
# I need to check all the combinations of factors and find the model
which brings the highest adjusted R-squared
# for every simulation out of 100
for (i in 1:100){
xyz &...