seqsmooth: Smoothing sequence data

View source: R/seqsmooth.R

seqsmoothR Documentation

Smoothing sequence data

Description

Smoothing of sequence data, using for each sequence the medoid of the sequences in its neighborhood. The results can be used to get a smoothed index plot.

Usage

seqsmooth(seqdata, diss, k=20, r=NULL)

Arguments

seqdata

a sequence object (see seqdef function).

diss

a dissimilarity matrix, giving the pairwise distances between sequences.

k

size of the neighborhood. Default is 20.

r

radius of the neighborhood. If NULL (default), the radius is not used for smoothing.

Value

A list with the following elements:

seqdata

a sequence object (see seqdef function)

R2

pseudo-R2 measure of the goodness of fit of the smoothing

S2

stress measure of the goodness of fit of the smoothing

Author(s)

Nicolas Robette

References

Piccarreta R. (2012). Graphical and Smoothing Techniques for Sequence Analysis, Sociological Methods and Research, Vol. 41(2), 362-380.

Examples

data(trajact)
seqact <- seqdef(trajact)
dissim <- seqdist(seqact, method="LCS")
mds <- cmdscale(dissim, k=1)
smoothed <- seqsmooth(seqact, dissim, k=30)$seqdata
seqIplot(smoothed, sortv=mds, xtlab=14:50, with.legend=FALSE, yaxis=FALSE, ylab=NA)

nicolas-robette/seqhandbook documentation built on April 9, 2023, 7:08 a.m.