Re: [R] How to perform a substitution in a loop?

2010-08-14 Thread Saji Ren
, or the result is missing value, thus it need a TRUE/FALSE is there any command to replace the "NaN" value with 1 in an efficient way? Saji - -- Saji Ren from Shanghai China GoldenHeart Investment Group ---

Re: [R] How to perform a substitution in a loop?

2010-08-14 Thread Saji Ren
that's not a problem of {}. By using {} you can put the command in one line. Still you can put the command in several lines as well by pur "enter". That's why in the second line, the ">" becomes "+".

[R] How to perform a substitution in a loop?

2010-08-14 Thread Saji Ren
the reason? - -- Saji Ren from Shanghai China GoldenHeart Investment Group -- -- View this message in context: http://r.789695.n4.nabble.com/How-to-perform-a-substitution-in-a-loop-tp2325048p2325048.html Sent from the R help m

Re: [R] Confusion in 'quantile' and getting rolling estimation of sample quantiles

2010-01-17 Thread Saji Ren
ction but a vector of numbers has been > supplied rather than a function. Try: > > uprange=rollapply(x,width=10,FUN=function(x)quantile(x,0.8),align='right') > > On Sat, Jan 16, 2010 at 10:08 PM, Saji Ren wrote: >> >> Guys: >> >> 1).When I using the

Re: [R] Confusion in 'quantile' and getting rolling estimation of sample quantiles

2010-01-17 Thread Saji Ren
Gabor, about problem 1. , now I understand. But in problem 2. , I do as your recommandation. and it still doesn't work. I wonder is there any detail introduction about the form of the 'FUN' in the 'rollapply'? Can you help me again? Thank you very much! Best regard Sa

[R] Confusion in 'quantile' and getting rolling estimation of sample quantiles

2010-01-16 Thread Saji Ren
bove in 1). And the R told me: "mistakes in match.fun(FUN) : 'quantile(x, 0.8)' is not a function, character or symbol" Can anyone help? Thank you in advanced. - --

Re: [R] Problem about Box-Cox transformation (topic in html form)

2010-01-11 Thread Saji Ren
Thank you, now I understand. If I plot the distribution of c888.dl.ma080+1200, then i will get a normally looked histogram. - -- Saji Ren from Shanghai China GoldenHeart Investment Group

[R] Problem about Box-Cox transformation (topic in html form)

2010-01-10 Thread Saji Ren
Thank you in advanced. - -- Saji Ren from Shanghai China GoldenHeart Investment Group -- -- View this message in context: http://n4.nabble.com/Problem-about-Box-Cox-transformation-topic-in-html

Re: [R] Help with function "fitdistr" in "MASS"

2010-01-04 Thread Saji Ren
Bernardo Rangel tura wrote: > > On Sat, 2010-01-02 at 23:20 -0800, Saji Ren wrote: >> Hi, R users: >> >> I want to fit my data into a normal distribution by using the command >> "fitdistr" in "MASS". >> I changed my data class from "ts&qu

Re: [R] Help with function "fitdistr" in "MASS"

2010-01-02 Thread Saji Ren
And when I used the command below: >fitdistr(mydata, "normal", na.rm=TRUE) the result is still the same. -- View this message in context: http://n4.nabble.com/Help-with-function-fitdistr-in-MASS-tp997609p997615.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Help with function "fitdistr" in "MASS"

2010-01-02 Thread Saji Ren
I check my data again, and find that: 1. when the class of "mydata" is ts, I can't compute the sd of it. R returns 'NA'. 2. when I change the class from ts into numeric, R still can't compute the sd of the data. Any suggestion? -- View this message in context: http://n4.nabble.com/Help-with-fu

[R] Help with function "fitdistr" in "MASS"

2010-01-02 Thread Saji Ren
ow >fitdistr(mydata,"normal") meansd NA NA (NA) (NA) the help doc of "fitdistr" does not mention anything about that, thus I need your help. Thank you in advanced, Saji from Shanghai -- View this message in context: http://n4.nabble.com/Help-with-funct

Re: [R] Help with Moving Average in R

