File: ctmcd_vignette.R

package info (click to toggle)
r-cran-ctmcd 1.4.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 612 kB
  • sloc: cpp: 183; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 899 bytes parent folder | download
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
## ----setup, include=FALSE-----------------------------------------------------
library(knitr)

## -----------------------------------------------------------------------------
library(ctmcd)

## -----------------------------------------------------------------------------
data(tm_abs)

## -----------------------------------------------------------------------------
tm_rel=rbind((tm_abs/rowSums(tm_abs))[1:7,],c(rep(0,7),1))
gmda=gm(tm=tm_rel,te=1,method="DA")
gmda

## -----------------------------------------------------------------------------
gm0=matrix(1,8,8)
diag(gm0)=0
diag(gm0)=-rowSums(gm0)
gm0[8,]=0

gmem=gm(tm_abs,te=1,method="EM",gmguess=gm0)
gmem

## -----------------------------------------------------------------------------
ciem=gmci(gmem,alpha=0.05)

## -----------------------------------------------------------------------------
plot(gmem)