[R] Est of SE of coefficients from lm() function
Dear all R users, Can anyone tell me how I can get estimate of SE of coefficients from, lm() function? I tried following : x = 1:10 lm(x[-1]~x[-10]-1)$coefficients Here I got the est. of coefficient, however I also want to get some automated way to get estimate of SE. Regards, [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Regarding Bivariate normal distribution.
Dear all R gurus, My question is related to statistics rather directly to R. Suppose (X,Y) has a bivariate normal distrubution. I want to find two values of X and Y say x, and y respectively, such that: P[Xx, Yy] = 0.05 My questions are : 1. Can x and y be uniquely found? 2. If it is, how I can find them using R Your help will be highly appreciated. Thanks and regards, __ R-help@stat.math.ethz.ch 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.
[R] Problem while working with SPSS data
Dear all R users, I got a strange problem while working with SPSS data : I wrote following : library(foreign) data.original = as.data.frame(read.spss(file=c:/Program Files/SPSS/Employee data.sav)) data = as.data.frame(cbind(data.original$MINORITY, data.original$EDUC, data.original$PREVEXP, data.original$JOBCAT, data.original$GENDER)) colnames(data) = c('MINORITY', 'EDUC', 'PREVEXP', 'JOBCAT', 'GENDER') head( data.original) ID GENDER BDATE EDUC JOBCAT SALARY SALBEGIN JOBTIME PREVEXP MINORITY 1 1 NA 11654150400 15 Manager 5700027000 98 144 No 2 2 NA 11852956800 16 Clerical 4020018750 98 36 No 3 3 NA 10943337600 12 Clerical 2145012000 98 381 No 4 4 NA 115025184008 Clerical 2190013200 98 190 No 5 5 NA 11749363200 15 Clerical 4500021000 98 138 No 6 6 NA 11860819200 15 Clerical 3210013500 98 67 No head( data) V1 V2 V3 V4 V5 1 1 5 144 4 NA 2 1 6 36 2 NA 3 1 3 381 2 NA 4 1 2 190 2 NA 5 1 5 138 2 NA 6 1 5 67 2 NA here I got the values of variable V2 as 5,6,3,...etc which should be 15,16,12, can anyone tell me why I got that? And my second question is that in my data.original why I got the values of GENDER as NA? Is there any way to get the actual values i.e. m, and f? Thanks Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Drawing Tangent
Dear all R-users, I would like to draw a tangent of a given function for a particular (given) point. However the straight line representing it should not cut any axis, it should be a small line. Can anyone tell me how to do this? Thanks, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Cumulant
Dear all R users, Is there any function to calculate sample cumulant in R for any order? I did make a search using RSiteSearch but got only cum3 function. Your help will be highly appreciated. Thanks [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Combining two datasets
Dear all R users, Suppose I have two data sets: data1: 1,3,5,7,9 data2: 2,4,6,8 Now I want to combine these two data sets like that: data = 1,2,3,4,5,6,7,8,9 Can anyone tell me how to do that? Thanks and regards, [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Finding the effect of Box-Cox transformation using vis.boxcoxu
Dear all R users, I have a dataset 'data' and I want to see the effect of Box-Cox transformation on it Interactively for different lambda values. I already got a look on function vis.boxcoxu in package TeachingDemos. But I didn't find any option to put user's own dataset. Can anyone tell me how to put my own dataset here i.e. data? Thanks and regards, [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Insert R logo
Dear all R users, I want to insert the R logo in every graphic that I made in my Statistical analysis using R. Can anyone tell me whether is it possible or not and if possible how to do this? your help will be highly appreciated. Thanks and Regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] 3D Plot
Hi all R users, I want to draw a 3D plot, where the Z-axis will represent the normal densities each with zero mean but different volatilities, Y-axis will represent the SD [volatilities), and X-axis will represent time at which these SD are calculated. Can anyone give me any clue? Your help will be highly appreciated. Thanks and regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Time series plot
Dear all R users, Suppose I have a data set like this: date price 1-Jan-02 4.8803747 2-Jan-02 4.8798430 3-Jan-02 4.8840133 4-Jan-02 4.8803747 5-Jan-02 4.8749683 6-Jan-02 4.8754263 7-Jan-02 4.8746628 8-Jan-02 4.8753500 9-Jan-02 4.8882416 10-Jan-02 4.8895217 11-Jan-02 4.8871108 I want to get a time series plot of that dataset. But in x-axis I want to see the first day, and last day, and other day in between them i.e. 1-Jan-02, 6-Jan-02, and 11-Jan-02 only. Can anyone tell me how to do that? My second question is that is there any way to define a secondary axis like Microsoft Excel in the same plot window? Thanks and regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] fmincon equivalent in R
Dear all R users, I am wondering if there are any function for Constraint optimization in R. Especially i am looking for a R - equivalent of fmincon function in MATLAB. Thanks and regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Constraint Optimization problem.
Dear all R users, I have a optimization problem like this: f(x,y) is a function with two variables, x, and y. Variable x is unbounded but y lies between [-10, 10]. I want to minimize f(x,y) subject to a constraint x + y 5. Can anyone tell me which R function should I use. I already gone through ?constrOptim. But here I cannot specify lower and upper bounds for x, and y. However if I use ?optim function then I can not specify the constraint. can anyone give me any clue? any help will be highly appreciated. Thanks and regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Hessian matrix
Dear all R users, Is there any way to calculate hessian matrix of a given function at any given point? Regards [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Calculation of Eigen values.
Dear all R users, Can anyone tell me to calculate Eigen value of any real symmetric matrix which algorithm R uses? Is it Jacobi method ? If not is it possible to get explicit algorithm for calculating it? Thanks and regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
Re: [R] Need help to estimate the Coef matrices in mAr
Dear Spencer, Thank you very much for your attention on my problem. According to your advice I did some home work on this problem, but unfortunately I could not solve my problem. Suppose I have a dataset of length 300 with 2 variables. And I want to fit a VAR model on this of order 2. I went through the function mAr.est and got understand that, here 'K' is a matrix with (300-2) rows and 7 columns. the first col. consists only 1, next two columns consist of lagged values of two variables with lag-length 2, next two col. consist of lagged value with lag length-1, and next two cols are for lag-length-0. Next, they add additional a 7-7 matrix to K. For this matrix diagonal elements are the square root of sum of square of elements of K (col. wise) and rest of the elements are 0. I feel that this matrix, that is added to K, is the key matrix for any type of modification that you prescribed. Therefore for experimental purpose I put NA against one of its off-diagonal elements. But I got error. However I cannot understand why they put such figures for diagonal and off-diagonal elements of that matrix. Can you suggest me any solution more specifically? Thanks and regards, Arun On 9/4/06, Spencer Graves [EMAIL PROTECTED] wrote: Have you tried 'RSiteSearch(multivariate autoregression, functions)'? This produced 14 hits for me just now, the first of which mentions a package 'MSBVAR'. Have you looked at that? If that failed, I don't think it would be too hard to modify 'mAr.est' to do what you want. If it were my problem, I might a local copy of the function, then add an argument accepting a 2 or 3-dimensional array with numbers for AR coefficients to be fixed and NAs for the coefficients. Then I'd use 'debug' to walk through the function line by line until I figured out how to modify the function to do what I wanted. I haven't checked all the details, so I don't know for sure if this would work, but the function contains a line 'R = qr.R(qr((rbind(K, diag(scale, complete = TRUE)' which I would start by decomposing, possibly starting as follows: Z - rbind(K, diag(scale) I'd figure out how the different columns of Z relate to my problem, then modify it appropriately to get what I wanted. Another alternative would be to program it from scratch using something like 'optim' to minimize the sum of squares of residuals over the free parameters in my AR matrices. I'm confident I could make this work, even if the I somehow could not get it with either of the other two. There may be something else better, e.g., a Kalman filter representation, but I can't think how to do that off the top if my head. Hope this helps. Spencer Graves Arun Kumar Saha wrote: Dear R users, I am using mAr package to fit a Vector autoregressive model to my data. But here I want to put some predetermined values for some elements in coefficient matrix that mAr.est going to estimate. For example if p=3 then I want to put A3[1,3] = 0 and keep rest of the elements of coefficient matrices to be determined by mAr.est. Can anyone please tell me how can I do that? Sincerely yours, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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. -- Arun Kumar Saha, M.Sc.[C.U.] S T A T I S T I C I A N[Analyst] RISK MANAGEMENT DIVISION Transgraph Consulting [www.transgraph.com] Hyderabad, INDIA Contact # Home: (91-033) 25558038 Office: (91-040) 30685012 Ext. 17 FAX: (91-040) 55755003 Mobile: 919989122010 E-Mail: [EMAIL PROTECTED] [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Need help to estimate the Coef matrices in mAr
Dear R users, I am using mAr package to fit a Vector autoregressive model to my data. But here I want to put some predetermined values for some elements in coefficient matrix that mAr.est going to estimate. For example if p=3 then I want to put A3[1,3] = 0 and keep rest of the elements of coefficient matrices to be determined by mAr.est. Can anyone please tell me how can I do that? Sincerely yours, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] How to change the color of Plot area.
Dear all R users, Is there any effective way to change the body color of any plot? I am aware of the function par(bg=black), but the problem with this is, it change the color of entire graphics window. But I want to see that only plot area will have color for example RED and rest of the area should have BLACK color. And I also I want to know is there any way to change the border-color (which is by default BLACK) of the plot area. Hope anyone can help me to solve this. Thanks and regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Adding a footnote in plot-window in R
Dear all R users, Suppose, x = rnorm(1000) y = rt(1000,3) plot(range(1:1000),range(x,y),type=n,xlab=NA,ylab=NA) lines(x,col=red) lines(y,col=blue) Now I want to put a footnote in the plot window to tell that RED lines represents the random numbers from normal-dist and blue line represents the random numbers from t-dist. Can anyone please tell me how to do that? Sincerely yours, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Waring message in mvBEKK.est
Deal all R users, I am getting a warning message negative inverted hessian matrix element in: mvBEKK.est(weekly.return.all, order = c(2, 1)) while I am using mvBEKK.estlibrary to estimate time varying Covariance matrix using Bivariate Garch. Can anyone please tell me in details why I am getting this message and what is the remedy for that? Sincerely yours, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Adding Grid lines
Dear all R users, Can anyone please tell me how to add grid lines in any plot in R including in Histogram, QQ plot etc? Thanks and regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Geometrical Interpretation of Eigen value and Eigen vector
Dear all, It is not a R related problem rather than statistical/mathematical. However I am posting this query hoping that anyone can help me on this matter. My problem is to get the Geometrical Interpretation of Eigen value and Eigen vector of any square matrix. Can anyone give me a light on it? Thanks and regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Problem with allp ossible combination.
Dear R Users, Suppose I have a dataset like this: a b 39700 485.00 39300 485.00 39100 480.00 38800 487.00 38800 492.00 39300 507.00 39500 493.00 39400 494.00 39500 494.00 39100 494.00 39200 490.00 Now I want get a-b for all possible combinations of a and b. Using two 'for' loop it is easy to calculate. But problem arises when row length of the data set is large eg. 1000 or more. Then R takes lot of time to do that. Can anyone please tell me whether there is any R-function to do such kind of job quickly? Thanks and regards, [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] GARCH
Dear all R-users, I have a GARCH related query. Suppose I fit a GARCH(1,1) model on a dataframe dat garch1 = garch(dat) summary(garch1) Call: garch(x = dat) Model: GARCH(1,1) Residuals: Min 1Q Median 3Q Max -4.7278 -0.3240 0. 0.3107 12.3981 Coefficient(s): Estimate Std. Error t value Pr(|t|) a0 1.212e-04 2.053e-0659.05 2e-16 *** a1 1.001e+00 4.165e-0224.04 2e-16 *** b1 2.435e-15 1.086e-02 2.24e-131 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Diagnostic Tests: Jarque Bera Test data: Residuals X-squared = 54480.76, df = 2, p-value 2.2e-16 Now I want to store the value of Pr(|t|) for coefficient a0, a1, and b1, and also values of these coefficients, so that I can use them in future separately. I know that I can do it for coefficients by using the command: coef(garch1)[a0] etc, but not for Pr(|t|). Can anyone please tell me how to do this? Thanks and regards, [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Garch warning
Dear all R-users, Previously I posted the same query in R-Help. But I haven't got the solution. So I am posting the same query again. It is my strong hope that I will get my solution this time. I wanted to fit a Garch(1,1) model to the following data set by: garch1 = garch(dat) But I got a warning message while executing, which is: Warning message: NaNs produced in: sqrt(pred$e) dat 0.018078 -0.0017 0.019082 0.000448 0.006055 -0.02908 -0.0171 0.136383 - 0.01098 0.014523 -0.02504 -0.01261 -0.01301 -0.01937 0.031302 0.001924 0.016204 -0.01743 -0.00676 0.016391 0.037661 0.009682 -0.00311 0.034842 0.007326 0.004407 0.025833 0.013588 0.014807 0.030997 -0.02917 -0.01277 - 0.02489 0.003631 0.020853 0.001613 0.016834 0.144082 -0.01198 0.009475 - 0.00944 -0.00731 0.00854 -0.0211 -0.00037 -0.01354 -0.009 -0.00294 0.03639 0.005408 0.001024 -0.01789 -0.00682 -0.02709 0.015037 0.014098 -0.02083 - 0.00259 0.003773 -0.01239 0.002841 0.006787 -0.0069 -0.00729 0.003035 0.001797 0.000785 0.001065 0 -0.00062 -0.00022 0.000673 0.001064 0.000168 - 0.0019 0.000224 0.000224 0 -0.00022 0.000616 0 0.000448 0.000224 -0.00106 0.137144 0.00453 -0.00234 0.009654 0.017495 0.043445 0.036829 0.12604 - 0.06833 0.075942 -0.0157 0.012691 0.0006 0.011262 -0.01698 0.001169 0.035891 0.026974 -0.01448 -0.01285 0.010269 -0.00944 -0.00627 -0.02959 -0.00226 - 0.00658 -0.01566 0.002465 -0.00595 -0.00071 -0.02837 0.011752 0.000191 - 0.01585 0.003368 0.017396 -0.01288 -0.01559 -0.00301 0.009209 -0.00362 - 0.00477 -0.00588 0.011478 0.002748 0.01776 0.025986 -0.01573 -0.00452 - 0.01353 -0.01166 -0.01138 -0.00419 0.020279 -0.00736 -0.0178 0.017386 - 0.04783 -0.00973 -0.01211 -0.01552 0.020297 -0.00268 0.020165 -0.03628 0.004313 0.002682 0.009511 -0.0543 0.016064 0.020505 0.005516 0.02107 0.00809 0.021399 0.104238 -0.10466 0.025576 -0.00577 -0.01866 -0.00736 - 0.00443 0.004892 0.012944 0.015257 -0.00633 -0.01304 -0.0065 -0.00791 - 0.00226 0.033313 0.011476 -0.0111 -0.00365 0.033186 0.02298 -0.0037 0.002046 -0.01238 0.008637 -0.00032 -0.00685 -0.01352 -0.00169 0.011631 0.00227 0.003654 0.007346 0.001533 0.005212 0.009414 0.0202 0.011882 -0.00218 - 0.00316 7.54E-05 -0.02038 0.011471 -0.00396 -0.00658 0.006229 0.002735 - 0.00633 0.001307 -0.00802 -0.0007 -0.01103 0.008764 -0.00781 0.01373 - 0.00125 -0.01414 0.008101 0.001142 -0.011 0.010643 0.003889 0.006915 - 0.00304 -0.00221 0.003028 -0.00171 -0.00144 -0.00396 0.001579 -0.00854 - 0.00202 0.00621 0.01185 -0.01605 -0.0063 0.003573 0.001958 0.004974 -0.00326 0.005464 0.003653 -0.00027 0.00781 -0.00609 0.007569 -0.00209 0.001707 0.007578 0.008708 -0.00078 0.070744 -0.08202 -0.00271 0.018286 0.003212 0.00232 0.000183 0.034699 0.011807 -0.00204 0.000616 3.42E-05 0.014975 - 0.00183 0.010891 0.010186 -0.00403 0.01614 0.002654 -0.0057 0.005801 0.034555 0.00405 0.010423 -0.00521 -0.00558 -0.00762 -0.00405 0.001195 0.002731 -0.01309 -0.00283 0.004433 -0.0118 -0.01089 0.004808 -0.00773 0.006685 -0.00064 0.004273 0.038674 -0.02693 -0.02044 0.021999 0.007472 0.011074 -0.01286 0.00217 -0.00481 0.000436 0.000871 0.003755 0.003 0.00697 0.006982 -0.00576 -0.00119 -0.00242 -0.00257 -0.00242 0 -0.00808 0.001454 0.000958 0.000124 -0.01118 0.000406 -0.00976 -0.00117 -0.01069 -0.0011 - 0.00156 0.004814 -0.00563 0.004265 0.009255 -0.01358 -0.00346 0.003791 - 0.00395 -0.00068 0.005023 -0.00586 -0.00207 0.00035 0.0073 0.00158 0.006326 0.004164 0.011432 -0.0017 -0.00139 -0.00372 0.01356 0.014993 -0.00602 0.011983 -0.00898 -0.00183 0.008998 -0.00252 -0.00448 0.006338 0.002094 - 0.00744 0.000873 0.029343 -0.00155 0.005344 0.007062 0.004139 2.85E-05 0.00325 -0.00445 0.005597 0.004748 0.003125 0.002022 0.003193 0.002039 - 0.00017 0.005511 -0.00264 0.001279 8.34E-05 -0.00636 0 -2.83E-05 0.002344 0.005121 0.009747 0.001056 -0.0049 -0.00137 -0.00029 -0.00249 0.002091 0.010335 -0.00105 0.001502 -0.00051 -0.00113 0 -0.00023 -0.00098 0 0.008371 -0.01234 0.00058 0.002855 0.000115 0.007058 -0.00513 0.002124 -0.00169 - 0.00242 0.0021 -0.00164 -0.00154 -0.00889 -0.0047 -0.00306 -0.00979 -0.0031 0.001016 -0.00467 -0.00952 -0.00147 -0.00335 -0.00361 -0.02078 -0.00466 0.007358 0.012572 0.011018 -0.00369 0.004359 0.002006 -0.00955 0.002938 - 0.00314 0.001294 -0.00912 0.000123 -0.01086 9.36E-05 0.006065 -0.00311 0.004562 -0.0004 -0.00276 -0.01364 -0.0005 0.007126 0.004463 0.005373 0.000836 0.005802 0.001599 -0.01348 -0.01842 -0.0056 -0.00329 -0.00526 0.001253 -0.00813 0.004265 0.00694 0.005237 -0.00771 9.63E-05 -0.00019 0.005506 -0.00026 -0.00195 0.003003 0.001944 0.000699 0.000508 0.00073 0.000222 0.005727 0.001041 -0.00404 -0.01018 -0.00307 -0.00865 0.001065 - 0.00686 0.002142 0.000907 0.000162 0.003807 -0.00177 -0.00398 -0.00399 - 0.00117 0.002893 -0.00081 -0.00068 0.002409 -0.00639 -0.0062 -0.00617 0.005078 -0.00292 0.00226 -0.04239 0.003596 -0.00117 -0.00131 0.003765 0.000793 0.006592 -0.00123 0.001917 0.003005 0.001876 -0.0016 -0.00229 - 0.00347 0.002996 -0.00203 -0.00273 0.002313 -0.00431 0.000187 0.002663 - 0.0008 -0.00227 -0.00227
[R] Problem on Matrix multiplication
Dear all r-users, I am getting a big problem with matrix multiplication suppose I have, weight Weight 1 1067640 2 8871500 3 42948778 4 127583735 5 2200 6 4400 7 5685 8 23805662 and, s a b c d e f g h a 402493.18 -133931.62 461483.3 -94042.86 674493.8 -1493713.2 - 714081.5 -1320551.6 b -133931.62 192766.63 -414674.4 -36700.74 -276595.3 798034.6 382661.6 883478.4 c 461483.25 -414674.43 1618660.4 660949.18 988526.5 -2795048.7 - 1483334.1 -1761234.9 d -94042.86 -36700.74 660949.2 1053310.43 -300291.4 -98814.9 - 263716.7 1130451.3 e 674493.80 -276595.33 988526.5 -300291.35 3090869.8 -3017747.3 - 1766040.6 -2295605.0 f -1493713.19 798034.60 -2795048.7 -98814.90 -3017747.3 10558734.1 4415620.8 6200897.7 g -714081.51 382661.62 -1483334.1 -263716.67 -1766040.6 4415620.8 2593947.5 2341455.0 h -1320551.58 883478.39 -1761234.9 1130451.26 -2295605.0 6200897.7 2341455.0 7756557.3 But when I want to get [transpose(weight)][s][weight] using following syntax, t(weight)%*%s%*%weight I got error: Error in t(weight) %*% s %*% weight : requires numeric matrix/vector arguments Can anyone please tell me that where my error is? Thanks and regards, [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Garch Warning
Dear Spencer, Can you be more clear on your suggestion? On 6/15/06, Spencer Graves [EMAIL PROTECTED] wrote: Your example is not reproducible. Have you tried walking through the code line by line after debug(garch)? After you've tried that, if you'd still like help from this listserve, please submit a simple, self-contained / reproducible example, as suggested the posting guide! www.R-project.org/posting-guide.html. hope this helps. spencer graves Arun Kumar Saha wrote: Dear all R-users, I wanted to fit a Garch(1,1) model to a dataset by: garch1 = garch(na.omit(dat)) But I got a warning message while executing, which is: Warning message: NaNs produced in: sqrt(pred$e) The garch parameters that I got are: garch1 Call: garch(x = na.omit(dat)) Coefficient(s): a0 a1 b1 1.212e-04 1.001e+00 1.111e-14 Can any one please tell me that why got this message? What is the remedy? Thanks and Regards [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Garch Warning
Dear all R-users, I wanted to fit a Garch(1,1) model to a dataset by: garch1 = garch(na.omit(dat)) But I got a warning message while executing, which is: Warning message: NaNs produced in: sqrt(pred$e) The garch parameters that I got are: garch1 Call: garch(x = na.omit(dat)) Coefficient(s): a0 a1 b1 1.212e-04 1.001e+00 1.111e-14 Can any one please tell me that why got this message? What is the remedy? Thanks and Regards [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Combinig two data frames
Dear all r-users, Suppose I have two data frame: A 1 3 4 5 2 and B 5 6 3 5 Now I want combine this two data frames without losing any value from either data frame. More precisely I want to see AB 1 5 3 6 4 3 5 5 2 NA I tried with cbind function but failed, as it only works when two data frames have equal number of rows. Can anyone suggest me any code that can be used for any data set? Thanks and regards [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] NA values
Dear all R users, I am wondering whether there is any way to replace all NA values in a data frame by some numerical value, suppose 1000? Thanks and Regards [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Please help me to combine two datasets.
Dear r-users, Suppose I have two data sets data set-1 Date height 1/11/2005 10 2/11/2005 23 3/11/2005 54 4/11/2005 21 5/11/2005 22 data set-2 weight 32 45 11 Now I want to combine this two data sets. i.e. i want to see: Date height weight --- 3/11/2005 54 32 4/11/2005 21 45 5/11/2005 22 11 Can any one give me the required r-code to perform this? Thanks and regards, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Correlation matrix
Dear R users, Suppose I have a 4*5 data frame like this: Date x1 x2 x3 x4 1/1/2004100 22 12 34 2/1/200433-22 33 12 3/1/20041212 -115 4/1/20041 223 22 1 Now I want to get a correlation matrix for this dataset excluding column-1 and column-3 i.e. I want to get a correlation matrix for variables x1, x3, x4. I know that if this dataframe has only three columns containing x1, x3 and x4 instead of five columns then I can use cor function. If anyone give me any code for doing this I will be very grateful Thanks, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Problem with data frame
Dear r-users, suppose I have n normal distributions with parameter N(0,i) i=1,2,...,n respectively. Now I want to generate 500 random number for each distribution. And want to put all 500*n random numbers in a single data frame. I tried with following code: n=20 random = data.frame(n) for ( i in 2: length) { random[,i] = random(500,mean=0,sd=i) } but while executing this I am getting errors. Can anyone give me any suggestion? Thanks and regards Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Maximum Likelihood Estimation
hi all, Can anyone tell me how to do Maximum Likelihood Estimation in R? Thanks in advance Arun -- [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] mle.
hi all, suppose I have: r[i] ~ N(0, h[i]) h[i] = a + b*r[i-1] + c*h[i-1] for all i=2..n I want to get estimates of a, b, c by mle. Can you tell me how to do that? thanks in advance, Arun [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] how I can perform Multivariate Garch analysis in R
Dear aDVISOR, Hope I am not disturbing you. Can you tell me how I can perform Multivariate Garch analysis in R. Also please, it is my humble request let me know some resource materials on Multivariate Garch analysis itself. Sincerely yours, -- Arun Kumar Saha, M.Sc.[C.U.] S T A T I S T I C I A N[Analyst] Transgraph Consulting [www.transgraph.com] Hyderabad, INDIA Contact # Home: +91-033-25558038 Office: +91-040-55755003 Mobile: 919849957010 E-Mail: [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html