fc.predict: Prediction based on FC

Description Usage Arguments Value Examples

View source: R/fc_predict.R

Description

Prediction based on the fitted model given the collpase/partition that selected by running the stochastic search

Usage

1
2
3
4
5
6
7
fc.predict(data, model, varia.list, merge.list)

## S3 method for class 'glm'
fc.predict(data, model, varia.list, merge.list)

## S3 method for class 'rxGlm'
fc.predict(data, model, varia.list, merge.list)

Arguments

data

new dataset, such as testing data

model

model, such as training model including interactions

varia.list

variables to be collapsed

merge.list

graycodes

Value

prediction

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
m1 <- glm(Claims ~ Kilometres+Zone+Bonus+Make, offset = log(Insured),
          data = sweden, family = "poisson")
a <- fc.predict(data=sweden,
                model = m1,
                varia.list = c("Kilometres", "Zone", "Bonus", "Make"),
                merge.list = list(c(1,2,3,4,4),
                                  c(1,2,3,4,5,5,5),
                                  c(1,1,1,2,3,4,5),
                                  c(1,2,3,4,5,6,7,7,7)) )
b <- predict.glm(m1, type='response')
plot(cbind(a,b))

senhu/FCBMA documentation built on Aug. 6, 2019, 4:56 p.m.