Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-dimensional covariates #12

Closed
haziqj opened this issue Jan 22, 2016 · 2 comments
Closed

Multi-dimensional covariates #12

haziqj opened this issue Jan 22, 2016 · 2 comments

Comments

@haziqj
Copy link
Owner

haziqj commented Jan 22, 2016

Think about how to make iprior function handle multi-dimensional covariates.

@haziqj
Copy link
Owner Author

haziqj commented Jan 23, 2016

Just some ideas:

If have a p-dimensional covariate called multx and additional some other unidimensional covariate x, then maybe can run in two separate models then combine. Use some option (I don't know what to call it yet) run=F so the EM doesn't actually run, but perhaps only stores the kernels for example.

mod1 <- iprior(y ~ multx, one.lam=T, run=F)
mod2 <- iprior(y ~ x, run=F)
mod <- combine.iprior(mod1, mod2)

The function combine.iprior does the actual running of the EM, and all that is really needed is the kernel matrices which was specified in mod1 and mod2. The number of lambdas has also already been determined correctly, because each of the models were specified individually.

This may be a more tedious multistage approach to running the model. But the advantages are:

  • R's data frame are not able to handle multidimensional covariates. We would need to use arrays or list, which are a bit clumsy to manipulate and prone to errors (might confuse the dimensions).
  • As automatic handling of multidimensional covariates are out of the question, we need to resort to some way of specifying these multidimensional covariates. Something along the lines of lambda=c(1,1,1,1,1,2,3) for example, to say that the first five covariates share the same lambda while the sixth and seventh have their own scale parameters. I would prefer to avoid this method if possible as it can get really messy if there are a lot of covariates involved. Although I am not ruling this out. Further thought and discussion needed. NOTE: Relates to issue Specifying a different RKHS for each continuous variable #13
  • This multistage approach allows an existing model to be updated by adding (an) additional covariates. So we get this bonus feature for "free".

@haziqj
Copy link
Owner Author

haziqj commented Jul 4, 2016

Latest release has this feature. Will write about it in the wiki soon.

@haziqj haziqj closed this as completed Jul 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant