[R] RMySQL

2006-11-07 Thread Xiaodong Jin
options(CRAN='http://cran.r-project.org') install.packages(RMySQL, type=source) Warning: unable to access index for repository http://www.ibiblio.org/pub/languages/R/CRAN/src/contrib Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/src/contrib Warning

[R] nls

2006-11-07 Thread Xiaodong Jin
y [1] 1 11 42 64 108 173 214 t [1] 1 2 3 4 5 6 7 nls(1/y ~ c*exp(-a*b*t)+1/b, start=list(a=0.001,b=250,c=5), trace=TRUE) 29.93322 :0.001 250.000 5.000 Error in numericDeriv(form[[3]], names(ind), env) : Missing value or an infinity produced when evaluating the

[R] query in R

2006-11-07 Thread Xiaodong Jin
how to realize the following SQL command in R? select distinct A, B, count(C) from TABLE group by A, B ; quit; Best Regards - Sponsored Link Get a free Motorola Razr! Today Only! Choose Cingular, Sprint, Verizon, Alltel, or T-Mobile.

[R] Rprofile.site

2006-11-06 Thread Xiaodong Jin
How to make it correct? [1] Error in parse(file, n = -1, NULL, ?) : syntax error at 1: {\ #source('c:/Documents and Settings/xxx/My Documents/Archives/R/test.r') #source(c:\\Documents and Settings\\xxx\\My Documents\\Archives\\R\\test.r) [2] Error in file(file, r, encoding

[R] nls

2006-08-15 Thread Xiaodong Jin
Is there anyway to change any y[i] value (i=2,...6) to make following NLS workable? x - c(0,5,10,15,20,25,30) y - c(1.0,0.82000,0.68000,0.64000,0.7,0.68667,0.64000) lm(1/y ~~ x) nls(1/y ~~ a+b*x^c, start=list(a=1.16122,b=0.01565,c=1), trace=TRUE) #0.0920573 : 1.16122

[R] convert ms() to optim()

2006-07-07 Thread Xiaodong Jin
How to convert the following ms() in Splus to Optim in R? The Calc function is also attached. ms(~ Calc(a.init, B, v, off, d, P.a, lambda.a, P.y, lambda.y, 10^(-8), FALSE, 20, TRUE)$Bic, start = list(lambda.a = 0.5, lambda.y = 240), control = list(maxiter = 10, tol = 0.1))

[R] auto load package splines

2006-07-05 Thread Xiaodong Jin
May I ask how to include following procedures into R script (such as first.r) such that it will do an automatical call next time after I open R? Packages - Load Packages - splines Thanks, Shelton - [[alternative HTML

[R] garch function in R

2005-11-21 Thread Xiaodong Jin
I'm using R 2.1.1 and just successfully installed packages tseries, fseries. I try to run example http://www.maths.lth.se/help/R/.R/library/tseries/html/garch.html But it shows x.arch - garch(x, order = c(0,2)) # Fit ARCH(2) Error: couldn't find function garch Then I run

[R] arima prediction

2005-11-21 Thread Xiaodong Jin
x-c(-1.873,-0.121) # 23 numerics; x.arma12 - armaFit(x ~ arma(1,2)) #estimates y[t]= -0.11465 - 0.23767 y[t-1] - 0.14230 e[t-1] -0.85770 e[t-2] + e[t]; # ? how to predict 46 steps ahead based on 23 data points? # the following doesn't work since n is in armaSim rather than

[R] change maxiter for nls

2005-10-21 Thread Xiaodong Jin
I typed the following commands but it still use maxiter=50 after the 2nd command: nls.control(maxiter = 1000) nls(..) Thanks! - [[alternative HTML version deleted]] __

[R] curve fit

2005-10-20 Thread Xiaodong Jin
How to obtain the FUNCTION for the following smooth curve? x 0100 250 500 1000 4000 y 1.8 1.2 1.02 0.99 0.97 0.85 Thanks, SJ - [[alternative HTML version deleted]] __