[R] Harmonic Regression in R
Dear all: Does anyone has harmonic regresssion analysis package written in R (to be used in Windows platform) ? Thanks ___ YM - Â÷½u°T®§ ´Nºâ§A¨S¦³¤Wºô¡A§AªºªB¤Í¤´¥i¥H¯d¤U°T®§µ¹§A¡A·í§A¤Wºô®É´N¯à¥ß§Y¬Ý¨ì¡A¥ô¦ó»¡¸Ü³£ÉN¨«¥¢¡C http://messenger.yahoo.com.hk [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Need help in waveslim package: imodwt and universal.thresh.modwt
Hi: I have encountered problems with imodwt and universal.thresh.modwt and cannot find any reference in R Search. Hope someone can give me some ideas: Starting with modwt.la8 <- modwt(xdata, "la8", n.level=6) <-- this seems to work fine (1) ydata <- imodwt(modwt.la8) will always give ydata as numeric(0) (no values) instead of being a time series data with the same lenght as xdata. (2) thred.la8 <- universal.thresh.modwt(modwt.la8, max.level=4, hard=F) will give me error at: abs(wc.fine) - cannot contain non-numeric field. Any help is much appreciated. Regards ___ YM - Â÷½u°T®§ ´Nºâ§A¨S¦³¤Wºô¡A§AªºªB¤Í¤´¥i¥H¯d¤U°T®§µ¹§A¡A·í§A¤Wºô®É´N¯à¥ß§Y¬Ý¨ì¡A¥ô¦ó»¡¸Ü³£ÉN¨«¥¢¡C [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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 commented, minimal, self-contained, reproducible code.
[R] 回覆: Re: Need help in waveslim package: imodwt and universal.thresh.modwt
Hi Rogerio: I am using Waveslim 1.5 on R 2.3.0, running on Chinese WinXP (SP2). The data, attached in the CSV file, is a stock data (0001 from Hong Kong) downloaded from Yahoo!Finance. The time series data are the Adj. Close prices (last column) from 4-Jan-00 to 30-Nov-2005. The waveslim mra rountines are working fine on these data. Thks rdporto1 <[EMAIL PROTECTED]> 說: The first two commands worked fine to me. I used xdata = rnorm(128). To let us help you more, specify your R version, some data, OS etc, as usually asked. Rogerio Porto. -- Cabe蓷lho original --- De: [EMAIL PROTECTED] Para: r-help@stat.math.ethz.ch C鏕ia: Data: Sun, 12 Nov 2006 16:02:45 +0800 (CST) Assunto: [R] Need help in waveslim package: imodwt and universal.thresh.modwt > Hi: > I have encountered problems with imodwt and universal.thresh.modwt and cannot > find any reference in R Search. Hope someone can give me some ideas: > > Starting with > modwt.la8 <- modwt(xdata, "la8", n.level=6) <-- this seems to work fine > > (1) ydata <- imodwt(modwt.la8) > will always give ydata as numeric(0) (no values) instead of being a time > series data with the same lenght as xdata. > > (2) thred.la8 <- universal.thresh.modwt(modwt.la8, max.level=4, hard=F) will > give me error at: > abs(wc.fine) - cannot contain non-numeric field. > > Any help is much appreciated. > > Regards > > Content-Type: text/html; charset=big5 Content-Transfer-Encoding: 8bit Hi Rogerio: I am using Waveslim 1.5 on R 2.3.0, running on Chinese WinXP (SP2). The data, attached in the CSV file, is a stock data (0001 from Hong Kong) downloaded from Yahoo!Finance. The time series data are the Adj. Close prices (last column) from 4-Jan-00 to 30-Nov-2005. The waveslim mra rountines are working fine on these data. Thksrdporto1 <[EMAIL PROTECTED]> 說: The first two commands worked fine to me. I usedxdata = rnorm(128).To let us help you more, specify your R version,some data, OS etc, as usually asked.Rogerio Porto.-- Cabe蓷lho original ---De: [EMAIL PROTECTED]Para: r-help@stat.math.ethz.chC鏕ia:Data: Sun, 12 Nov 2006 16:02:45 +0800 (CST)Assunto: [R] Need help in waveslim package: imodwt and universal.thresh.modwt> Hi:> I have encountered problems with imodwt and universal.thresh.modwt and cannot find any reference in R Search. Hope someone can give me some ideas:>> Starting with> modwt.la8 <- modwt(xdata, "la8", n.level=6) <-- this seems to work fine>> (1) ydata <- imodwt(modwt.la8)> will always give ydata as numeric(0) (no values) instead of being a time series data with the same lenght as xdata.>> (2) thred.la8 <- universal.thresh.modwt(modwt.la8, max.level=4, hard=F) will give me error at:> abs(wc.fine) - cannot contain non-numeric field.>> Any help is much appreciated.>> Regards>> ___ YM - 離線訊息 Content-Type: application/octet-stream; name="CKH-0001-ALL-data-only.csv" Content-Transfer-Encoding: base64 Content-Description: 3176266068-CKH-0001-ALL-data-only.csv Content-Disposition: attachment; filename="CKH-0001-ALL-data-only.csv" MDg2MTEsNzkuNjUNCg== __ R-help@stat.math.ethz.ch 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 commented, minimal, self-contained, reproducible code.
[R] 回覆: Re:??: Re: Need help in wavesl im package: imodwt and universal.thresh.modwt
Hi Rogerio: Here is what I tried. I have used only data points 1 to 1447 but the same problems appear if I used all the data in the file I sent . >library(waveslim) >infile <-"C:\\airon.csv" >ckhdat <- read.csv(infile,header=TRUE, quote="") ... 1464 23-Dec-05,80.8,81,80.7,80.95,1538304,80.95 146528-Dec-05,80.85,81,80.3,80.7,3728116,80.7 1466 29-Dec-05,80.8,80.95,80.3,80.4,3145493,80.4 146730-Dec-05,80.4,80.2,78.85,79.65,7508611,79.65 >xdata <- ckhdata$adjcls[1:1447] > ckhdwt.la8 <- modwt(xdata, "la8", n.levels = 6) > names(ckhdwt.la8) <- c("w1", "w2", "w3", "w4", "w5","w6", "v6") > > ydata <- imodwt(ckhdwt.la8) > ydata numeric(0) > thre_wc_univ <- universal.thresh.modwt(ckhdwt.la8, max.level = 4, hard = > FALSE) ¿ù»~¦babs(wc.fine) : ¨ç¼Æ¤£¯à¦³«D¼ÆÈ¤Þ¼Æ > Note that the error message for universal.thresh.modwt is in Chinese. It roughly means "Error at abs(wc.find) : variable cannot have non-numeric value" I need to find an WinXP (English) machine to see if the same issue appers. Thks rdporto1 <[EMAIL PROTECTED]> »¡¡G Airon, I used R2.4.0 on a Windows XP (SP2) (not Chinese :-)) and it still works: > data = read.csv("u:/airon.csv") > xdata = data$Adj..Close > modwt.la8 = modwt(xdata, "la8", n.level=6) > summary(modwt.la8) Length Class Mode d1 1467 -none- numeric d2 1467 -none- numeric d3 1467 -none- numeric d4 1467 -none- numeric d5 1467 -none- numeric d6 1467 -none- numeric s6 1467 -none- numeric > ydata = imodwt(modwt.la8) > summary(ydata) Min. 1st Qu. Median Mean 3rd Qu. Max. 37.35 57.56 67.93 67.31 78.32 104.90 > max(ydata-xdata) [1] 2.957279e-11 Can you provide a simple program and the resulting messages showing that it doesn't work? Rogerio. -- Cabeçalho original --- De: "Airon Yiu" [EMAIL PROTECTED] Para: "rdporto1" [EMAIL PROTECTED] Cópia: "r-help" r-help@stat.math.ethz.ch Data: Tue, 14 Nov 2006 13:56:51 +0800 (CST) Assunto: ??: Re:[R] Need help in waveslim package: imodwt and universal.thresh.modwt > Hi Rogerio: > > I am using Waveslim 1.5 on R 2.3.0, running on Chinese WinXP (SP2). > > The data, attached in the CSV file, is a stock data (0001 from Hong Kong) > downloaded from Yahoo!Finance. The time series data are the Adj. Close prices > (last column) from 4-Jan-00 to 30-Nov-2005. > > The waveslim mra rountines are working fine on these data. > > Thks ___ YM - Â÷½u°T®§ ´Nºâ§A¨S¦³¤Wºô¡A§AªºªB¤Í¤´¥i¥H¯d¤U°T®§µ¹§A¡A·í§A¤Wºô®É´N¯à¥ß§Y¬Ý¨ì¡A¥ô¦ó»¡¸Ü³£ÉN¨«¥¢¡C [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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 commented, minimal, self-contained, reproducible code.
[R] 回覆: Re:??: Re:??: Re: Need help in waveslim package: imodwt and universal.thresh.m odwt
Hi Rogerio: Thks a lot. It works. By the way, I have 2 related sides issues that need some help: (1) What I want to do is this - do modwt on original time series - do thresholding on wavelet coefficients - obtain the inversed smoothed and detailed components of the original time series using the thesholded coefficients. How can this be done ? mra accept the original time series as input. imodwt rountine will give me the inversed transformed in the form of original time series, instead of separating them into detailed and smoothed component. (2) Is there a way to make R giving me error messages in English instead of Chinese so that I can communicate with others easily Thks rdporto1 <[EMAIL PROTECTED]> »¡¡G Airon, I don't think you have to find an English computer 'cause the following must work in your Chinese one :-) Let me explain. First of all, change your lines to xdata <- ckhdat$Adj..Close[1:1447] #names(ckhdwt.la8) <- c("w1", "w2", "w3", "w4", "w5","w6", "v6") note the # sign, i.e., DO NOT change the names before the function imodwt. This is because the function imodwt looks for the names created by the modwt function. If you need to change names, do it AFTER the reconstruction. I hope that it helps you. Rogerio -- Cabeçalho original --- De: "Airon Yiu" [EMAIL PROTECTED] Para: "rdporto1" [EMAIL PROTECTED] Cópia: "r-help" r-help@stat.math.ethz.ch Data: Wed, 15 Nov 2006 23:49:57 +0800 (CST) Assunto: ??: Re:??: Re:[R] Need help in waveslim package: imodwt and universal.thresh.modwt > Hi Rogerio: > > Here is what I tried. I have used only data points 1 to 1447 but the same > problems appear if I used all the data in the file I sent . > > >library(waveslim) > >infile <-"C:\\airon.csv" > >ckhdat <- read.csv(infile,header=TRUE, quote="") > ... > 1464 23-Dec-05,80.8,81,80.7,80.95,1538304,80.95 > 1465 28-Dec-05,80.85,81,80.3,80.7,3728116,80.7 > 1466 29-Dec-05,80.8,80.95,80.3,80.4,3145493,80.4 > 1467 30-Dec-05,80.4,80.2,78.85,79.65,7508611,79.65 > >xdata <- ckhdata$adjcls[1:1447] > > ckhdwt.la8 <- modwt(xdata, "la8", n.levels = 6) > > names(ckhdwt.la8) <- c("w1", "w2", "w3", "w4", "w5","w6", "v6") > > > > ydata <- imodwt(ckhdwt.la8) > > ydata > numeric(0) > > thre_wc_univ <- universal.thresh.modwt(ckhdwt.la8, max.level = 4, hard = > > FALSE) > ???abs(wc.fine) : ?? > > > > Note that the error message for universal.thresh.modwt is in Chinese. It > roughly means "Error at abs(wc.find) : variable cannot have non-numeric value" > > I need to find an WinXP (English) machine to see if the same issue appers. > > Thks ___ YM - Â÷½u°T®§ ´Nºâ§A¨S¦³¤Wºô¡A§AªºªB¤Í¤´¥i¥H¯d¤U°T®§µ¹§A¡A·í§A¤Wºô®É´N¯à¥ß§Y¬Ý¨ì¡A¥ô¦ó»¡¸Ü³£ÉN¨«¥¢¡C [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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 commented, minimal, self-contained, reproducible code.