similar to: extracting the mode of a vector

Displaying 20 results from an estimated 3000 matches similar to: "extracting the mode of a vector"

2007 Mar 16
3
ARIMA standard error
Hi, Can anyone explain how the standard error in arima() is calculated? Also, how can I extract it from the Arima object? I don't see it in there. > x <- rnorm(1000) > a <- arima(x, order = c(4, 0, 0)) > a Call: arima(x = x, order = c(4, 0, 0)) Coefficients: ar1 ar2 ar3 ar4 intercept -0.0451 0.0448 0.0139 -0.0688 0.0010 s.e.
2006 Jun 23
2
Time series labeling with Zoo
Hi, I'm using zoo because it can automatically label the months of a time series composed of daily observations. This works well for certain time series lengths, but not for others, e.g.: While: > library(zoo) > plot(zoo(runif(10), as.Date("2005-06-01") + 0:50)) Shows up the months and day of month, > plot(zoo(runif(10), as.Date("2005-06-01") + 0:380))
2009 Nov 27
2
Symmetric Matrix classes
Hi, I'd like to store large covariance matrices using Matrix classes. dsyMatrix seems like the right one, but I want to specify just the upper/lower triangle and diagonal and not have to instantiate a huge n^2 vector just for the sake of having half of it ignored: Dumb example: M <- new("dsyMatrix", uplo="U", x=rnorm(1e4), Dim=as.integer(c(100, 100))) diag(M) <- 1
2008 May 16
1
Dimensions of svd V matrix
Hi, I'm trying to do PCA on a n by p wide matrix (n < p), and I'd like to get more principal components than there are rows. However, svd() only returns a V matrix of with n columns (instead of p) unless the argument nv=p is set (prcomp calls svd without setting it). Moreover, the eigenvalues returned are always min(n, p) instead of p, even if nv is set: > x <-
2009 Mar 10
1
S4 generic masking S3 generic when using namespace
Hi, I have two example packages, test1 and test2, where the only code in them is: setGeneric("predict", function(object, ...) standardGeneric("predict")) (get them from http://www.cs.mu.oz.au/~gabraham/test1.tar and http://www.cs.mu.oz.au/~gabraham/test2.tar) The difference between them is that first does not have a namespace, and loads fine. The second has a namespace
2008 Apr 03
1
Lapack error in Design:::ols
Hi, I'm trying to use Frank Harrell's Design:::ols function to do regression of y (numeric) on the interaction of two factors (x1 and x2), but Lapack throws an error: > library(Design) ... > load(url("http://www.csse.unimelb.edu.au/~gabraham/x")) > ols(y ~ x1 * x2, data=x) Error in chol2inv(fit$qr$qr) : 'size' cannot exceed nrow(x) = 20 > traceback()
2008 May 18
1
predict.prcomp: 'newdata' does not have the correct number of columns
Hi, I'm doing PCA on wide matrices and I don't understand why calling predict.prcomp on it throws an error: > x1 <- matrix(rnorm(100), 5, 20) > x2 <- matrix(rnorm(100), 5, 20) > p <- prcomp(x1) > predict(p, x2) Error in predict.prcomp(p, x2) : 'newdata' does not have the correct number of columns > dim(x2) [1] 5 20 > dim(p$rotation) [1] 20 5
2010 May 26
2
cran2deb Packages.bz2 Hash Sum mismatch
Hi, I'm using Ubuntu 9.10 amd64 with cran2deb packages (I know it's meant for Debian, it's worked fine for me for many months). Recently apt-get update has to started to complain: ... Hit http://debian.cran.r-project.org testing/ Release Get:1 http://debian.cran.r-project.org testing/ Packages [515kB] Fetched 1B in 3s (0B/s) W: Failed to fetch
2008 Aug 12
1
Conflict between octave3.0-headers and r-base-dev
Hi, I'm using Ubuntu Hardy i386, and the R 2.7.1 Ubuntu packages from CRAN. The CRAN r-base-dev package depends on refblas3-dev or atlas3-base-dev, but octave3.0-headers depends on libblas-dev. The two blas packages seem to conflict, so r-base-dev and octave3.0-headers can't be installed together. Is this a known issue? Thanks, Gad $ sudo apt-get install octave3.0-headers Reading
2007 Oct 16
2
survreg's algorithm
Hi, I'm using survreg() from the survival package for parametric survival regression (modelling inter-arrival times of patients to a waiting list as exponentially distributed, with various regressors such as queue size and season). Does anyone know which algorithm survreg() uses for this? Thanks, Gad -- Gad Abraham Department of Mathematics and Statistics The University of Melbourne
2006 Jun 13
3
Multiple lag.plots per page
Hi, I'm trying to plot several lag.plots on a page, however the second plot replaces the first one (although it only takes up the upper half as it should): par(mfrow=c(2,1)) a<-sin(1:100) b<-cos(1:100) lag.plot(a) lag.plot(b) What's the trick to this? I'm using R 2.2.1 (2005-12-20 r36812) on Ubuntu Linux. Thanks, Gad -- Gad Abraham Department of Mathematics and
2008 Oct 09
2
Singular information matrix in lrm.fit
Hi R helpers, I'm fitting large number of single factor logistic regression models as a way to immediatly discard factor which are insignificant. Everything works fine expect that for some factors I get error message "Singular information matrix in lrm.fit" which breaks whole execution loop... how to make LRM not to throw this error and simply skip factors with singularity
2006 Oct 24
1
set.seed() and .Random.number
Hi R-users I have two conditions. For each condition, 100 sets of 10 random numbers from N(0,1) need to be generated. Here is my question. At the begining I specify a seed number. I want to make the 100th set of the first condition and 1st set of the second conditon the same. What do I need to do ? After generating 99th set of 10 random numbers and then saving .Random.seed then using
2007 Mar 07
1
good procedure to estimate ARMA(p, q)?
Hi all, I have some residuals from regression, and i suspect they have correlations in them... I am willing to cast the correlation into a ARMA(p, q) framework, what's the best way to identify the most suitable p, and q, and fit ARMA(p, q) model and then correct for the correlations in regression? I know there are functions in R, I have used them before, but I just want to see if I can do
2007 Apr 13
2
Fractals with R
Hi everybody, I put some R-code to a web page for drawing fractals. See http://fractalswithr.blogspot.com/ If you have some R-code for fractal images, I'm willing to include them to the page. Has somebody tried L-systems or Markov algorithm (http:// en.wikipedia.org/wiki/Markov_algorithm) with R? Best wishes, Atte Tenkanen University of Turku, Finland
2007 Oct 22
1
Newbie help: Data in an arma fit
I'd like to fit an ARMA(1,1) model to some data (Federal Reserve Bank interest rates) that looks like: ... 30JUN2006, 5.05 03JUL2006, 5.25 04JUL2006, N &lt;---- here! 05JUL2006, 5.25 ... One problem is that holidays have that "N" for their data. As a test, I tried fitting ARMA(1,1) with and without the holidays deleted. In other words, I fit the above data
2007 Mar 15
1
expm() within the Matrix package
Hi Could anybody give me a bit of advice on some code I'm having trouble with? I've been trying to calculate the loglikelihood of a function iterated over a data of time values and I seem to be experiencing difficulty when I use the function expm(). Here's an example of what I am trying to do y<-c(5,10) #vector of 2 survival times p<-Matrix(c(1,0),1,2) #1x2 matrix
2008 Dec 09
1
ARMA
Hi! Is there any package or function on R to ARMA models (Box & Jenkins, without sazonality and trend) with resources to automatic identification for p and q ? Regards, Raphael Saldanha Brazil [[alternative HTML version deleted]]
2008 Dec 11
1
help with predict in stats4
Hi, We're using stats4 for a logistic regression. The code is chdreg.logit2 <- glm(chd ~ age + sex, family = binomial) summary(chdreg.logit2) oddsratios <- coef(chdreg.logit2) exp(oddsratios) # Calculate model predicted values pred <- predict(chdreg.logit2,type="response") The glm part runs fine, and up to now so has the predict function. However, now we're
2009 Jan 27
1
Using R in a web application
Hi, I want to use R to do user-submitted jobs in a (java-based) webapp. Specifically, I want * users to upload R scripts * run the R job on user data * save the results to database I'm concerned about sandbox issues. * Is it possible to disable file read/write capability? * Can I prevent the user from loading packages (e.g. the database package). * Can I have users work on separate data