search for: rfun

Displaying 5 results from an estimated 5 matches for "rfun".

Did you mean: fun
2002 Jun 13
3
Bug in rnorm. (PR#1664)
...monstrate the bug. cheers, Rolf Turner rolf@math.unb.ca #==+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== # # Script to demonstrate the bug in rnorm. # myrnorm <- function(n,mu=0,sigma=1){ mu + sigma*cos(2*pi*runif(n))*sqrt(-2*log(runif(n))) } # If RFUN <- rnorm we get ``wrong'' answers; if RFUN <- myrnorm, # we get ``right'' answers. RFUN <- rnorm NSER <- 1000 set.seed(350734) rslt <- list() for(K in 1:15) { N <- 100*K M <- matrix(RFUN(NSER*N),N,NSER) T2 <- apply(M,2,function(x){max(x**2)}) PV &...
2012 Jan 24
1
problems with rollapply {zoo}
...{ rv = 2*p[3]+6*p[4]*x+12*p[5]*x*x;rv;} # evaluate the second derivative at the ith root, and print the result r <- dd(pr[i]) r } rollRegFun(alpha,1) rollRegFun(alpha,2) rollRegFun(alpha,3) The code I show above does not give an error, but if the function is re-written as: rFun <- function(d) { d$rt <- seq(1-nrow(d),0) polyfit <- lm(Close ~ poly(rt,4),d) p <- coef(polyfit) pr <- polyroot(c(p[2],2*p[3],3*p[4],4*p[5])) dd <- function(x) { rv = 2*p[3]+6*p[4]*x+12*p[5]*x*x;rv;} r <- dd(pr[1]) r } And I try to get rollapply to ex...
2005 Dec 23
2
convolution of the double exponential distribution
Is there any R function that computes the convolution of the double exponential distribution? If not, is there a good way to integrate ((q+x)^n)*exp(-2x) over x from 0 to Inf for any value of q and for any positive integer n? I need to perform the integration within a function with q and n as arguments. The function integrate() is giving me this message: "evaluation of function gave a
2009 Jan 08
1
R and Excel
Even using the VBA back of Excel to create interfaces with R would make a lot of sense. Suppose I could have access to VBA macros that import and export data into R , it would be great. The R GUI series like Rattle come even closer to Excel...so a VBA _R_ExCel package might be useful to ordinary folks . Besides Excel costs money, so adding R functions to Open Office would help both of them ( if
2010 Mar 09
4
Scripts from The Elements of Statistical Learning book
Anyone know if it is possible to get the R scripts used in the "The Elements of Statistical Learning" book? It is a great book but sometimes some help would be useful to replicate the results presented in the book and so, understood things better. Thanks Manuel -- View this message in context: