Description Usage Arguments Value Author(s) Examples
After finding a good model, do an "optim" of the marginal likelihood with respect the smoothing parameters of the continuous variables, as a form of postprocessing.
1 2 | postOptimize(modelData, modelConfig,
computation = getComputation())
|
modelData |
the data necessary for model estimation,
which is the result from |
modelConfig |
the model configuration |
computation |
computation options produced by
|
the optimized model configuration, which is non-integer for included continuous variables
Daniel Sabanes Bove daniel.sabanesbove@ifspm.uzh.ch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | ## get some data
attach(longley)
## get model data
md <- modelData(y=Employed,
X=cbind(GNP, Armed.Forces),
splineType="cubic",
gPrior="hyper-g/n")
## get a list of all possible models with this data
res <- exhaustive(md)$models
## now optimize the best model (best wrt to marg lik)
bestConfig <- res[which.max(res$logMargLik), 1:2]
bestConfig
optimConfig <- postOptimize(modelData=md,
modelConfig=bestConfig)
optimConfig
## now for binary response:
## get the model data
md <- glmModelData(y=as.numeric(Employed > 64),
X=cbind(GNP, Armed.Forces),
family=binomial)
## and do the exhaustive search
res <- exhaustive(md,
computation=getComputation(higherOrderCorrection=FALSE))$models
## now optimize the best model (best wrt to marg lik)
bestConfig <- res[which.max(res$logMargLik), 1:2]
bestConfig
## todo!
## optimConfig <- postOptimize(modelData=md,
## modelConfig=bestConfig,
## computation=getComputation(higherOrderCorrection=FALSE))
## optimConfig
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.