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
... thank you for your reply though. saji - ------ 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-

[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
what the problem is. FUN is supposed to be a function 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') - ------ Saji Ren from

[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
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" to "numeric" by >class(mydata)="numeric" but after using "fitdistr", I got the result below >fitdistr(mydata,"normal") meansd NA NA (NA)

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
Hello,guys: I want to use a moving average estimation in my analysis. When refering to this "moving average", I mean a MA in a technical analysis definition, and not to the definition in Time Series Analysis. Actually, it is an AR estimation in TSA. So I use the function "filter" to compute it.

[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 meaning about that? thanks Saji from S

[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
Hello,guys: Recently, I am working on a seasonal ARIMA model. And I met some problem in the forecasting. Now I just want to know that How does R perform the predict procedure(the predict formula, the initial setting of errors,etc.)? I run the following commands and get the original code of the "p

[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/p

Re: [R] Problem about SARMA model forcasting

2009-02-11 Thread Saji Ren
Somebody said that ARIMA models like discussed above are easy to implement on a spreadsheet. The prediction formula is simply a linear equation that refers to past values of original time series and past values of the errors. Thus, setting up an spreadsheet by stroing the data in one column, the

Re: [R] Problem about SARMA model forcasting

2009-02-09 Thread Saji Ren
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 for your help! Now I realized where my mistake is. I forgot to include the seasonal differencing order. After I corrected th