fuzzyseqplot: Plot sequences according to a fuzzy clustering.

View source: R/fuzzyfunc.R

fuzzyseqplotR Documentation

Plot sequences according to a fuzzy clustering.

Description

This funciton propose a graphical representation of a fuzzy clustering results where sequences are weighted according to their cluster membership strength.

Usage

fuzzyseqplot(seqdata, group = NULL, membership.threashold = 0, type = "i", 
			members.weighted = TRUE, memb.exp = 1, ...)

Arguments

seqdata

State sequence object created with the seqdef function.

group

A fuzzy partition of the data, either as a membership matrix or as a fanny object.

membership.threashold

Numeric. Minimum membership strength to be included in plots.

type

the type of the plot. Available types are "d" for state distribution plots (chronograms), "f" for sequence frequency plots, "i" for selected sequence index plots, "I" for whole set index plots, "ms" for plotting the sequence of modal states, "mt" for mean times plots, "pc" for parallel coordinate plots and "r" for representative sequence plots.

members.weighted

Logical. Should the sequences be weighted by their membership strength in each group before being plotted?

memb.exp

Optional. Fuzzyness parameter used in the fanny algorithm.

...

arguments to be passed to seqplot.

Details

The dataset is augmented by repeating the sequence s_i of individual i k times (i.e., once per cluster). We therefore have k sequences for individual i, denoted as s_{i1}... s_{ik}. These sequences are therefore weighted according to their membership degree u_{i1}... u_{ik}. Hence, even if the same sequence were repeated k times, its total weight sum to 1. An additional categorical covariate is created in this augmented dataset that specifies the cluster (ranging from 1 to k) of the associated membership degree. This weighting strategy allows us to use any tools available for weighted sequence data (see seqplot).

For index plots, we additionally suggest ordering the sequences according to membership degree by setting sortv="membership" (see example). The most typical sequence lies at the top of the subfigures, with a high membership degree; meanwhile, the bottom shows less-characteristic patterns. Restricting to sequences with the highest membership degree can be achieved with the membership.treashold argument.

References

Studer, M. (2018). Divisive property-based and fuzzy clustering for sequence analysis. In G. Ritschard and M. Studer (Eds.), Sequence Analysis and Related Approaches: Innovative Methods and Applications, Life Course Research and Social Policies.

See Also

See also fanny for fuzzy clustering.

Examples

	data(mvad)
	mvad.seq <- seqdef(mvad[1:100, 17:86])

	## COmpute distance using Hamming distance
	diss <- seqdist(mvad.seq, method="HAM")
	library(cluster)
	fclust <- fanny(diss, k=2, diss=TRUE)
	
	fuzzyseqplot(mvad.seq, group=fclust, type="d")
	fuzzyseqplot(mvad.seq, group=fclust, type="I", sortv="membership")
	fuzzyseqplot(mvad.seq, group=fclust, type="f")

WeightedCluster documentation built on Oct. 2, 2024, 5:06 p.m.