predictor: Predict the next value using the same multilinear regression...

Description Usage Arguments Examples

View source: R/LinearRegression.R

Description

Predict the next value using the same multilinear regression model

Usage

1
predictor(X, model)

Arguments

X

design matrix

model

the result of running bootreg on the data set, ie. a great big collection of different betas, upon which the column mean is used to get the most accurate possible estimate for beta

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# predict a singular value, given the description of the linear model and the design matrix of the new points
df<-iris

# scrape off all non-numeric data first
df<-df[,sapply(df, is.numeric)]
df
X<-df[,-1]
Y<-as.matrix(df[,1])
X
Y
dim(X)
dim(Y)
X<-append_design_matrix(X)
dim(X)
bh=bootreg(Y,X,1000) # works just fine! Whoo!
data.matrix(rowMeans(bh$bh))
predictor(matrix(c(1, 2, 2, 3), nr=1), bh)

MalachiTimothyPhillips/ggfast documentation built on May 18, 2019, 11:27 p.m.