[fbf06f]: / partyMod / R / zInitMethods.R

Download this file

87 lines (75 with data), 3.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# $Id$
setMethod(f = "initialize", signature = "ExpectCovar",
definition = function(.Object, pq = 1) {
pq <- as.integer(pq)
.Object@expectation <- rep(0, pq)
.Object@covariance <- matrix(0, nrow = pq, ncol = pq)
.Object@dimension <- as.integer(pq)
.Object
}
)
setMethod(f = "initialize", signature = "ExpectCovarInfluence",
definition = function(.Object, q) {
.Object@expectation <- rep(0, q)
.Object@covariance <- matrix(0, nrow = q, ncol = q)
.Object@dimension <- as.integer(q)
.Object@sumweights <- log(1) ### was as.double(0.0) but
### there seem to be protection issues
.Object
}
)
setMethod(f = "initialize", signature = "LinStatExpectCovar",
definition = function(.Object, p, q) {
.Object@expectation <- rep(0, p*q)
.Object@covariance <- matrix(0, nrow = p*q, ncol = p*q)
.Object@dimension <- p*q
.Object@linearstatistic <- rep(0, p*q)
.Object@expcovinf <- new("ExpectCovarInfluence", q)
.Object
}
)
setMethod(f = "initialize", signature = "LinStatExpectCovarMPinv",
definition = function(.Object, p, q) {
.Object@expectation <- rep(0, p*q)
.Object@covariance <- matrix(0, nrow = p*q, ncol = p*q)
.Object@MPinv <- matrix(0, nrow = p*q, ncol = p*q)
.Object@rank <- as.double(0.0)
.Object@svdmem <- new("svd_mem", p*q)
.Object@dimension <- p*q
.Object@linearstatistic <- rep(0, p*q)
.Object@expcovinf <- new("ExpectCovarInfluence", q)
.Object
}
)
setMethod(f = "initialize", signature = "svd_mem",
definition = function(.Object, p) {
if (p <= 0) stop(sQuote("p"), " is not a positive integer")
.Object@p <- as.integer(p)
.Object@method <- "dgesdd"
.Object@jobu <- "S"
.Object@jobv <- ""
.Object@u <- matrix(0, nrow = p, ncol = p)
.Object@v <- matrix(0, nrow = p, ncol = p)
.Object@s <- rep(0, p)
.Object
}
)
setMethod(f = "initialize", signature = "VariableFrame",
definition = function(.Object, nobs, ninputs) {
if (nobs <= 0 || ninputs <= 0) stop(sQuote("nobs"), " or ",
sQuote("ninputs"), " is not a positive integer")
.Object@nobs <- as.integer(nobs)
.Object@ninputs <- as.integer(ninputs)
.Object@variables <- vector(mode = "list", length = ninputs)
.Object@transformations <- vector(mode = "list", length = ninputs)
.Object@is_nominal <- vector(mode = "logical", length = ninputs)
.Object@is_ordinal <- vector(mode = "logical", length = ninputs)
.Object@ordering <- vector(mode = "list", length = ninputs)
.Object@levels <- vector(mode = "list", length = ninputs)
.Object@scores <- vector(mode = "list", length = ninputs)
.Object@has_missings <- vector(mode = "logical", length = ninputs)
.Object@whichNA <- vector(mode = "list", length = ninputs)
# .Object@jointtransf <- matrix()
.Object
}
)