File: csi-class.Rd

package info (click to toggle)
r-cran-kernlab 0.9-33-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,216 kB
  • sloc: cpp: 6,011; ansic: 935; makefile: 2
file content (107 lines) | stat: -rw-r--r-- 2,860 bytes parent folder | download | duplicates (5)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
\name{csi-class}
\docType{class}
\alias{csi-class}
\alias{Q}
\alias{R}
\alias{predgain}
\alias{truegain}
\alias{diagresidues,csi-method}
\alias{maxresiduals,csi-method}
\alias{pivots,csi-method}
\alias{predgain,csi-method}
\alias{truegain,csi-method}
\alias{Q,csi-method}
\alias{R,csi-method}

\title{Class "csi"}

\description{The reduced Cholesky decomposition object}

\section{Objects from the Class}{Objects can be created by calls of the form \code{new("csi", ...)}.
  or by calling the  \code{csi} function.}

\section{Slots}{
  \describe{
    
    \item{\code{.Data}:}{Object of class \code{"matrix"} contains
      the decomposed matrix}

    \item{\code{pivots}:}{Object of class \code{"vector"} contains
      the pivots performed}

    \item{\code{diagresidues}:}{Object of class \code{"vector"} contains
      the diagonial residues}

    \item{\code{maxresiduals}:}{Object of class \code{"vector"} contains
      the maximum residues}

    \item{predgain}{Object of class \code{"vector"} contains
      the predicted gain before adding each column}

    \item{truegain}{Object of class \code{"vector"} contains
      the actual gain after adding each column}

    \item{Q}{Object of class \code{"matrix"} contains
      Q from the QR decomposition of the kernel matrix}

    \item{R}{Object of class \code{"matrix"} contains
      R from the QR decomposition of the kernel matrix}
    
  }
}

\section{Extends}{
Class \code{"matrix"}, directly.
}
\section{Methods}{
  \describe{
    
    \item{diagresidues}{\code{signature(object = "csi")}: returns
      the diagonial residues}

    \item{maxresiduals}{\code{signature(object = "csi")}: returns
      the maximum residues}

    \item{pivots}{\code{signature(object = "csi")}: returns
      the pivots performed}

    \item{predgain}{\code{signature(object = "csi")}: returns
      the predicted gain before adding each column}

    \item{truegain}{\code{signature(object = "csi")}: returns
      the actual gain after adding each column}

    \item{Q}{\code{signature(object = "csi")}: returns
      Q from the QR decomposition of the kernel matrix}

    \item{R}{\code{signature(object = "csi")}: returns
      R from the QR decomposition of the kernel matrix}
  }
}

\author{Alexandros Karatzoglou\cr \email{alexandros.karatzoglou@ci.tuwien.ac.at}}

\seealso{ \code{\link{csi}}, \code{\link{inchol-class}}}

\examples{
data(iris)

## create multidimensional y matrix
yind <- t(matrix(1:3,3,150))
ymat <- matrix(0, 150, 3)
ymat[yind==as.integer(iris[,5])] <- 1

datamatrix <- as.matrix(iris[,-5])
# initialize kernel function
rbf <- rbfdot(sigma=0.1)
rbf
Z <- csi(datamatrix,ymat, kernel=rbf, rank = 30)
dim(Z)
pivots(Z)
# calculate kernel matrix
K <- crossprod(t(Z))
# difference between approximated and real kernel matrix
(K - kernelMatrix(kernel=rbf, datamatrix))[6,]

}
\keyword{classes}