similar to: Covariance matrix

Displaying 20 results from an estimated 1000 matches similar to: "Covariance matrix"

2008 Aug 04
2
Multivariate Regression with Weights
Hi all, I'd like to fit a multivariate regression with the variance of the error term porportional to the predictors, like the WLS in the univariate case. y_1~x_1+x_2 y_2~x_1+x_2 var(y_1)=x_1*sigma_1^2 var(y_2)=x_2*sigma_2^2 cov(y_1,y_2)=sqrt(x_1*x_2)*sigma_12^2 How can I specify this in R? Is there a corresponding function to the univariate specification lm(y~x,weights=x)??
2008 Aug 08
3
Multivariate regression with constraints
Hi all, I am running a bivariate regression with the following: p1=c(184,155,676,67,922,22,76,24,39) p2=c(1845,1483,2287,367,1693,488,435,1782,745) I1=c(1530,1505,2505,204,2285,269,1271,298,2023) I2=c(8238,6247,6150,2748,4361,5549,2657,3533,5415) R1=I1-p1 R2=I2-p2 x1=cbind(p1,R1) y1=cbind(p2,R2) fit1=lm(y1~-1+x1) summary(fit1) Response 2: Coefficients: Estimate Std. Error t value
2008 Jul 30
2
Sampling two exponentials
Hi all, I am going to sample two variables from two exponential distributions, but I want to specify a covariance structure between these two variables. Is there any way to do it in R? Or is there a "Multivariate Exponential" thing corresponding to the multivariate normal? Thanks in advance. Sincerely, Yanwei Zhang Department of Actuarial Research and Modeling Munich Re America Tel:
2008 Jul 25
3
Numerical question
Hi all, I have n independent variables A_1, A_2, A_3,......,A_n, and each with known variances var(A_1), var(A_2),..., but unknown mean. How can I get the approximation of the variance of the product of the variables using numerical computation, i.e. var(A_1*A_2*A_3*.....*A_n)? Thanks. Sincerely, Yanwei Zhang Department of Actuarial Research and Modeling Munich Re America Tel: 609-275-2176
2008 Aug 07
4
Switch two rows in a matrix
Hi all, I have a 4 by 4 matrix, and I want to switch row 2 and row 3 first, then switch column 2 and column 3. Is there an easy way to do it? The following is a tedious way to get what I want. But I wonder if there is a way to simplify this. > a=matrix(rnorm(16),4,4) > a [,1] [,2] [,3] [,4] [1,] 0.33833811 -0.9422273 -0.06181611 -1.8346134 [2,] -0.68167996
2008 Jul 23
1
Questions on weighted least squares
Hi all, I met with a problem about the weighted least square regression. 1. I simulated a Normal vector (sim1) with mean 425906 and standard deviation 40000. 2. I simulated a second Normal vector with conditional mean b1*sim1, where b1 is just a number I specified, and variance proportional to sim1. Precisely, the standard deviation is sqrt(sim1)*50. 3. Then I run a WLS regression without the
2008 Aug 12
1
VAR question
Hi all, I got another VAR question here and really appreciate if somebody would help me out :) I have five time series, say A,B,C,D,E. My objective is to predict the series A using the rest, that is, B, C, D and E. A Vector Autoregression Model should work here. But first of all, I should select which series of B, C, D and E to be include in the VAR model, as well as the number of lags. I wonder
2008 Aug 06
1
Matrix multiplication
Hi all, Is there an easy way to do cumulative matrix multipliation in R? What's the syntex? Thanks. Sincerely, Yanwei Zhang Department of Actuarial Research and Modeling Munich Re America Tel: 609-275-2176 Email: yzhang@munichreamerica.com<mailto:yzhang@munichreamerica.com> [[alternative HTML version deleted]]
2008 Sep 05
1
Plot by column
Dear list, I have the following matrix. How can I make the following plot? 1. The x-axis has index 1:7, and the first column is plotted against index 1, second against 2, and so on. 2. I want the points from the left upper conner including the antidiagonal to be plotted with col=2, and the rest with col=3 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.589 0.857 0.923 0.944 0.954 0.963
2010 Feb 26
1
need help to resolve RODBC error
I've installed R-2.9.2 (64 bit), unixODBC-2.2.14-p2 (64 bit) and RODBC_1.2-5 (64 bit) on a 64 bit Redhat Linux server (Red Hat Enterprise Linux Server release 5.4 (Tikanga), x86_64) release 2.6.18-164.2.1.el5. I've tested the ODBC drive via isql and the test was success: [yzhang@ROracleTest ~]$ isql -v DRTST yzhang test +---------------------------------------+ | Connected!
2011 May 16
4
Problem on glmer
Hi all, I was trying to fit a Gamma hierarchical model using "glmer", but got weird error message that I could not understand. On the other hand, a similar call to the glmmPQL leads to results that are close to what I expect. I also tried to change tha "nAGQ" argument in "glmer", but it did not solve the problem. The model I was fitting has a simple structure - one
2011 Sep 07
1
Fwd: FSelector and RWeka problem
Hi all, Although I sent the mail to Piotr, the author of FSelector, it should be better to ask here to let others know. Yanwei Begin forwarded message: From: Yanwei Song <yanwei.song@gmail.com> Date: September 7, 2011 4:41:58 PM EDT To: p.romanski@stud.elka.pw.edu.pl Subject: FSelector and RWeka problem Dear Piotr, Thanks for developing the FSelector package for us. I'm a new
2010 Sep 02
1
Help on glm and optim
Dear all, I'm trying to use the "optim" function to replicate the results from the "glm" using an example from the help page of "glm", but I could not get the "optim" function to work. Would you please point out where I did wrong? Thanks a lot. The following is the code: # Step 1: fit the glm clotting <- data.frame( u =
2010 Feb 26
1
S4 programming
Dear all, I'm new to S4 classes and have a question on this. I want to use S4 because I want to define explicitly the slots that the new class can have. But other than that, the new class behaves exactly like a list. But this will not allow me to use the generic functions that are already defined for class "list", such as "$", "c", "[[",
2009 Jun 15
1
Create R object
Dear R users, I have two simple questions here, and hope someone can help me on this. Thanks in advance. 1. I have a list object lst=list(a1=matrix(rnorm(4),2,2), a2=matrix(rnorm(4),2,2),a3=matrix(rnorm(4),2,2)). Here I only use three elements for illustration, and in fact the length of lst, n, is unknown in advance. I want to define an object for each element of this lst, and the objects have
2010 Mar 01
1
Method dispatch
Dear all, In a package, I defined a method for "summary" using setMethod(summary, signature="abc") for my class "abc", but when the package is loaded, the function "summary(x)" where x is of class "abc" seems to have called the default summary function for "ANY" class. Shouldn't it call the method I have defined? How could I get
2010 Sep 09
5
Help on simple problem with optim
Dear all, I ran into problems with the function "optim" when I tried to do an mle estimation of a simple lognormal regression. Some warning message poped up saying NANs have been produced in the optimization process. But I could not figure out which part of my code has caused this. I wonder if anybody would help. The code is in the following and the data is in the attachment. da <-
2001 Feb 16
1
command line R; readline history
Hello, I need help now. I installed R in my Solaris 5.8 box. But two things I am missing comparing to my old Splus. 1. I used to invoke a command edit Splus by type "Splus -e". So I can surfer in Splus like ksh environment. Can I do the same in R? 2. I used BSD version of R, which I can use "up" key to call back last command. But in Sun, I can't make it happened. I
2010 Jan 03
5
update packages from local
Hi all, I have an old package installed, say "abc". Now I made some changes to the source, and built a new version of the source code "abc_0.1.1.tar.gz". How can I update the old package to this newer version from the local tar.gz file? I was running the following, but it did not work. setwd("directory where the tar.gz file locates")
2013 Jan 17
2
error installing KEGGSOAP
Hi, I am new to bioconductor, trying to install KEGGSOAP package, but got warnings() when installing and error message when trying to load the package, can anyone suggest what went wrong? many thanks John > source("http://bioconductor.org/biocLite.R") Bioconductor version 2.11 (BiocInstaller 1.8.3), ?biocLite for help > biocLite("KEGGSOAP") BioC_mirror: