FMH
2009-Jun-03 19:31 UTC
[R] Function in R for computing correlation matrix and covariance matrix
Hi, At present, i have two distinct and real values for the coefficient, which is required in AR(2) model. Based on my revision, for distinct and real values of the coefficients in AR(2) model, the correlation structure separated by lag h can be computed by p(h) = a*z1^(-h) + b*z2^(h), where p(h) is the autocorrelation separated by lag h, a and b can be determined by initial values, z1 and z2 are the coefficients of AR(2). I'm trying to compute the correlation matrix and the covariance matrix from this AR(2) model, via automatic function in R, but can't find any suitable functions. Could someone guide me, please? Thanks Fir [[alternative HTML version deleted]]
Bert Gunter
2009-Jun-03 19:54 UTC
[R] Function in R for computing correlation matrix and covariancematrix
?ar ?arima help.search("autoregressive") Bert Gunter Genentech Nonclinical Biostatistics -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of FMH Sent: Wednesday, June 03, 2009 12:31 PM To: r-help at r-project.org Subject: [R] Function in R for computing correlation matrix and covariancematrix Hi, At present, i have two distinct and real values for the coefficient, which is required in AR(2) model. Based on my revision, for distinct and real values of the coefficients in AR(2) model, the correlation structure separated by lag h can be computed by p(h) = a*z1^(-h) + b*z2^(h), where p(h) is the autocorrelation separated by lag h, a and b can be determined by initial values, z1 and z2 are the coefficients of AR(2). I'm trying to compute the correlation matrix and the covariance matrix from this AR(2) model, via automatic function in R, but can't find any suitable functions. Could someone guide me, please? Thanks Fir [[alternative HTML version deleted]]