dot-topic_trends: Fit a linear regression to time frequency series of each...

Description Usage Arguments Details Value

Description

.topic_trends takes a dataframe with a topic frequency time series as returned by the topic_frequencies function and fits a linear regression for each topic (identified by topic_id).

Usage

1
.topic_trends(topicFrequencies, trendThreshold = 5e-04)

Arguments

topicFrequencies

a dataframe of topic frequencies as returned by topic_frequencies

trendThreshold

a double used to categorise trends, default is 0.0005; if the intercept of the linear model of topic frequencies falls within a range of +/-trendThreshold of the mean topic share, the trend is categorized as "constant"

Details

The primary purpose of this function is to provide a simple approach to classify topics by a general trend, which can be used for visualization, filtering and exploratory analysis. Internally, the slope and intercept of the fitted linear model are use to categorize a basic trend for the topic frequencies.

Value

a dataframe specifying trend metrics for each topic, where:

topic_id

a topic identifier

slope

the slope coefficient of the linear model fit to this topic's time frequency series

volatility

the residual standard deviation of the linear model fit to this topic's time frequency series, which is used as a basic measure of volatility of topic frequencies

trend

a categorisation of the topic frequency trend, negative slopes with an intercept > mean topic share + trendThreshold are interpreted as decreasing, positive slopes with an intercept < mean topic share - trendThreshold as increasing, all others as constant


sdaume/topicsplorrr documentation built on Dec. 22, 2021, 11:11 p.m.