-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfa9f92
commit d066f21
Showing
23 changed files
with
284 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
check.yval <- function(y,Rho) { | ||
check.yval <- function(y,Rho,warn=TRUE) { | ||
yval <- unique(unlist(y)) | ||
rn <- rownames(Rho) | ||
fname <- as.character(sys.call(-1))[1] | ||
if(is.na(fname)) fname <- "call from the command line" | ||
if(is.null(row.names(Rho))) { | ||
yval <- as.numeric(yval) | ||
OK <- all(yval%in%(1:nrow(Rho))) | ||
if(!OK) stop(paste("In ",fname,". The values of \"y\" must be in ", | ||
"\"1:nrow(Rho)\".\n",sep=""),call.=FALSE) | ||
} else { | ||
yval <- as.character(yval) | ||
OK <- all(yval%in%row.names(Rho)) | ||
if(!OK) stop(paste("In ",fname,". The values of \"y\" must be in ", | ||
"\"row.names(Rho)\".\n",sep=""),call.=FALSE) | ||
if(!is.null(rn)) { | ||
if(all(yval %in% rn)) return(Rho) | ||
stop(paste("In ",fname," some y values do not match the row names", | ||
"of \"Rho\".\n",sep=""),call.=FALSE) | ||
} | ||
return(invisible()) | ||
if(length(yval) != nrow(Rho)) | ||
stop(paste("In ",fname," wrong number of rows in \"Rho\".\n",sep=""),call.=FALSE) | ||
whinge <- paste("Matrix \"Rho\" has no row names. Assuming that the\n", | ||
"rows of Rho correspond to the sorted unique values of \"y\".\n") | ||
if(warn) warning(whinge) | ||
nval <- as.numeric(yval) | ||
yval <- if(!any(is.na(nval))) yval[order(nval)] else sort(yval) | ||
rownames(Rho) <- yval | ||
return(Rho) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
fitted.hmm.discnp <- function(object,...) { | ||
y <- object$y | ||
if(is.null(y)) stop("Observations \"y\" were not kept.\n") | ||
if(!is.list(y)) y <- list(y) | ||
if(!is.numeric(y[[1]])) | ||
stop("Observations are not numeric; fitted values make no sense.\n") | ||
if(!all(sapply(y,is.numeric))) | ||
stop(paste("Some observations are not numeric;\n", | ||
"fitted values make no sense.\n")) | ||
sp(y,object,means=TRUE)$means | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Oops, something went wrong.