Commit 3f4678bf authored by Florian Gerber's avatar Florian Gerber

version 2.0-5 (CAGEO)

parent a914a7db
^.*\.tar.gz$
commit 3f4033bffe257dd62b4408d420dff6fd12bbceda
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Mon Oct 26 16:04:03 2015 +0100
JL bugfix
commit 749a73a08b4fe4bf2a26c0bb3fbcc54e2418192b
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Fri Oct 23 12:53:08 2015 +0200
version 1.2.1
commit f8433f721291cce4dcd9a62519ebbd55d90a56f0
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Sep 1 21:28:47 2015 +0200
add technical vignette
commit 74da80bc1e66b51c553fcfd3ff05a34131133f8b
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 25 11:36:02 2015 +0200
Correct headers
commit f3da9a367c1c24a39feae847007a0e6476a57159
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 25 11:04:20 2015 +0200
addressing checks p2
commit 165b06bbe2b7179f3f11f6eb2866f0979ba888a1
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 25 11:03:36 2015 +0200
addressing checks
commit a291c56ed237afc1f4125ff7c9dc87132af64081
Author: Florian Gerber <florian.gerber@math.uzh.ch>
Date: Wed Jan 21 16:16:58 2015 +0100
Changed names of jss15 demo, tests and vignette
renamed: spam/vignettes/v63c01-vignette.pdf -> spam/vignettes/jss15.pdf
renamed: spam/vignettes/v63c01-vignette.pdf.asis -> spam/vignettes/jss15.pdf.asis
deleted: spam/tests/jss_areal_counts.R
deleted: spam/tests/jss_areal_counts.Rout.save
commit 6e809a091014760db7d164d6e37fa6e9f4ac59d3
Author: Florian Gerber <florian.gerber@math.uzh.ch>
Date: Mon Jan 19 22:43:44 2015 +0100
Add citation
modified: spam/inst/CITATION
commit cb090dd4365455f6fdd32ce647aedcfd526c0941
Author: Florian Gerber <florian.gerber@math.uzh.ch>
Date: Mon Jan 19 12:49:05 2015 +0100
- add vignette: JSS-Areal Cound Data
- add demos: jss-BYM.R and jss-Lereux.R
- add corresponding tests
- spam/tests/demo_article-jss-Leroux.R uses the R package 'trucdist'.
Is this a problem?
new file: spam/demo/jss-BYM.R
new file: spam/demo/jss-Leroux.R
new file: spam/tests/demo_article-jss-BYM.R
new file: spam/tests/demo_article-jss-Leroux.R
new file: spam/vignettes/v63c01-vignette.pdf
new file: spam/vignettes/v63c01-vignette.pdf.asis
commit b56cd794f8f9dab2b7544f014d8a42bf050db193
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Sun Oct 19 17:57:50 2014 +0200
DESCRIPTION and NAMESPACE
commit 4df6020434afbcc6716c5a7df0ed848bd587e8d8
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Sun Oct 19 07:41:13 2014 +0200
DUP removal
commit 3823eb2a93ac5466ec368de81a294c63fd9c8ddd
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Sep 9 12:53:07 2014 +0200
Addressing approach
commit fcc8e87858c7b77b3ef038b30b229bbeb2bafeca
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Sat Sep 6 22:15:47 2014 +0200
Getting towards CRAN release
commit 4f7ddb20efaf89efea79eaf03dfb411f293c36c4
Merge: 55a7ace 764935f
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Sat Sep 6 21:32:58 2014 +0200
Merge remote-tracking branch 'origin/tests_jss_areal_mapping'
commit 55a7acee168a7bb260e90a32a60107c21e306f67
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Sat Sep 6 14:35:30 2014 +0200
Help adjusts
commit 764935f9f09336c07b316b3ccce923c94ca4d214
Author: Florian Gerber <florian.gerber@math.uzh.ch>
Date: Thu Sep 4 10:55:54 2014 +0200
test script for BYM sampler of JSS-disease paper
- inclusion of Leroux sampler not possible. depends on package:trucdist
new file: tests/jss_areal_counts.R
commit 9bf9597b6440aa40575d37544fad1a79e3546e0e
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Wed Sep 3 23:43:33 2014 +0200
corrected update
commit 8ad11ea5c7eaddc8595716bdb5906eebd0cdec58
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Thu Aug 28 12:32:09 2014 +0200
Coercion and Wrappers... set to 0.80
commit 7fc3c8aa594195a11f0002a9bf73f5ebf0ec8452
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 26 16:57:09 2014 +0200
coerce functions, ifelse works!
commit a7177a6dce0d3c4e4642c303ec8c21040462d7ee
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Thu Aug 21 21:21:10 2014 +0200
first version of 0.60-0
commit 0cd661154bc24ce7c05a25b87d1781bfd99ac5bc
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Wed Aug 13 16:06:28 2014 +0200
final fixes for freeze of version 0.50-0
commit d85f2d2f4f181ae066c248774081edb0de4f7d96
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Wed Aug 13 13:33:25 2014 +0200
Test to pass non finite numbers through some fortran routines
commit 55391e836d2f467b013b781fdddc2b97c281a837
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Wed Aug 13 10:11:48 2014 +0200
First stab at coherent 'Math' group handling
commit 408115340155aac74e07501243eb27b34bdfc6eb
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 12 21:32:26 2014 +0200
first stab at coherent 'dim' and structure based operators
commit 005135896e0f4f516fdbaa0d22f3e8580b24c808
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 12 10:47:37 2014 +0200
Bugfix assignment
commit 36024017dfc777baf510c6780fe5aecbf230c4e6
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 12 10:35:47 2014 +0200
constructor: rowpointers part II
commit 308101b2ee6311f33e783f6c6f09c2b4f444984d
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 12 10:34:55 2014 +0200
constructor: rowpointers
commit 869bf80ef88bc93e343f99bc062a6bc5aa59b258
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 12 07:15:16 2014 +0200
crossprod help file and additional todo
commit cdab58b0a625eacff0c4d9e3855b41349016324c
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Tue Aug 12 07:09:44 2014 +0200
News and Rd adjustment
commit 775bf4c3ba574f8a0d89669eb0eaebfd8c06069f
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Mon Aug 11 21:24:23 2014 +0200
added crossprod and eliminated [d,i]check
commit 78b101b99739be585f2c4c27e37733df32b7b088
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Wed Jun 11 20:35:48 2014 +0200
Fixed version number
commit f21c8dfed9903a761c8306ba1cbe7db56a137136
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Wed Jun 11 20:33:13 2014 +0200
Eliminating nested structure
commit 95fcaf89166c0029f3933bdcce27fa25eeb80b4e
Author: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Date: Wed Jun 11 20:27:33 2014 +0200
first commit
Package: spam
Version: 2.0-05
Date: 2016-11-19
Authors@R: c(person("Reinhard", "Furrer", role = c("aut", "cre"),
email = "reihard.furrer@math.uzh.ch"),
person("Florian", "Gerber", role = "ctb",
email = "florian.gerber@math.uzh.ch"),
person("Kaspar", "Moesinger", role = "ctb",
email = "kaspar.moesinger@gmail.com"))
Author: Reinhard Furrer [aut, cre], Florian Gerber [ctb], Kaspar Moesinger [ctb]
Maintainer: Reinhard Furrer <reinhard.furrer@math.uzh.ch>
Depends:
R (>= 3.1),
dotCall64,
grid,
methods
Suggests:
spam64,
fields,
SparseM,
Matrix,
testthat,
R.rsp,
truncdist
VignetteBuilder: R.rsp
Description: Set of functions for sparse matrix algebra.
Differences with SparseM/Matrix are:
(1) we only support (essentially) one sparse matrix format,
(2) based on transparent and simple structure(s),
(3) tailored for MCMC calculations within GMRF.
(4) S3 and S4 like-"compatible" ... and it is fast.
LazyLoad: Yes
LazyData: Yes
License: LGPL-2
Title: SPArse Matrix
URL: http://www.math.uzh.ch/furrer/software/spam/
\ No newline at end of file
useDynLib(spam)
import(grid)
import("dotCall64")
importFrom("grDevices", "gray", "heat.colors")
importFrom("graphics",
"axis", "box", "image.default", "par", "points", "polygon", "text")
importFrom("methods",
"callGeneric", "is", "new", "slot<-", "validObject")
importFrom("stats", "optim", "rnorm", "runif", "var")
importFrom("utils", "help")
# Next two paragraphs are from Matrix....
# Currently, group generics need to be explicitly imported (Bug?):
importFrom("methods", #Arith,Compare,
Math, Math2, Summary#, Complex
)
S3method("all.equal","spam")
#S3method("as.matrix.csr","spam")
S3method("as.matrix","spam")
S3method("as.vector","spam")
S3method("determinant","spam")
S3method("determinant","spam.chol.NgPeyton")
S3method("chol","spam")
S3method("diff","spam")
S3method("dim<-","spam")
S3method("head","spam")
S3method("image","spam")
S3method("isSymmetric","spam")
S3method("plot","spam")
S3method("print","spam")
S3method("print","spam.chol.NgPeyton")
S3method("solve","spam")
#S3method("subset_rows","spam")
S3method("subset","spam")
S3method("summary","spam")
S3method("summary","spam.chol.NgPeyton")
S3method("t","spam")
S3method("tail","spam")
S3method("update","spam.chol.NgPeyton")
# Generic functions
export(
"todo",
"spam.history",
"is.spam",
"spam.version",
"spam.Version",
"validate_spam",
"nearest.dist",
"spam_rdist",
"spam_rdist.earth",
"as.spam.matrix",
"as.spam.numeric",
"as.spam.spam",
"as.spam.dist",
"as.spam.chol.NgPeyton",
"as.spam.list",
"as.vector.spam",
"as.matrix.spam",
"spam.list",
"spam.numeric",
"diag.of.spam",
"diag.spam",
"spam_diag",
"diag<-.spam",
"diag.spam<-",
"rbind.spam",
"cbind.spam",
"upper.tri.spam",
"lower.tri.spam",
"t.spam",
"dim<-.spam",
"pad<-.spam",
"isSymmetric.spam",
"all.equal.spam",
"kronecker.default",
"kronecker.spam",
"diff.spam",
"circulant.spam",
"toeplitz.spam",
"determinant.spam",
"determinant.spam.chol.NgPeyton",
"chol.spam",
"solve.spam",
"forwardsolve.spam",
"backsolve.spam",
"update.spam.chol.NgPeyton",
"norm.spam",
"plot.spam",
"display.spam",
"image.spam",
"print.spam",
"summary.spam",
"print.spam.chol.NgPeyton",
"summary.spam.chol.NgPeyton",
"apply.spam",
"rmvnorm.spam",
"rmvnorm.canonical",
"rmvnorm.prec",
"rmvnorm.const",
"rmvnorm.canonical.const",
"rmvnorm.prec.const",
"precmat",
"precmat.RW1",
"precmat.RW2",
"precmat.RWn",
"precmat.season",
"precmat.IGMRFreglat",
"precmat.IGMRFirreglat",
"precmat.GMRFreglat",
"covmat",
"cov.exp",
"cov.sph",
"cov.nug",
"cov.wu1",
"cov.wu2",
"cov.wu3",
"cov.wend1",
"cov.wend2",
"cov.mat",
"rowSums.spam",
"colSums.spam",
"rowMeans.spam",
"colMeans.spam",
"head.spam",
"tail.spam",
"chol2inv.spam",
"mle.spam",
"mle.nomean.spam",
"neg2loglikelihood.spam",
"mle",
"mle.nomean",
"neg2loglikelihood",
"bdiag.spam",
"var.spam",
"eigen.spam",
"bandwidth",
# ".spam.matmul.mat",
# ".spam.matmul",
# "solve.spam.mat",
# "solve.spam.dummy",
"subset.spam",
# "subset_rows.spam",
"triplet",
"as.spam.matrix.csr",
# "as.matrix.csr.spam",
"as.dgRMatrix.spam",
"as.dgCMatrix.spam",
"as.spam.dgRMatrix",
"as.spam.dgCMatrix",
"read.MM",
"read.HB",
"powerboost",
"permutation.spam",
"crossprod.spam",
"tcrossprod.spam",
"map.landkreis",
"adjacency.landkreis",
"germany.plot",
#"germany.info",
"grid_trace2",
"grid_zoom",
"rowpointers<-",
"entries<-",
"colindices<-",
"dimension<-",
"cleanup"
# "backsolve"
)
# export the two classes
exportClasses("spam",
"spam.chol.NgPeyton")
exportMethods(
"Math",
"Math2",
"Summary",
# "show",
"print",
"image",
"display",
"spam",
"as.spam",
"isSymmetric",
"all.equal",
"summary",
"length",
"length<-",
"c",
"dim",
"dim<-",
"pad<-",
"rbind",
"cbind",
"as.spam",
"spam",
"as.vector",
"as.matrix",
"determinant",
"t",
"diag",
"diag<-",
"diag<-",
"upper.tri",
"lower.tri",
"norm",
"rowSums",
"rowMeans",
"colSums",
"colMeans",
"head",
"tail",
"chol",
"ordering",
"forwardsolve",
"backsolve",
"solve",
"chol2inv",
"kronecker",
"permutation",
"crossprod",
"tcrossprod",
"[",
"[<-",
"%*%",
"%d*%",
"%d+%",
"-",
"+",
"*",
"/",
"&",
"|")
# This is file ../spam/R/apply.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
# primitive apply function.
apply.spam <- function(X, MARGIN=NULL, FUN, ...){
if (!is.spam(X)) stop("\"X\" must be of type \"spam\"")
if (!is.null(dimnames(X))) warning("dimnames are stripped")
FUN <- match.fun(FUN)
d <- dim(X)
d.ans <- d[MARGIN]
dn.ans <- NULL
if (is.null(MARGIN)|| length(MARGIN)==2){
ans <- FUN(X@entries,...)
if (length( ans)!=length( X@entries))
stop("\"FUN\" does not return an appropriate vector")
if (any(!is.finite(ans))) {
warning("\"NA/NaN/Inf\" coerced to zero")
ans[!is.finite(ans)] <- 0
}
X@entries <- ans
return(X)
}
ans <- vector("list",d.ans)
if (MARGIN==1) {
for (i in 1:d[1])
ans[[i]] <- FUN(X[i,,drop=F]@entries,...)
} else if (MARGIN==2) {
for (i in 1:d[2])
ans[[i]] <- FUN(X[,i,drop=F]@entries,...)
} else stop("\"MARGIN\" must be 1, 2 or c(1,2)")
# Block very similar to "apply"
d2 <- prod(d.ans)
ans.list <- is.recursive(ans[[1]])
l.ans <- length(ans[[1]])
ans.names <- names(ans[[1]])
if (!ans.list){
ans.list <- any(unlist(lapply(ans, length)) != l.ans)
}
if (!ans.list && length(ans.names)) {
all.same <- sapply(ans, function(x) identical(names(x), ans.names))
if (!all(all.same))
ans.names <- NULL
}
len.a <- if (ans.list) d2 else length(ans <- unlist(ans, recursive = FALSE))
if (length(MARGIN) == 1 && len.a == d2)
return(ans)
if (len.a == d2)
return(array(ans, d.ans))
if (len.a > 0 && len.a%%d2 == 0) {
dn.ans <- vector(mode = "list", length(d.ans))
dn.ans <- c(list(ans.names), dn.ans)
return(array(ans, c(len.a%/%d2, d.ans), if (!all(sapply(dn.ans,
is.null))) dn.ans))
}
return(ans)
}
# This is file ../spam/R/constructors.R
# This file is part of the spam package,
# http://www.math.uzh.ch/furrer/software/spam/
# by Reinhard Furrer [aut, cre], Florian Gerber [ctb]
"rowpointers<-" <- function(x, value) {
dimx <- x@dimension
nnz1 <- x@rowpointers[dimx[1]+1]
diffvalue <- diff(value)
if ( any(!is.finite(value)))
stop("row pointers should be postive integers.")
if (!identical( length(x@rowpointers), length(value)))
stop("wrong length of row pointers in `rowpointers<-`.", call.=FALSE)
if (any(diffvalue<0))
stop("row pointers are not monotone increasing in `rowpointers<-`.", call.=FALSE)
if (any(diffvalue>dimx[2]))
stop("row pointers have too large leaps in `rowpointers<-`.", call.=FALSE)
if (value[1]<1)
stop("first element of row pointers is < 1 in `rowpointers<-`.", call.=FALSE)
if(value[dimx[1]+1] != nnz1)
stop("last element of row pointers does not conform in `rowpointers<-`.", call.=FALSE)
x@rowpointers <- as.integer(value)
x
}
"colindices<-" <- function(x, value) {
dimx <- x@dimension
if ( any(!is.finite(value)))
stop("column indices should be postive integers in `colindices<-`.", call.=FALSE)
if ( any(value<1) | any(value> dimx[2]))
stop("column indices exceed dimension `colindices<-`.", call.=FALSE)
diffcolindices <- diff(value) # positive values within each row
if (all(diff(x@rowpointers)>1) && length(diffcolindices)>0)
# only if we have multiple values
if (identical( dimx[1], 1L)) {
if ( any(diffcolindices<1))
stop("column indices are not ordered `colindices<-`.", call.=FALSE)
} else {
if ( any(diffcolindices[-(x@rowpointers[2:dimx[1]]-1)]<1))
stop("column indices are not ordered `colindices<-`.", call.=FALSE)
}
x@colindices <- as.integer(value)
x
}
"entries<-" <- function(x, value) {
if (!identical( length(x@entries), length(value)))
stop("wrong length in `entries<-`.", call.=FALSE)
if (!getOption("spam.NAOK")) {
if (any(!is.finite(value)))
stop("\"NA/NaN/Inf\" not allowed in `entries<-`.", call.=FALSE)