
lo126 <- pp.loess(126, formula=ret ~ time)
lo126perm <- array(NA, c(length(spxret), 100), dimnames=list(names(spxret),NULL))
for(i in 1:100) lo126perm[,i] <- pp.loess(126, formula=sample(ret) ~ time)$fitted
lo63 <- pp.loess(63, formula=ret ~ time)
lo63perm <- array(NA, c(length(spxret), 100), dimnames=list(names(spxret),NULL))
for(i in 1:100) lo63perm[,i] <- pp.loess(63, formula=sample(ret) ~ time)$fitted
lo252 <- pp.loess(252, formula=ret ~ time)
lo252perm <- array(NA, c(length(spxret), 100), dimnames=list(names(spxret),NULL))
for(i in 1:100) lo252perm[,i] <- pp.loess(252, formula=sample(ret) ~ time)$fitted
lo1000 <- pp.loess(1000, formula=ret ~ time)
lo1000perm <- array(NA, c(length(spxret), 100), dimnames=list(names(spxret),NULL))
for(i in 1:100) lo1000perm[,i] <- pp.loess(1000, formula=sample(ret) ~ time)$fitted

losym1000 <- pp.loess(1000, formula=ret ~ time, family='symmetric')
losym1000perm <- array(NA, c(length(spxret), 100), dimnames=list(names(spxret),NULL))
for(i in 1:100) losym1000perm[,i] <- pp.loess(1000, formula=sample(ret) ~ time, family="symmetric")$fitted
losym252 <- pp.loess(252, formula=ret ~ time, family='symmetric')
losym126 <- pp.loess(126, formula=ret ~ time, family='symmetric')
losym63 <- pp.loess(63, formula=ret ~ time, family='symmetric')
losym252perm <- array(NA, c(length(spxret), 100), dimnames=list(names(spxret),NULL))
losym126perm <- array(NA, c(length(spxret), 100), dimnames=list(names(spxret),NULL))
losym63perm <- array(NA, c(length(spxret), 100), dimnames=list(names(spxret),NULL))
for(i in 1:100) losym252perm[,i] <- pp.loess(252, formula=sample(ret) ~ time, family="symmetric")$fitted
for(i in 1:100) losym126perm[,i] <- pp.loess(126, formula=sample(ret) ~ time, family="symmetric")$fitted
for(i in 1:100) losym63perm[,i] <- pp.loess(63, formula=sample(ret) ~ time, family="symmetric")$fitted

cut.lo63.57 <- lo63$fitted < -.0057
cut.lo126.45 <- lo126$fitted < -.0045
cut.lo252.28 <- lo252$fitted < -.0028
cut.lo1000.09 <- lo1000$fitted < -.0009
cut.lr63.35 <- losym63$fitted < -.0035
cut.lr126.20 <- losym126$fitted < -.0020
cut.lr252.16 <- losym252$fitted < -.0016
cut.lr1000.05 <- losym1000$fitted < -.0005