2009-12-28 Thread Saji Ren
thanks, man. And what a stupid mistake!!! Plus, do you know any package in R that perform good rolling estimation? -- View this message in context: http://n4.nabble.com/Help-with-Moving-Average-in-R-tp989627p989764.html Sent from the R help mailing list archive at Nabble.com. _

[R] Help with Moving Average in R

2009-12-27 Thread Saji Ren
is: [1] NA NA 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 And I think the command I used to get MA2 should give a result as what I want, but it just does not. I want to know the reason, and I wondor if anyone could introduce a more convinient way to compute that. Thank yo

[R] What is ".Machine$double.eps"?

2009-12-23 Thread Saji Ren
Hello,everyone: I met this notation when I read the original code of function "quantile".There is one sentence as below: >eps <- 100 * .Machine$double.eps when I input ".Machine$double.eps" in R, it returns "[1] 2.220446e-16". Can anyone show me the exact me

[R] How to get the right ASH using "ash" package

2009-12-11 Thread Saji Ren
hi,everybody: I want to get the "average shifted histogram" or ASH for my own data. I choose to use the package "ash" to compute the ASH . But there is NA values in my data, and when using the command "bin1" for computing the bin counts, I was told that the command can't handle NA/NaN/Inf data.

[R] Need explaining to the ASH code in MASS

2009-12-10 Thread Saji Ren
Hi,everyone: In MASS chapter 5, the codes that yield a ASH for the "duration" data is read below: > breaks <- seq(0, 5.9, 0.1) > counts <- numeric(length(breaks)) > for(i in (0:4)) counts[i+(1:55)] <- counts[i+(1:55)] + rep(hist(duration, > breaks=0.1*i + seq(0, 5.5, 0.5), prob=TRUE, plot=FAL

Re: [R] How to compute Rolling analysis of Standard Deviation using ZOO package?

2009-11-27 Thread Saji Ren
> 3.027650 3.027650 3.027650 3.027650 3.027650 3.027650 > 91 92 93 94 95 96 > 3.027650 3.027650 3.027650 3.027650 3.027650 3.027650 > 97 98 99 100 > 3.027650 3.027650 3.027650 3.027650 > > R.version.string > [1] "

[R] How to compute Rolling analysis of Standard Deviation using ZOO package?

2009-11-26 Thread Saji Ren
Hello: I want to get a rolling estimation of the stdev of my data. Searching the document, I found the function "rollapply" in the zoo package. For example, my series is "c", and i want get a period of 10 days, so i write the command below: roll.sd = rollapply( c, 10, sd, na.pad = TRUE, align =

[R] What's the predict procedure of ARIMA in R?

2009-02-16 Thread Saji Ren
"predict" command, but I can't read it. Can anybody explain it to me? Thanks! saji from Shanghai the code: > getS3method("predict","Arima") function (object, n.ahead = 1, newxreg = NULL, se.fit = TRUE, ...) { myNCOL <- function(x) if (is.nul

[R] How to simulate a seasonal ARIMA model in R?

2009-02-16 Thread Saji Ren
Guys: Is it possible to simulate a seasonal ARIMA model in R? Which package can do this job? saji from Shanghai __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] Problem about SARMA model forcasting

2009-02-11 Thread Saji Ren
x27;t find it by myself. Really need helps! Thanks again! saji from Shanghai __ R-help@r-project.org 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

Re: [R] Problem about SARMA model forcasting

2009-02-11 Thread saji
find it by myself. Really need helps! Thanks again! saji from Shanghai On 2月11日, 下午7时54分, saji wrote: > Somebody suggest that all the intial values are zero. > So I followed this suggestion and used below formulas to compute the > forcast in Excel > > when t < 46, > a(t)=

Re: [R] Problem about SARMA model forcasting

2009-02-11 Thread saji
And I just don't where the mistake is. saji from Shanghai On 2月9日, 下午7时54分, Saji Ren wrote: > First of all, sorry to *Gerard. > *I have changed my email account, and I don't know how to reply to my posted > thread before. So I just create a new message here. > Thanks again f

Re: [R] Problem about SARMA model forcasting

2009-02-09 Thread Saji Ren
(like EXCEL). Hope some one to help! Thanks! saji from Shanghai [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.