y_gen: Calculates predicted usage

Description Usage Arguments Examples

View source: R/modeller.R

Description

This function returns a matrix of estimated usage given a specific model, independent variable matrix, parameter matrix and change-point(s).

Usage

1
y_gen(model, x, B, cp1 = NA, cp2 = NA)

Arguments

model

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

x

A vector. Independent variable.

B

A matrix, either 2 by 1 or 3 by 1 matrix. B[1] = y-value at cp1 (and cp2), B[2] = slope (if there are two slopes, this is the leftmost slope), B[3] = slope (if there are two slopes, this is the rightmost slope).

cp1

A numeric value. The first change-point. Defaults to NA.

cp2

A numeric value. The second change-point. Defaults to NA.

Examples

1
2
3
4
5
6
7
util = subset(unretrofit_utility, unretrofit_utility$bdbid == 'f3acce86'
			& unretrofit_utility$energy_type == 'Elec')
temp = sort_matrix(util$OAT,util$usage)
x_split = splitter('4P', temp$x, 51)
xmat = make_matrix(x_split)
B = least_squares(xmat, temp$y)
y_est = y_gen('4P', temp$x, B, 51, 0)

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