cplmx: Fit Multiple Change Point Linear Models from a Single Dataset

View source: R/cplm.R

cplmxR Documentation

Fit Multiple Change Point Linear Models from a Single Dataset

Description

This function (change point linear model "extended") wraps cplm for a dataset with multiple buildings.

Usage

cplmx(formula, data, id_vars, heating = NULL, cooling = NULL, se = FALSE,
  lambda = 0)

Arguments

formula

a formula as would be used in a linear model

data

the dataset to perform the regression with

heating

optional to force evaluation of a heating change point

cooling

optional to force evaluation of a cooling change point

se

estimate standard errors with a bootstrap re-sampling technique

lambda

optional override for L1 penalty. Modifies the mean-squared error from a full least-squares fit. Larger values correspond to larger penalties. A value of 0 corresponds to ordinary least-squares.

weights

an optional vector of observation weights, if non-NULL will use these for weighted least squares

nreps

number of bootstrap replicates, defaults to 200

parametric

specify true for a parametric bootstrap, FALSE for a non-parametric bootstrap. Defaults to parametric for < 100 observations, non-parametric for >= 100 observations

Value

The coefficients from the change point linear model w/ specified fitting method.

Examples

data(dhp)
results <- cplmx(kwhd ~ avetemp, data = dhp,
                   id_vars = c("id", "post"))
summary(results)
plot(results, "heatingBase")

EcotopeResearch/rterm documentation built on Oct. 17, 2022, 4:02 p.m.