# Formula based input
(mod.stackf <- iprior(stack.loss ~ Air.Flow + Water.Temp + Acid.Conc.,
data = stackloss))
mod.toothf <- iprior(len ~ supp * dose, data = ToothGrowth)
summary(mod.toothf)
# Non-formula based input
mod.stacknf <- iprior(y = stackloss$stack.loss,
Air.Flow = stackloss$Air.Flow,
Water.Temp = stackloss$Water.Temp,
Acid.Conc. = stackloss$Acid.Conc.)
mod.toothnf <- iprior(y = ToothGrowth$len,
supp = ToothGrowth$supp,
dose = ToothGrowth$dose,
model = list(interactions = "1:2"))
# Formula based model option one.lam = TRUE
# Sets a single scale parameter for all variables
modf <- iprior(stack.loss ~ ., data = stackloss, model = list(one.lam = TRUE))
modnf <- iprior(y = stackloss$stack.loss, x = stackloss[1:3])
# Example of using the FBM kernel for smoothing models
mod <- kernL(y ~ x, datfbm, model = list(kernel = "FBM")) # Hurst = 0.5 (default)
mod <- kernL(y ~ x, datfbm, model = list(kernel = "FBM,0.75")) # custom Hurst
# Fit the model using EM starting at a specific parameter value
mod.fit <- iprior(mod, control = list(lambda = 8.41, psi = 0.33))
Run the code above in your browser using DataLab