similar to: x*x*x*... vs x^n

Displaying 20 results from an estimated 10000 matches similar to: "x*x*x*... vs x^n"

2004 Oct 06
3
crossprod vs %*% timing
Hi the manpage says that crossprod(x,y) is formally equivalent to, but faster than, the call 't(x) %*% y'. I have a vector 'a' and a matrix 'A', and need to evaluate 't(a) %*% A %*% a' many many times, and performance is becoming crucial. With f1 <- function(a,X){ ignore <- t(a) %*% X %*% a } f2 <- function(a,X){ ignore <-
2014 Oct 01
1
gsl package on mavericks
hello I maintain the gsl R package, and many users have recently reported that the package does not install from source under macosx 10.9 ("mavericks"). Users typically install the gnu GSL library and are able to compile and run a small "hello world" program which executes some of the Bessel functionality of the library; but under mavericks the configure script (which uses
2003 Jun 23
3
right assignment ("->") and functions
Hi everyone check this out [R-1.7.0]: R> f1 <- function(x){x^2} R> f1 -> f2 R> f2(4) [1] 16 R> R> function(x){x^2} -> f3 function(x){x^2} -> f3 R> f3(4) Error: couldn't find function "f3" Why does right assignment "->" work in the first but not the second case? Can anyone else reproduce this? -- Robin Hankin, Lecturer, School of
2003 Feb 13
6
generic handling of NA and NaN and NULL
Hello everybody I have a generic problem which the following toy function illustrates: f <- function(n) { if(abs(n) < pi) { return(TRUE) } else { return(FALSE) } } I want it to return TRUE if abs(n)<pi and FALSE otherwise. f() is fine as far as it goes, but does not deal well with NA or NaN or NULL (I want these to signal some problem with the
2011 Apr 14
1
Using GSL Routines
Dear R-programmers, I am trying out certain methods in R, and the statistics require me to calculate n-(sample size) dimensional equations. They are not really very hard to solve - my home-brew implentation of Newton-Raphson in R succeeds most of time with simulated data. (Note that I am assured of a unique solution by theory). Problem comes in with real data, for which I should really implement
2010 Feb 28
1
Problem with gsl package
Hi all, I am new to R and am writing after having contacted Robin Hankin, who maintains the R gsl wrapper. I am trying to use an AFNI (neuroimaging analysis) program that depends on the R gsl package. When I try to use the script I wrote, I get an error that led me to suspect the gsl package was a culprit. When I do library("gsl") within R, I get: Error in dyn.load(file, DLLpath
2005 Dec 25
4
Portability and Memory Issues for R-package
I have an upcoming JASA paper with an iid sampling algorithm for Bayesian Generalized Linear models (e.g., Logit, Poisson Regression, and Conditional Logit models with multivariate normal priors). At this point, I have implemented the algorithms in C and hope to make the functions and corresponding source code available through an R package. I have successfully created the code necessary to
2005 Mar 30
3
Recall() and sapply()
Hi. I'm having difficulty following the advice given in help(Recall). Consider the two following toy functions: f1 <- function(n){ if(length(n)>1){return(sapply(n,f1))} matrix(n,n,n) } f2 <- function(n){ if(length(n)>1){return(sapply(n,Recall))} matrix(n,n,n) } f1() works as desired (that is, f(1:3), say, gives me a three element list whose i-th element is an
2009 Nov 20
1
Bessel function with large index value
I am looking for a method of dealing with the modified Bessel function K_\nu(x) for large \nu. The besselK function implementation of this allows for dealing with large values of x by allowing for exponential scaling, but there is no facility for dealing with large \nu. What would work for me would be an lbesselK function in the manner of lgamma which returned the log of K_\nu(x) for large
2007 Oct 03
1
error installing gsl pkg
Newbie here (to R) and running Linux... > install.packages("gsl","~/R") ... trying URL 'http://cran.wustl.edu/src/contrib/gsl_1.8-4.tar.gz' Content type 'application/x-tar' length 57051 bytes opened URL ================================================== downloaded 55Kb * Installing *source* package 'gsl' ... checking for gcc... gcc checking for C
2007 Feb 20
2
analysis of correlation matrices
Hello, I'm looking for a package in R that performs, analysis of correlation matrices: cross-classified by 2 factors. The orginal reference to this method is by CJ Brien Biometrica (1998) 75(3):469-76. THank you, Agnes ------------------------------------- E. Agnes Richards, Ph.D. Candidate Department of Zoology University of Toronto at Mississauga 3359 Mississauga Rd. North
2014 May 14
1
large integer values
Dear devels, I need to create a (short) vector in C, which contains potentially very large numbers, exponentially to the powers of 2. This is my test example: lgth = 35; int power[lgth]; power[lgth - 1] = 1; for (j = 1; j < lgth; j++) { power[lgth - j - 1] = 2*power[lgth - j]; } Everything works ok until it reaches the limit of 2^32: power: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024,
2007 Jun 14
1
besselK
Assistance, besselK- complex number problem Im a student intrested in using R in my learning and research work in option pricing however i have a problem with besselK function In R. Would you assit me in computing the besselK of third kind of a complex number in R. Any code or suggestion will be highly appriceiated eg besselK(2,10) works well.. but besselK(2,10i) doesnt work !! im
2005 Jul 12
5
R: to the power
hi all why does R do this: (-8)^(1/3)=NaN the answer should be : -2 a silly question but i kept on getting errors in some of my code due to this problem. i solve the problem as follows: say we want : (-a)^(1/3) then : sign(a)*(a^(1/3)) works but there has to be a simpler way of soing such a simple mathematical operation. thanking you / allan
2009 Apr 07
2
Maple and R
Hi R-users, Can Maple function be exported to R? I have a jacobian matrix (4X4)?from maple in algebraic form which involve modified Bessel function of the first kind. I just wonder whether we can use algebraic form into R before the value of the parameters can be estimated. Thank you so much for your attention and help.
2007 Aug 30
2
Incomplete Gamma function
Hello I am trying to evaluate an Incomplete gamma function in R. Library Zipfr gives the Igamma function. From Mathematica, I have: "Gamma[a, z] is the incomplete gamma function." In[16]: Gamma[9,11.1] Out[16]: 9000.5 Trying the same in R, I get > Igamma(9,11.1) [1] 31319.5 OR > Igamma(11.1,9) [1] 1300998 I know I have to understand the theory and the math behind it rather
2006 Jul 19
2
Stirling numbers
Hi anyone coded up Stirling numbers in R? [I need unsigned Stirling numbers of the first kind] cheers Robin -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2004 Nov 17
3
3d scatter plot with drop line
This is a follow up to my question from yesterday. I want to do in R what is called a "3d scatter plot with drop lines" in S-PLUS. Basically, it's a 3dscatterplot with lines connecting the x-y grid to the z points. The lines give a better perspective on the shape of the data surface. How to? Joel Bremson UC Davis Statistics
2001 Oct 22
1
round() doesn't (PR#1139)
R> round(100000/3, -2) - 33300 [1] -7.275958e-12 I would have hoped for 0. The problem seems to be specifically for negative "digits". This is in 1.3.1 on Solaris 2.6 (full description at bottom). [Apologies for making everyone read this 3 times; my bug.report() burped.] Peter Dalgaard <p.dalgaard@biostat.ku.dk> says the problem is in fround.c, which reads in part:
2005 Jan 27
1
computing roots of bessel function
I am not yet a R user but I will be soon. I am looking for the R command and syntax to compute the roots of Bessel function i.e. computing the z values that lead to Jnu(z)=0 where J is a Bessel function or order nu. May You help me ? thanks in advance. Dr Catherine COUTAND Institut National de la Recherche Agronomique (INRA) umr Physiologie Int?grative de l'Arbre Fruitier et Forestier