# NOT RUN {
# Load data
data(ex_sales)
# With a raw transaction data.frame
rt_data <- rtCreateTrans(trans_df = ex_sales,
prop_id = 'pinx',
trans_id = 'sale_id',
price = 'sale_price',
periodicity = 'monthly',
date = 'sale_date')
# Create model object
hpi_model <- hpiModel(model_type = 'rt',
hpi_df = rt_data,
estimator = 'base',
log_dep = TRUE)
# For custom weighted repeat transaction model
hpi_model_wgt <- hpiModel(model_type = 'rt',
hpi_df = rt_data,
estimator = 'weighted',
weights = runif(nrow(rt_data), 0, 1))
# }
Run the code above in your browser using DataLab