Description Usage Arguments See Also Examples
This function tries to find the optimal smoothing parameter value used in mpspline.fit
.
1 | optimSmoothingParameter(mpspline.params, alpha.init, useAIC, upper)
|
mpspline.params |
List of |
alpha.init |
Initial value for the smoothness regularizing parameter (>= 0). Default=2. |
useAIC |
Specifies if the AIC criteria is used for optimization. Otherwise, the BIC is used. Default=TRUE. |
upper |
The upper bound on the variable that will be optimized by |
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 | # Using Belgian B19 data
data("VZV_B19_BE_0103")
subset <- (VZV_B19_BE_0103$age<40.5)&(!is.na(VZV_B19_BE_0103$age))&
(!is.na(VZV_B19_BE_0103$VZVmUIml))
data <- VZV_B19_BE_0103[subset,]
# Data to use when taking the continuous levels
z<-log(data$VZVmUIml[order(data$age)]+1)
a<-data$age[order(data$age)]
params <- list(response=z, x.var=a, ps.intervals=20, degree=3,
link="identity", family="gaussian", order=2, kappa=1e8)
optimSmoothingParameter(params)
# Proportion positive, as a function of the corresponding half-year
# age categories, overlaid with the monotone p-spline fit and the FOI:
# with BIC optimal smoothing parameter
#
# Using Belgian B19 data
data("VZV_B19_BE_0103")
subset <- (VZV_B19_BE_0103$age<40.5)&(!is.na(VZV_B19_BE_0103$age))&
(!is.na(VZV_B19_BE_0103$VZVmUIml)&(!is.na(VZV_B19_BE_0103$VZVres)))
data <- VZV_B19_BE_0103[subset,]
# Data to use when taking the binary indicators (different because some are inconclusive)
y <- data$VZVres[order(data$age)]
a <- data$age[order(data$age)]
params <- list(response=y, x.var=a, ps.intervals=20, degree=3,
order=2, link="logit", family="binomial", kappa=1e8)
optimSmoothingParameter(params,useAIC=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.