[R] VGAM constraints-related puzzle
Thomas Yee
t.yee at auckland.ac.nz
Tue Jun 28 02:05:55 CEST 2011
Edward Wallace <ewjwallace <at> gmail.com> writes:
>
> Hello R users,
> I have a puzzle with the VGAM package, on my first excursion into
> generalized additive models, in that this very nice package seems to
> want to do either more or less than what I want.
>
> Precisely, I have a 4-component outcome, y, and am fitting multinomial
> logistic regression with one predictor x. What I would like to find
> out is, is there a single nonlinear function f(x) which acts in place
> of the linear predictor x. There is a mechanistic reason to believe
> this is sensible. So I'd like to fit a model
> \eta_j = \beta_{ (j) 0 } + \beta_{ (j) x } f(x)
> where both the function f(x) and its scaling coefficients \beta_{ (j)
> x } are fit simultaneously. Here \eta_j is the linear predictor, the
> logodds of outcome j vs the reference outcome. I cannot see how to fit
> exactly this. Instead I seem to be able to do the following:
>
Hello,
try
rrvglm(y ~ 1 + bs(x), fam = multinomial, trace = TRUE)
It seems what you want is a stereotype model with
a smooth function.
Unfortunately rrvglm() is restricted to regression splines.
You could extract out the scaling coeffs and feed them
into vgam() using the constraints argument, but that
would not be optimal in any strict sense.
cheers
Thomas
More information about the R-help
mailing list