Skip to contents

Computes as many regressions as breakup dates within a global model

Usage

bp_lm(x, left = TRUE, break_dates, tvlm = FALSE, ...)

Arguments

x

lm object. It is the global regression model.

left

logical. By default set to TRUE, i.e. the breakdate is the end date of each submodel

break_dates

optional, to indicate the breakup dates if they are known.

tvlm

By default set to FALSE. Indicates which model will be run on each sub data. FALSE means a lm will be run.

...

other arguments passed to tvReg::tvLM().

Value

Returns an element of class bp_lm. It is a list containing the following elements:

model

all computed models, each of class lm or tvlm according to the parameter specified above

start

start date of the time serie

end

end date of the time serie

frequency

frequency of the time serie

breakdates

a list of the breakup dates

left

same as the parameter specified above

tvlm

same as the parameter specified above