create_model: 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 only one step size. This function is dependent on test_model and splitter function.

Usage

1
create_model(x, y, model, step = 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 character string. Model such as '2P', '3PH', '3PC', '4P' or '5P'.

step

A single numeric value. Defaults to 0.5.

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_2, 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(x, y, '4P')

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