create_model_2: Calculates the best segmented regression parameters for a...

Description Usage Arguments Value See Also Examples

Description

This function returns the best change-point parameter based model given a specific model and independent and dependent column matrices by using three different step sizes. Note that create_model function does not use multiple step sizes. This function is dependent on test_model and splitter function.

Usage

1
create_model_2(x, y, model, step = c(10, 2, 0.5))

Arguments

x

A (column) matrix of outside air temperature, independent variables.

y

A (column) matrix of actual values(usage), dependent variables.

model

A charater string. Model such as '2P', '3PH', '3PC', '4P' or '5P'.

step

A numeric vector. Defaults to c(10,2,0.5). Adjust this depending on values of your independent variables.

Value

A list with components:

stats

A matrix of statistical results such as RMSE, R-squared

params

A matrix of parameters such as basload and slopes

cp1

Change point. The leftmost change point. This will be zero if model is '2P'.

cp2

Change point. The rightmost change point. This will be zero if model is not '5P'.

model

Model type.

See Also

create_model, and run_model

Examples

1
2
3
x = matrix(c(1:10))
y = matrix(c(1,2.5,3,4,5,5.5,7,8.3,9,10))
result = create_model_2(x, y, '4P', step = c(2,1,0.5))

tinnaing347/bRema documentation built on Aug. 23, 2019, 9:15 p.m.