Displaying 1 result from an estimated 1 matches for "gam_sum".
2010 Jun 17
1
sapply or apply
...bt <- c(24.96874, 19.67861, 23.51001, 19.86868); round(bt,2)
alp <- c(2.724234, 3.914649, 3.229146, 3.120719); round(alp,2)
bt_min <- min(bt) ; bt_min
p <- alp_sum ; p
t <- 50
t1 <- t+1
#first get the sum over the eigenvalues for a particular power i
gam_sum <- function(alp,bt,bt_min,i) {alp*(1-bt_min/bt)^i}
gam_sum(alp,bt,bt_min,1)
0.57718379+ 0.00000000+ 0.52625031+ 0.02985377 = 1.133288
term <- function(i,alp,bt,bt_min) {sum(sapply(bt,gam_sum , alp,bt_min,i))}
> term (1,alp,bt,bt_min)
[1] -1817.765
I should get the value using term (...