dot-term_trends: Fit a linear regression to time frequency series of term...

Description Usage Arguments Details Value

Description

.term_trends takes a dataframe with term frequency time series as returned by the term_frequencies() function and fits a linear regression for each term.

Usage

1
.term_trends(termFrequencies, trendThreshold = 5e-04)

Arguments

termFrequencies

a dataframe of term frequencies as returned by term_frequencies()

trendThreshold

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

Details

The primary purpose of this function is to provide a simple approach to identify term trends, 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 term frequencies.

Value

a dataframe specifying trend metrics for each term, where:

term

a unique term

slope

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

volatility

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

trend

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


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