Displaying 1 result from an estimated 1 matches for "periodsnumb".
Did you mean:
periodsnumber
2011 Oct 22
1
Help w/an old R program I've rediscovered and want to make work
...pce369
## code begins below ##
# simulation parameters
LoopsNumber <- 10000 # number of iterations
WindowPeriod <- 20 # 20 unit returns
# data input area
data <- read.table("gspc.txt",header=T) #gspc.txt is a column of returns
under gspc header
# main
PeriodsNumber <- trunc(length(data$gspc)/WindowPeriod) # above will lead to
losing last few elements, but makes life easier
for (i in 1:LoopsNumber)
{
MCP <- sample(data$gspc, replace = FALSE) # resampling here without
replacement = permutations, not bootstrap
# computing period returns
MCP <- M...