Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revision Functionality #20

Closed
andykrause opened this issue Feb 6, 2018 · 1 comment
Closed

Revision Functionality #20

andykrause opened this issue Feb 6, 2018 · 1 comment
Assignees

Comments

@andykrause
Copy link
Owner

Ability to calculate the revision-ness.

Need to happen in steadily growing, forward prediction type environment. There is no 'agreed' on method here. Check the literature.

Previous code used:


revisionWrap <- function(indexid.data,
                         index.data){
  
  ind.list <- names(table(indexid.data$usid))
  ind.cap <- list()
  
  for(qq in 1:length(ind.list)){
    
    ind.i <- index.data[grep(ind.list[[qq]], index.data$usid), ]
    
    rev.list <- list()
    for(i in 2:120){
      rev.list[[i-1]] <- sd(ind.i[ind.i$time==i,]$value)
    }
    ind.cap[[qq]] <- mean(unlist(rev.list), na.rm=TRUE)
  }
  names(ind.cap) <- ind.list
  
  ind.df <- data.frame(usid=names(ind.cap),
                       rev=unlist(ind.cap))
  
  return(ind.df)
  
}

@andykrause andykrause self-assigned this Feb 6, 2018
@andykrause
Copy link
Owner Author

Should this happen automatically in a time-wrap situation? Or as a wrapper thereoef?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant