run_model: Calculates and graphs parameter based models

Description Usage Arguments Details Note See Also Examples

View source: R/modeller.R

Description

This function returns parameters, stats, change-point(s), and parameter model graphs using create_model function.

Usage

1
2
run_model(util, plot_flag = FALSE, step = 0.5, n = 4,
  unretrofit_flag = TRUE)

Arguments

util

A data frame with columns columns: energy_type, OAT, usage and estimated (1 for estimated usage and 0 for actual usage). See unretrofit_utility for more information about data format.

plot_flag

A boolean value. Defaults to FALSE. If set to FALSE, it will not return any plots.

step

A single numeric value or a vector. If it is a single numeric value, create_model will be used to find change-point(s). If it is a vector with more than one component, create_model_2 will be used. Defaults to 0.5. Adjust step-size depending on independent varaiables.

n

A numeric value that determines threshold for population test: thereshold = number_of_independent_variables/n. Defaults to 4. See pop_test.

unretrofit_flag

A boolean value to indicate whether it is retrofit or unretrofit. Defaults to TRUE. This only affects parameter model graph's legend labels.

Details

This function can be used for both retrofit and unretrofit data. However, if you want to run this function with retrofit data, subset or filter the data first by prepost. If input util data frame is not in the exact format as unretrofit_utility, change independent varaible column to 'OAT' and dependent variable to 'usage', add 'energy_type' column and set all the values to either 'Fuel' or 'Elec'. If 'estimated' is column is not present, a column of ones will be added automatically.

Note

If more than half of usage points (dependent variables) of input data frame are zeros, error message will be generated.

See Also

create_model, create_model_2, run_model_retrofit, unretrofit_utility and retrofit_utility

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
util = subset(unretrofit_utility, unretrofit_utility$bdbid == 'f3acce86'
			& unretrofit_utility$energy_type == 'Elec') #unretrofit data
result = run_model(util) #result for unretrofit data
retrofit_util = subset(retrofit_utility, retrofit_utility$bdbid == 846152
					& retrofit_utility$energy_type == 'Elec') #retrofit data
pre_util = subset(retrofit_util, retrofit_util$prepost == 1)#subset pre-retrofit utility data
pre_result = run_model(pre_util) #result for pre-retrofit data
post_util = subset(retrofit_util, retrofit_util$prepost == 3)#subset post-retrofit utility data
post_result = run_model(post_util) #result for post-retrofit data
## End(Not run)

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