Skip to contents

Computes one global linear regression, on splitted data

Usage

piece_reg(
  x,
  break_dates = NULL,
  fixed_var = NULL,
  tvlm = FALSE,
  bw = NULL,
  left = TRUE,
  ...
)

Arguments

x

lm object. It is the global regression model

break_dates

optional, to indicate the breakdates if they are known. By default set to NULL.

fixed_var

fixed variables (not splitted using break_dates).

tvlm

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

bw

bandwidth of the local regression (when tvlm = TRUE).

left

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

...

other arguments passed to tvReg::tvLM().

Value

Returns an element of class lm

Details

Computes possible breakdates if not filled in. Uses function break_data and run a linear regression on the same splitted data.