hzTransitionProbabilities: Horizon Transition Probabilities

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Functions for creating and working with horizon (sequence) transition probability matrices.

Usage

1
2
3
4
5
hzTransitionProbabilities(x, name, loopTerminalStates = FALSE)

genhzTableToAdjMat(tab)

mostLikelyHzSequence(mc, t0, maxIterations=10)

Arguments

x

A SoilProfileCollection object.

name

A horizon level attribute in x that names horizons.

loopTerminalStates

should terminal states loop back to themselves? This is useful when the transition probability matrix will be used to initialize a markovchain object. See examples below.

tab

A cross-tabulation relating original horizon designations to new, generalized horizon designations.

mc

A markovchain object, initialized from a horizon sequence transition probability matrix with looped terminal states.

t0

Time-zero: a label describing an initial state within a markovchain object.

maxIterations

the maximum number of iterations when search for the most-likely horizon sequence

Details

Details and related tutorial pending...

Value

The function hzTransitionProbabilities returns a square matrix of transition probabilities. See examples.

The function genhzTableToAdjMat returns a square adjacency matrix. See examples.

The function mostLikelyHzSequence returns the most likely sequence of horizons, given a markovchain object initialized from horizon transition probabilities and an initial state, t0. See examples.

Note

These functions are still experimental and subject to change.

Author(s)

D.E. Beaudette

See Also

generalize.hz

Examples

 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
data(sp4)
depths(sp4) <- id ~ top + bottom

# horizon transition probabilities: row -> col transitions
(tp <- hzTransitionProbabilities(sp4, 'name'))


## Not run: 
## plot TP matrix with functions from sharpshootR package
library(sharpshootR)
par(mar=c(0,0,0,0), mfcol=c(1,2))
plot(sp4)
plotSoilRelationGraph(tp, graph.mode = 'directed', edge.arrow.size=0.5)

## demonstrate genhzTableToAdjMat usage
data(loafercreek, package='soilDB')

# convert contingency table -> adj matrix / TP matrix
tab <- table(loafercreek$hzname, loafercreek$genhz)
m <- genhzTableToAdjMat(tab)

# plot 
par(mar=c(0,0,0,0), mfcol=c(1,1))
plotSoilRelationGraph(m, graph.mode = 'directed', edge.arrow.size=0.5)


## demonstrate markovchain integration
library(markovchain)
tp.loops <- hzTransitionProbabilities(sp4, 'name', loopTerminalStates = TRUE)

# init new markovchain from TP matrix
mc <- new("markovchain", states=dimnames(tp.loops)[[1]], transitionMatrix = tp.loops)

# simple plot
plot(mc, edge.arrow.size=0.5)

# check absorbing states
absorbingStates(mc)

# steady-state:
steadyStates(mc)

## End(Not run)

aqp documentation built on May 2, 2019, 4:51 p.m.