nataraj at orchidpharma.com
2012-May-18 04:33 UTC
[R] Covariance matrix in R with non-numeric variables
Dear R help forum members, I am modeling a gaussian distribution for a computational biology application and I am working in the statistical package "R". In this regard, my problem is that I have to construct a covariance matrix with variables (non-numeric) and the covariance matrix is to be used in an maximizers of the likelihood function to predict the variables in the matrix. I am unable to do that because I do not have an idea of how to construct a covariance matrix with non-numeric variable in the matrix. Any help in this regard will be highly appreciated. Thanks in advance. Regards, B.Nataraj [[alternative HTML version deleted]]
nataraj at orchidpharma.com
2012-May-31 11:37 UTC
[R] Optimizing variables represented in a matrix
Dear R-list members, I have a matrix with non-numeric variables in it and I have to optimize the variables of the matrix in a formula using optim routine of the stats4 package. I know the matrix can only take numeric data and so I would like to know how to store non-numeric variables inside a matrix. Say for example: The 3X3 matrix is 0.05V1+V2 0.31V1 0.05V1 0.31V1 0.3V1+V2 0.5V1 0.05V1 0.5V1 0.1V1+V2 The matrix is only for an example and the real matrix that I want to use is a 15X15 matrix ,here I would like to optimize the values of V1 and V2 using a formula. Could you please help me how to go about to represent the matrix in R. Thanks in advance! B.Nataraj
If you want an helpful answer, you must describe your real problem MUCH better! This is way too confused. Kjetil On Thu, May 31, 2012 at 7:37 AM, <nataraj at orchidpharma.com> wrote:> > Dear R-list members, > > I have a matrix with non-numeric variables in it and I have to optimize the variables of the matrix in a formula using optim routine of the stats4 package. I know the matrix can only take numeric data and so I would like to ?know how to store non-numeric variables inside a matrix. > > Say for example: The 3X3 matrix is ? ? 0.05V1+V2 ? ?0.31V1 ? ? ? ?0.05V1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0.31V1 ? ? ? 0.3V1+V2 ? ? ?0.5V1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.05V1 ? ? ? 0.5V1 ? ? ? ? 0.1V1+V2 > > The matrix is only for an example and the real matrix that I want to use is a 15X15 matrix ,here I would like to optimize the values of V1 and V2 using a formula. > > Could you please help me how to go about to represent the matrix in R. > > Thanks in advance! > > B.Nataraj > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.