Skip to content
Snippets Groups Projects
Commit d6ae198f authored by S Luz's avatar S Luz
Browse files

Added man pages (still Initial release)

parent c0c78ad5
No related branches found
No related tags found
No related merge requests found
Showing
with 768 additions and 0 deletions
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{anonymise}
\alias{anonymise}
\alias{anonymise.vocaldia}
\alias{anonymise.default}
\title{anonymise: anonymise a vocalisation diagram}
\usage{
anonymise(vd)
\method{anonymise}{vocaldia}(vd)
\method{anonymise}{default}(vd)
}
\arguments{
\item{vd}{a vocalisation diagram (vocaldia object)}
}
\value{
a new vocaldia with speaker names replaced by variables
\eqn{s_1,...,s_n} s.t. \eqn{s_1} is the speaker who spoke the least
and \eqn{s_n} the one who did the most talking.
}
\description{
Anonymise a vocalisation diagram
}
\details{
"anonymise" a \code{vocaldia} turn taking probability matrix by
replacing speaker names by variables \eqn{s_1,...,s_n$ s.t. $s_1} is
the speaker who spoke the least and \eqn{s_n} the one who did the most
talking.
}
\examples{
data(vocdia)
x2 <- getSampledVocalMatrix(subset(atddia, id=='Abbott_Maddock_01'),
individual=TRUE, nodecolumn='speaker')
anonymise(x2)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vocalgraphs.R
\docType{data}
\name{atddia}
\alias{atddia}
\title{A sample Medical Team Meeting dialogue encoded as a vocaldia}
\format{A data frame with 7869 rows and 7 variables:
\describe{
\item{id}{The dialogue indentifier}
\item{begin}{The start time of a speech turn or silence interval}
\item{end}{The end time of a speech turn or silence interval}
\item{speaker}{An identifier for the speaker of the turn, or Floor for silence.}
\item{role}{The speaker's role (patient, interviewer, other, or Floor}
\item{trans}{The transcription of the turn (blanked out for anonymity)}
\item{dx}{The diagnosis (ad or nonad}
}}
\source{
This dataset was generated from the Carolina Conversations
Collection, and used in the work described in De La Fuente,
Albert and Luz:
"Detecting cognitive decline through dialogue processing",
2017. For the full data set, please contact the Medical
University of South Carolina (MUSC)
http://carolinaconversations.musc.edu/
}
\usage{
atddia
}
\description{
A dataset containing 38 dialogues (17 control patients, and 21 AD
patients) and 7869 vocalisation events.
}
\keyword{datasets}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{getEntropy}
\alias{getEntropy}
\title{getEntropy: safely return the Shannon entropy of a distribution.}
\usage{
getEntropy(distribution)
}
\arguments{
\item{distribution}{a probability distribution.}
}
\value{
a numeric value.
}
\description{
Compute the entropy of a distribution.
}
\details{
Compute the entropy of a distribution.
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vocalgraphs.R
\name{getPauseType}
\alias{getPauseType}
\title{getPauseType: name pause type between two vocalisation events.}
\usage{
getPauseType(prevspeaker, nextspeaker)
}
\arguments{
\item{prevspeaker}{speaker of the vocalisation immediately before Floor}
\item{nextspeaker}{speaker of the vocalisation immediately after Floor}
}
\value{
the pause type.
}
\description{
Identify the type of pause between vocalisations.
}
\details{
The type of pause a 'Floor' (silence) event represents can be:
'Pause', 'SwitchingPause', 'GrpPause', or 'GrpSwitchingPause'. See
(Luz, 2013) for details.
}
\examples{
getPauseType('a', 'b')
## [1] "SwitchingPause"
getPauseType('a', 'Grp')
## [1] "SwitchingPause"
getPauseType('Grp', 'Grp')
## [1] "GrpPause"
getPauseType('Grp', 'a')
## [1] "GrpSwitchingPause"
getPauseType('a', 'a')
##[1] "Pause"
}
\seealso{
\code{\link{namePauses}}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{getPofAgivenB}
\alias{getPofAgivenB}
\title{getPofAgivenB: transtion probability.}
\usage{
getPofAgivenB(a, b, ttarray)
}
\arguments{
\item{a}{target node}
\item{b}{source node}
\item{ttarray}{adjacency matrix}
}
\value{
a transition probability.
}
\description{
Conditional (transition ) probability
}
\details{
Retrieve \eqn{p(a|b)}, probability of a transition from b to a in an
adjacency matrix
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vocalgraphs.R
\name{getSampledVocalCountMatrix}
\alias{getSampledVocalCountMatrix}
\title{getSampledVocalCountMatrix: generate vocalisation diagrams}
\usage{
getSampledVocalCountMatrix(cdf, rate = 1, individual = FALSE,
noPauseTypes = FALSE, begin = "begin", end = "end",
nodecolumn = "role")
}
\arguments{
\item{cdf}{a data frame consisting, minimally, of a column for
vocalisation/pause start times, a column for end times, and a
column identifying the speaker, speaker role or 'Floor' (for
silences).}
\item{rate}{the rate at which to sample the vocalisation events
(in seconds)}
\item{individual}{whether to include individual speakers or group
them into a single Vocalisation node}
\item{noPauseTypes}{if TRUE, ignore distinctions between pauses
(SwitchingPause, GrpSwitchingPause, etc)}
\item{begin}{the name of the column containing the start time of
the vocalisation event in a row.}
\item{end}{the name of the column containing the end time of the
vocalisation event in the same row.}
\item{nodecolumn}{the name of the column containing the node
(speaker) name (e.g. 'speaker', 'role').}
}
\value{
a vocaldia object, consisting of a vocalisation matrix
(vocmatrix) where cell <m,n> contains the counts of
transitions from node n to node m, and a table of prior
probabilities (stationary distribution) per node.
}
\description{
Generate a count vocalisation diagram through 'sampling'.
}
\details{
A vocalisation diagram (vocaldia) is a representation of a
dialogue as a Markov process whose cell <m,n> contains the
transition probability from node n to node m). This function for
'cases' (an identifier for a case or a vector of identifiers
identifying a set of cases) in data frame 'df', obtained by
sampling the timeline every 'rate'-th second (see
getSampledVocalCountMatrix).
}
\examples{
data(vocdia)
getSampledVocalCountMatrix(subset(atddia,
id=='Abbott_Maddock_01'), nodecolumn='role')
}
\seealso{
(Luz, 2013)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vocalgraphs.R
\name{getSampledVocalMatrix}
\alias{getSampledVocalMatrix}
\title{getSampledVocalCountMatrix: generate vocalisation diagrams}
\usage{
getSampledVocalMatrix(df, ...)
}
\arguments{
\item{df}{a data frame consisting, minimally, of a column for
vocalisation/pause start times, a column for end times, and a
column identifying the speaker, speaker role or 'Floor' (for
silences).}
\item{...}{general parameter to be passed to
\code{\link{getSampledVocalCountMatrix}}}
}
\value{
a vocaldia object, consisting of a vocalisation matrix
(vocmatrix) where cell <m,n> contains the transition
probability from node n to node m, and a table of prior
probabilities (stationary distribution) per node.
}
\description{
Generate a probabilistic vocalisation diagram through 'sampling'.
}
\details{
A vocalisation diagram (vocaldia) is a representation of a
dialogue as a Markov process whose cell <m,n> contains the
transition probability from node n to node m).
}
\examples{
data(vocdia)
getSampledVocalMatrix(subset(atddia,
id=='Abbott_Maddock_01'),nodecolumn='speaker', individual=TRUE)
}
\references{
S. Luz. Automatic identification of experts and performance
prediction in the multimodal math data corpus through analysis
of speech interaction. In \emph{Proceedings of the 15th ACM on
International Conference on Multimodal Interaction, ICMI'13},
pages 575--582, New York, NY, USA, 2013. ACM.
}
\seealso{
\code{\link{getSampledVocalCountMatrix}}
}
\author{
Saturnino Luz \email{luzs@acm.org}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vocalgraphs.R
\name{getTurnTakingMatrix}
\alias{getTurnTakingMatrix}
\title{getSampledVocalCountMatrix: generate vocalisation diagrams}
\usage{
getTurnTakingMatrix(df, begin = "begin", end = "end", nodecolumn = "role",
individual = FALSE, noPauseTypes = FALSE)
}
\arguments{
\item{df}{a data frame consisting, minimally, of a column for
vocalisation/pause start times, a column for end times, and a
column identifying the speaker, speaker role or 'Floor' (for
silences).}
\item{begin}{the name of the column containing the start time of
the vocalisation event in a row.}
\item{end}{the name of the column containing the end time of the
vocalisation event in the same row.}
\item{nodecolumn}{the name of the column containing the node
(speaker) name (e.g. 'speaker', 'role').}
\item{individual}{whether to include individual speakers or group
them into a single Vocalisation node}
\item{noPauseTypes}{if TRUE, ignore distinctions between pauses
(SwitchingPause, GrpSwitchingPause, etc)}
}
\value{
a vocaldia object, consisting of a vocalisation matrix
(vocmatrix) where cell <m,n> contains the counts of
transitions from node n to node m, and a table of absolute
durations of vocalisation events.
}
\description{
Generate a vocalisation diagram with absolute vocalisation durations.
}
\details{
A vocalisation diagram (vocaldia) is a representation of a
dialogue as a Markov process whose cell <m,n> contains the
transition probability from node n to node m). Unlike
\code{\link{getSampledVocalCountMatrix}} this function
accummulates event durations directly, therefore resulting in no
self-transitions (in general).
}
\examples{
x <- subset(atddia, id=='Abbott_Maddock_01')
getTurnTakingMatrix(x)
getTurnTakingMatrix(x, individual=TRUE)
}
\references{
S. Luz. Automatic identification of experts and performance
prediction in the multimodal math data corpus through analysis
of speech interaction. In \emph{Proceedings of the 15th ACM on
International Conference on Multimodal Interaction, ICMI'13},
pages 575--582, New York, NY, USA, 2013. ACM.
}
\seealso{
(Luz, 2013) and \code{\link{getTurnTakingMatrix}}.
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vocalgraphs.R
\name{getTurnTakingProbMatrix}
\alias{getTurnTakingProbMatrix}
\title{getTurnTakingProbMatrix: create a vocaldia from a
data.frame.}
\usage{
getTurnTakingProbMatrix(df, individual = FALSE, ...)
}
\arguments{
\item{df}{a data frame consisting, minimally, of a column for
vocalisation/pause start times, a column for end times, and a
column identifying the speaker, speaker role or 'Floor' (for
silences).}
\item{individual}{whether to include individual speakers or group
them into a single Vocalisation node}
\item{...}{other parameters to be passed to
\code{\link{getTurnTakingMatrix}}.}
}
\value{
a vocaldia object, consisting of a vocalisation matrix
(vocmatrix) where cell \eqn{(m,n)} contains the probabilities \eqn{P(n|m)}
transitions to node \eqn{n} from node \eqn{m}, and a table of prior
probabilities (stationary distribution) per node.
}
\description{
Convert a data frame into a vocalisation diagram using counts rather than sampling.
}
\details{
Unlike \code{\link{getSampledVocalMatrix}}, this function is based
on transition counts rather than sampled intervals. As a result,
where in this version self transitions will always be set to 0
(since a vocalisation by a speaker is never followed by another
vocalisation by the same speaker) in the sampled version self
transitons will usually dominate the distribution, since the
speaker who is speaking now is very likely to be the one who were
speaking one second ago.
}
\examples{
x <- subset(atddia, id=='Abbott_Maddock_01')
getTurnTakingProbMatrix(x)
getTurnTakingProbMatrix(x, individual=TRUE)
}
\seealso{
(Luz, 2013) and \code{\link{getTurnTakingMatrix}}.
S. Luz. Automatic identification of experts and performance
prediction in the multimodal math data corpus through analysis
of speech interaction. In \emph{Proceedings of the 15th ACM on
International Conference on Multimodal Interaction, ICMI'13},
pages 575--582, New York, NY, USA, 2013. ACM.
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vocalgraphs.R
\name{getTurnType}
\alias{getTurnType}
\title{getTurnType: return type of turn}
\usage{
getTurnType(df, i, individual = FALSE, nodecolumn = "speaker",
noPauseTypes = F)
}
\arguments{
\item{df}{a data frame consisting, minimally, of a column for
vocalisation/pause start times, a column for end times, and a
column identifying the speaker, speaker role or 'Floor' (for
silences).}
\item{i}{the identifier (index number) whose type will be returned}
\item{individual}{if TRUE, return the identifier, a Pause or Grp}
\item{nodecolumn}{the name of the column containing the node
(speaker) name (e.g. 'speaker', 'role').}
\item{noPauseTypes}{if TRUE, ignore distinctions between pauses
(SwitchingPause, GrpSwitchingPause, etc)}
}
\value{
a string containing the turn type or identifier.
}
\description{
Identify turn types
}
\details{
Return one of {Vocalisation, GrpVocalisation, ...} or identifier.
}
\examples{
data(vocdia)
atddia[1:10,]
getTurnType(atddia, 3, nodecolumn='role') ## a vocalisation
getTurnType(atddia, 4, nodecolumn='role') ## a pause
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{identifyGrpVocalisations}
\alias{identifyGrpVocalisations}
\title{identifyGrpVocalisations: replace appropriate vocalisation
types}
\usage{
identifyGrpVocalisations(vocvector)
}
\arguments{
\item{vocvector}{a character vector containing a sequence of
vocalisation events}
}
\value{
A vector with all events replaced by the appropriate type
identifier.
}
\description{
Identify group vocalisations
}
\details{
Standardise identifier for group vocalisations
}
\examples{
data(vocdia)
identifyGrpVocalisations(atddia$speaker[1:60])
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{identifyPauses}
\alias{identifyPauses}
\title{identifyPauses: label pauses according to type.}
\usage{
identifyPauses(vocvector)
}
\arguments{
\item{vocvector}{a character vector containing a sequence of
vocalisation events}
}
\value{
A vector with all Floor events replaced by the appropriate
pause type identifier.
}
\description{
Assign types to the pauses (Floor events) in a sequence
}
\details{
Identify the pauses in a vector as one of the pauses in
\code{pauseTypes}
}
\examples{
data(vocdia)
identifyPauses(atddia$speaker[1:60])
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{identifyVocalisations}
\alias{identifyVocalisations}
\title{identifyVocalisations: replace appropriate vocalisation
types}
\usage{
identifyVocalisations(vocvector, idswitchvoc = T)
}
\arguments{
\item{vocvector}{a character vector containing a sequence of
vocalisation events}
\item{idswitchvoc}{if TRUE distinguise between
SwitchingVocalisation and Vocalisation.}
}
\value{
A vector with all events replaced by the appropriate type
identifier.
}
\description{
Identify switching vocalisations
}
\details{
SwitchingVocalisation is a vocalisation that signals a immediate
speaker transition; that is, a transition from speaker to
speaker (as opposed to speaker to Grp or speaker to Pause).
E.g (speakers A, B, C):
\preformatted{
AAAAAAAABBBBBBBCCCCCBBBBBPauseBBBBSwitchingPauseAAAAAGrpVocalisation
^ ^ ^ ^ ^ ^
| | | | | |
| | | ---------------- Non-SwitchingVocalisation's
| | |
---------------------> SwitchingVocalisation's
}
}
\examples{
data(vocdia)
identifyVocalisations(atddia$speaker[1:60])
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{igraph.vocaldia}
\alias{igraph.vocaldia}
\title{igraph.vocaldia: Create an igraph vocalisation diagram}
\usage{
igraph.vocaldia(vd, ...)
}
\arguments{
\item{vd}{a vocalisation diagram}
\item{...}{arguments for the layout algorithm}
}
\value{
an igraph
}
\description{
Create an igraph vocalisation diagram
}
\details{
Create a vocalisation diagram
}
\examples{
data(vocdia)
igraph.vocaldia(getSampledVocalMatrix(subset(atddia, id=='Abbott_Maddock_01'),
individual=TRUE, nodecolumn='speaker'))
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{matrixExp}
\alias{matrixExp}
\title{matrixExp: raise matrix to exp.}
\usage{
matrixExp(matrix, exp, mmatrix = matrix)
}
\arguments{
\item{matrix}{a matrix}
\item{exp}{the power to which matrix will be raised}
\item{mmatrix}{a placeholder.}
}
\value{
matrix^exp
}
\description{
Matrix exponentials
}
\details{
A (sort of) exponential function for matrix multiplication (to be
used with \code{\link{staticMatrix}}).
}
\examples{
data(vocdia)
matrixExp(vocmatrix$ttarray, 3)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vocalgraphs.R
\name{namePauses}
\alias{namePauses}
\title{namePauses: name pause types.}
\usage{
namePauses(df, nodecolumn = "role")
}
\arguments{
\item{df}{a data frame consisting, minimally, of a column for
vocalisation/pause start times, a column for end times, and a
column identifying the speaker, speaker role or 'Floor' (for
silences).}
\item{nodecolumn}{the name of the column containing the node
(speaker) name (e.g. 'speaker', 'role').}
}
\value{
a data.frame with pauses in nodecolumn replaced by different pause types.
}
\description{
Replace identified pause pause types in data frame.
}
\details{
replace all 'Floor' speakers in df by 'Pause', 'SwitchingPause'
etc, and return a new data fame containing pause types in place of
'Floor' (see markov.R, identifyPauses() for a better
implementation)
}
\examples{
data(vocdia)
x <- subset(atddia, id=='Abbott_Maddock_01')
x[1:15,1:6]
namePauses(x)[1:15,1:6]
}
\seealso{
\code{\link{identifyPauses}} for a better implementation
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{plot.matrixseries}
\alias{plot.matrixseries}
\title{plotConvergence: plots Markov diagram convergence.}
\usage{
\method{plot}{matrixseries}(x, ..., par = list(), interact = F)
}
\arguments{
\item{x}{an object of class matrixseries; a list where the
\eqn{i^{th}} element corresponds to \eqn{M^i}.}
\item{...}{extra graphics parameters for plot.}
\item{par}{graphic parameters alist}
\item{interact}{if TRUE, pauses the drawing after each node.}
}
\value{
the matrixseries
}
\description{
Visualise convergence properties of vocalisation graphs
}
\details{
A 'toy' for visualisation of convergence properties of
vocalisation graphs. Plot the convergence paths of each
Vocalisation event (i.e. each row-column transition probability,
grouped by colour according to the inciding node)
}
\examples{
data(vocdia)
plot(staticMatrix(vocmatrix$ttarray, digits=4, history=TRUE))
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{plot.vocaldia}
\alias{plot.vocaldia}
\title{plot.vocaldia}
\usage{
\method{plot}{vocaldia}(x, ..., package = "igraph")
}
\arguments{
\item{x}{a vocalisation diagram}
\item{...}{arguments for the layout algorithm}
\item{package}{the package to be used for ploting (igraph
(default) or Rgraphviz)}
}
\value{
\code{NULL}
}
\description{
Plot a vocalisation diagram
}
\details{
Plot a vocalisation diagram
}
\examples{
data(vocdia)
require('igraph')
plot(getSampledVocalMatrix(subset(atddia, id=='Abbott_Maddock_01'),
individual=TRUE, nodecolumn='speaker'))
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vocalgraphs.R
\name{printARFFfile}
\alias{printARFFfile}
\title{printARFFfile: Create arff files by creating and flattening vocaldias}
\usage{
printARFFfile(df, ids = c(), idcolumn = "id", noPauseTypes = F,
sampled = 0, individual = TRUE, nodecolumn = "role",
classcolumn = "dx", file = "/tmp/ccc.arff")
}
\arguments{
\item{df}{df a data frame consisting, minimally, of a column for
vocalisation/pause start times, a column for end times, and a
column identifying the speaker, speaker role or 'Floor' (for
silences).}
\item{ids}{Ids of dialogues to generate (as defined in column named idcolumn)}
\item{idcolumn}{the name of the column containing the dialogue id}
\item{noPauseTypes}{if TRUE, ignore distinctions between pauses
(SwitchingPause, GrpSwitchingPause, etc)}
\item{sampled}{if >0 use \code{\link{getSampledVocalMatrix}} with rate=sampled}
\item{individual}{whether to include individual speakers or group
them into a single Vocalisation node}
\item{nodecolumn}{the name of the column containing the node
(speaker) name (e.g. 'speaker', 'role').}
\item{classcolumn}{the name of the column containing the target class (or value).}
\item{file}{name of ARFF file to be generated.}
}
\description{
Generate ARFF files from vocalisation diagrams
}
\details{
Use this function to generate turn-taking diragrams in ARFF format for
}
\examples{
data(vocdia)
printARFFfile(atddia, individual=TRUE, classcolumn='dx',
file='/tmp/test.arff', noPauseTypes=FALSE)
library("foreign")
x1 <- read.arff('/tmp/test.arff')
x1[1:3,]
## remove empty columns
x1[,c(unlist(apply(x1[1:(ncol(x1)-1)],2,sum)!=0), TRUE)]
}
\references{
S. Luz. Automatic identification of experts and performance
prediction in the multimodal math data corpus through analysis
of speech interaction. In \emph{Proceedings of the 15th ACM on
International Conference on Multimodal Interaction, ICMI'13},
pages 575--582, New York, NY, USA, 2013. ACM.
}
\seealso{
\code{\link{getSampledVocalCountMatrix}},
\code{\link{getTurnTakingProbMatrix}}.
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{startmatrix}
\alias{startmatrix}
\alias{startmatrix.default}
\alias{startmatrix.matrixseries}
\title{startmatrix: return the first matrix of a converging series.}
\usage{
startmatrix(mseries)
\method{startmatrix}{default}(mseries)
\method{startmatrix}{matrixseries}(mseries)
}
\arguments{
\item{mseries}{a matrixseries object}
}
\value{
the initial matrix.
}
\description{
Access initital matrix in a \code{matrixseries}
}
\details{
Access initital matrix in a \code{matrixseries}
}
\examples{
data(vocdia)
x2 <- staticMatrix(vocmatrix$ttarray, digits=4, history=TRUE)
## original matrix
startmatrix(x2)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment