give.c | R Documentation |
Give a vector of all 'c' G-spline coefficients satisfying the three constrains (see below) if only (g-3) c's are given.
give.c(knots, sdspline, last.three, c.rest)
knots |
A vector of G-spline knots mu. |
sdspline |
Standard deviation sigma0 of the basis G-spline. |
last.three |
Indeces of the three 'c' G-spline coefficients which are
not included in |
c.rest |
A vector of |
The functions computes remaining three 'c' G-spline coefficients (if it is possible) such that the resulting G-spline satisfies the following:
c[1] + ... c[g] = 1,
c[1]mu[1] + ... c[g]mu[g] = 0,
c[1]mu[1]^2 + ... c[g]mu[g]^2 = 1 - sigma0^2.
A vector of all length(knots)
'c' G-spline coefficients.
WARNING: This function is primarily used inside smoothSurvReg
.
Consequently, it has very few error checks on its input arguments.
Arnošt Komárek arnost.komarek@mff.cuni.cz
knots <- seq(-4, 4, 0.5) sd0 <- 0.3 ccoef <- find.c(knots, sd0, dist = "dstlogis") last.three <- c(3, 7, 10) c.rest <- ccoef[-last.three] ccoef2 <- give.c(knots, sd0, last.three, c.rest) print(ccoef) print(ccoef2) ## Almost no change
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.