[R] Rmetrics - R-Forge - Workshop

2008-03-18 Thread chalabi
taken by Yohan Chalabi. If you have any questions, please do not hesitate to get in contact with him. Furthermore, Rmetrics will move this week to his new own home, the old link via "www.itp.phys.ethz.ch" will no longer be active due to the reorganisat

Re: [R] Downloading Yahoo data

2008-08-07 Thread Yohan Chalabi
"SVK" == "Shubha Vishwanath Karanth" <[EMAIL PROTECTED]> on Thu, 7 Aug 2008 20:38:12 +0530 SVK> Yes Henrique... we are connecting to the internet through a proxy... This is probably not a problem of connection. Make sure that you have the latest version of fImport installed. hop

Re: [R] fPortfolio constraints, maxsumW

2008-08-13 Thread Yohan Chalabi
"JPB" == "John P. Burkett" <[EMAIL PROTECTED]> on Tue, 12 Aug 2008 10:46:28 -0400 JPB> Running R version 2.6.1 under Gentoo Linux and using the fPortfolio JPB> package, I am having trouble specifying a sector constraint. One of the JPB> constraints to be imposed is that assets

Re: [R] ARMA(0,2) & GARCH(1,1) - code & hessian

2008-08-19 Thread Yohan Chalabi
Hi, As far as I can tell, your code looks very similar to the example of the paper "Parameter Estimation of ARMA Models with GARCH/APARCH Errors" available at the rmetrics website. In this paper you can also find an example how to calculate the hessian matrix. What is the dataset and the paramete

Re: [R] another GARCH problem

2008-08-19 Thread Yohan Chalabi
"C" == collonil <[EMAIL PROTECTED]> on Mon, 18 Aug 2008 07:35:09 -0700 (PDT) C> Hallo, C> i want to fit a GARCH model with a extern regressor (without arma C> components), so i found the following function in package fGarch. I tryed C> out a lot of things but usually I get th

Re: [R] estimators based on Truncated likelihood

2010-02-10 Thread Yohan Chalabi
"HYC" == helen...@utoronto.ca on Tue, 09 Feb 2010 22:07:27 -0500 HYC> Dear Sir/Madam, HYC> HYC> May I know if there is any function that estimates the ARCH HYC> or GARCH HYC> models based on truncated likelihood? HYC> HYC> Thanks, HYC> Helen Hi Helen, TLE has b

Re: [R] arma model with garch errors

2009-05-03 Thread Yohan Chalabi
"JM" == Joseph Magagnoli on Wed, 29 Apr 2009 14:54:26 -0500 JM> > garchFit(formula.mean= ~arma(2,2),formula.var=~garch(1,1), JM> data=data1) JM> Error in garchFit(formula.mean = ~arma(2, 2), formula.var = JM> ~garch(1, : JM> element 1 is empty; JM> the part of the args

Re: [R] fGarch: how to use garchFit() in loop?

2010-08-16 Thread Yohan Chalabi
On Aug 15, 2010, at 11:14 PM, Marius Hofert wrote: > Dear David, > > thanks for the quick response. Yes, I tried "formula", but this gives the > error "Multivariate data inputs require lhs for the formula." > > library(fGarch) > spec <- garchSpec(model = list(alpha = 0.1, beta = c(0.4, 0.4)))

Re: [R] Estimation of an GARCH model with conditional skewness and kurtosis

2011-02-15 Thread Yohan Chalabi
"JL" == Johannes Lips on Tue, 15 Feb 2011 16:07:50 +0100 JL> Hello, JL> JL> I'm quite new to R but tried to learn as much as possible in JL> the last JL> few months. JL> My problem is that I would like to estimate the model of Leon JL> et al. (2005). JL> I have s

Re: [R] portfolioBacktest in fPortfolio

2011-03-27 Thread Yohan Chalabi
"LFP" == Luis Felipe Parra on Mon, 28 Mar 2011 09:10:33 +0800 LFP> Hello. I am trying to use the portfolio backtesting function LFP> in fPortfolio LFP> package, but I don't now why in my version of fPortfolio I LFP> don't have either LFP> the portfolioBactest nor the port

Re: [R] Help : R-packages : Problems loading package fSeries

2008-06-02 Thread Yohan Chalabi
"CLG" == Celine LE-GOAZIGO <[EMAIL PROTECTED]> on Mon, 2 Jun 2008 13:19:35 +0200 CLG> Hi. CLG> CLG> I am trying to load the package fSeries, in order to load CLG> the package CLG> fGarch after. CLG> However, it says the following message. Dear Celine, Please make su

Re: [R] The log function problem

2008-06-11 Thread Yohan Chalabi
"SVK" == "Shubha Vishwanath Karanth" <[EMAIL PROTECTED]> on Thu, 12 Jun 2008 12:02:25 +0530 SVK> Hi R, SVK> SVK> SVK> SVK> Please see the below commands. The question is I can see the value of SVK> log(2) before loading the package fcalendar in R. But after loading

Re: [R] fCopulae

2008-05-06 Thread Yohan Chalabi
"CA" == "chockri adnen" <[EMAIL PROTECTED]> on Wed, 30 Apr 2008 13:34:42 +0200 CA> My problem in a few words is as folow: CA> I used the fCopulae packages because i have 2 series which CA> are already CA> transformed in the uniform domain (the space of the copulas CA> fun

Re: [R] parameters for a function in list format

2008-05-16 Thread Yohan Chalabi
"PDJW" == "Prof. Dr. Joachim Werner" <[EMAIL PROTECTED]> on Fri, 16 May 2008 12:55:32 +0200 PDJW> Hi, PDJW> can anybody help me concerning ther following problem: PDJW> We do simulations with fARMA and use the function armaSim, PDJW> which PDJW> requires the input paramet

Re: [R] Problem with alignDailySwries in R-metrics

2008-12-18 Thread Yohan Chalabi
"JK" == "John Kerpel" on Tue, 16 Dec 2008 13:26:27 -0600 JK> DTB6<-alignDailySeries(DTB6, method = "interp",include.weekends = FALSE, JK> units = NULL) JK> Error in getDataPart() : JK> no '.Data' slot defined for class "timeSeries" JK> JK> JK> What's causing thi

Re: [R] A mistake in garchFit()? {fGarch}

2009-01-03 Thread Yohan Chalabi
"TY" == Ted Young on Tue, 30 Dec 2008 11:53:23 -0800 (PST) TY> TY> Hello, TY> TY> I was using garchFit {fGarch} to fit some GARCH processes. TY> I noticed that the result contains Log Likelihood value TY> (right above TY> Description), but when I use @fit to ret

Re: [R] Can I create a timeDate object using only year and week of the year values?

2009-01-28 Thread Yohan Chalabi
"TB" == Ted Byers on Tue, 27 Jan 2009 11:36:22 -0500 TB> What I have found so far includes: TB> TB> library(Rmetrics) TB> time1 = timeDate(charvec = Sys.Date(), format = %Y-%m-%d, TB> zone = , TB> FinCenter = ) TB> time2 = timeDate(2004-08-30, format = %Y-%m-%d, zon

Re: [R] Mystery Error in midnightStandard

2009-01-28 Thread Yohan Chalabi
"TB" == Ted Byers on Tue, 27 Jan 2009 16:00:27 -0500 TB> I wasn't even aware I was using midnightStandard. You won't TB> find it in my TB> script. TB> TB> Here is the relevant loop: TB> TB> date1 = timeDate(charvec = Sys.Date(), format = %Y-%m-%d) TB> date1 T

Re: [R] Mystery Error in midnightStandard

2009-01-28 Thread Yohan Chalabi
"TB" == Ted Byers on Wed, 28 Jan 2009 09:30:58 -0500 TB> It is certain that all entries have the same format, but I'm TB> starting to TB> think that the error message is something of a red herring. TB> Consider this: TB> TB> > year = 2009 TB> > week = 0 TB> > day

Re: [R] Mystery Error in midnightStandard

2009-01-28 Thread Yohan Chalabi
"TB" == Ted Byers on Wed, 28 Jan 2009 11:25:55 -0500 TB> That the two behave the same doesn't change the assessment TB> that the design TB> is flawed. That doesn't mean that the function is wrong. TB> It means only TB> that the behaviour can be made more useful. For exa

Re: [R] Problem using RMySQL and fCalendar

2009-03-05 Thread Yohan Chalabi
"EN" == Elizabeth Nichols on Thu, 05 Mar 2009 05:45:40 -0500 EN> Hello: EN> I am trying to use fCalendar for date arithmetic and the EN> RMySQL package EN> for accessing a MySQL database. The fCalendar math operations EN> seem to EN> work fine UNTIL I load the RMySQL

Re: [R] Avoiding loops & apply -function

2008-11-05 Thread Yohan Chalabi
"DM" == David Masson <[EMAIL PROTECTED]> on Wed, 05 Nov 2008 15:13:37 +0100 DM> I have a question concerning avoiding loops. DM> I know the function "apply" and I have used it several times, but I feel DM> blocked DM> with this situation : DM> DM> E <- array(X, dim =

Re: [R] fGarch and is.na()

2008-12-02 Thread Yohan Chalabi
Thanks for the report, the problem boils down to the call of "methods:::bind_activation(TRUE)" in one of the depended package. I can reproduce the problem with > methods:::bind_activation(TRUE) > dfr <- data.frame(matrix(0, nrow = 1 , ncol = 1000)) > dfr2 <- is.na(dfr) I will forward you remar

[R] Test set and Train set in Caret package train function

2017-10-22 Thread Elahe chalabi via R-help
Hey all, Does anyone know how we can get train set and test set for each fold of 5 fold cross validation in Caret package? Imagine if I want to do cross validation by random forest method, I do the following in Caret: set.seed(12) train_control <- trainControl(method="cv", number=5,savePredicti

[R] Counting nuber of sentences by qdap package

2017-10-29 Thread Elahe chalabi via R-help
Hi all, I have a data frame with a variable Description containing text of speeches and I would like to count number of sentences in each speech, > str(data) 'data.frame': 255 obs. of 3 variables: $ Group : Factor w/ 255 levels "AlzheimerGroup1","AlzheimerGroup10",..: 1 112 179 190

[R] Correct subsetting in R

2017-11-01 Thread Elahe chalabi via R-help
Hi all, I have two data frames that one of them does not have the column ID: > str(data) 'data.frame': 499 obs. of 608 variables: $ ID : int 1 2 3 4 5 6 7 8 9 10 ... $ alright : int 1 0 0 0 0 0 0 1 2 1 ... $ bad : int 1 0 0 0 0 0 0 0 0 0 ...

Re: [R] Correct subsetting in R

2017-11-01 Thread Elahe chalabi via R-help
But they row.names() cannot give me the IDs On Wednesday, November 1, 2017 9:45 AM, David Wolfskill wrote: On Wed, Nov 01, 2017 at 04:13:42PM +, Elahe chalabi via R-help wrote: > Hi all, > I have two data frames that one of them does not have the column ID: > >

Re: [R] Correct subsetting in R

2017-11-01 Thread Elahe chalabi via R-help
;- merge(training,data,by=intersect(names(training),names(data))) HTH, Eric On Wed, Nov 1, 2017 at 6:13 PM, Elahe chalabi via R-help wrote: Hi all, >I have two data frames that one of them does not have the column ID: > >> str(data) >'data.frame': 499

[R] fill histogram in ggplot

2017-11-07 Thread Elahe chalabi via R-help
Hi all, I have the following data and I have a histogram for mms like ggplot(hist,aes(x=hist$mms))+ geom_histogram(binwidth=1,fill="white",color="black")and then I want to fill the color of histogram by probable=1 and probable=0, could anyone help me in this? My data: structure(list(pr

[R] overlay two histograms ggplot

2017-12-13 Thread Elahe chalabi via R-help
Hi all, How can I overlay these two histograms? ggplot(gg, aes(gg$Alz, fill = gg$veg)) + geom_histogram(alpha = 0.2) ggplot(tt, aes(tt$Cont, fill = tt$veg)) + geom_histogram(alpha = 0.2) thanks for any help! Elahe __ R-help@r-project.org mailing list

[R] Random Forest tree labels

2018-01-04 Thread Elahe chalabi via R-help
Hi all, I have built a Random Forest using Caret package, however, I don't understand how the splits are labeled in trees. My dataset contains the frequency of the words in the speeches of the people: 'data.frame': 499 obs. of 608 variables: $ alright : num 1 0 0 0 0 0 0 1 2 1 ... $ bad : n

[R] Document Term Matrix

2018-01-05 Thread Elahe chalabi via R-help
Hi, Does anyone know what is maximal term length in Document Term Matrix? <> Non-/sparse entries: 8081/210709 Sparsity : 96% Maximal term length: 12 Weighting : term frequency (tf) Thanks for any help! Elahe __ R-help@r-project.org

[R] create a correct list from Document Term Matrix

2017-05-06 Thread Elahe chalabi via R-help
Hi all, I have a text classification task which is classification of a Control group and Alzheimer group texts. I have generated DocumentTermMatrix for both groups and then created a list with one extra element showing the group name if it's Alzheimer or control group, for example for the Alzhe

[R] visualization of KNN results in text classification

2017-05-07 Thread Elahe chalabi via R-help
Hi all, Does anyone know what is the best way to visualize KNN(K nearest neighbor) results for classification of texts in R? My data set has only speeches and the type of the people for them which is control group or Alzheimer group, KNN classifies these two groups for me but I don't know how

Re: [R] visualization of KNN results in text classification

2017-05-08 Thread Elahe chalabi via R-help
Any idea?! On Sunday, May 7, 2017 5:56 PM, Elahe chalabi via R-help wrote: Hi all, Does anyone know what is the best way to visualize KNN(K nearest neighbor) results for classification of texts in R? My data set has only speeches and the type of the people for them which is

Re: [R] visualization of KNN results in text classification

2017-05-12 Thread Elahe chalabi via R-help
Thanks for your reply. What I exactly have is a data frame with rows containing words which have been used in each speech and columns containing frequency of these words, I have an extra row showing the type of the speech whether it was from a control group or Alzheimer group. Then I create a

[R] installing caret package

2017-05-12 Thread Elahe chalabi via R-help
Hi all, I'm using Rstudio 64 bit version3.2.5 and I faced a problem installing caret package,the error is : Loading required package: lattice Loading required package: ggplot2 Error : object ‘sigma’ is not exported by 'namespace:stats' Error: package or namespace load failed for ‘caret’ how sho

[R] train function in caret package

2017-05-19 Thread Elahe chalabi via R-help
Hi all, I'm running train function from caret package on my data set patientdata: model=train(type~., data=patientdata, method="lvq", preProcess="scale", trControl=control) and I get this error: Error in comp(expr, env = envir, options = list(suppressUndefined = TRUE)) : could n

Re: [R] train function in caret package

2017-05-19 Thread Elahe chalabi via R-help
Any answer?! On Friday, May 19, 2017 6:33 AM, Elahe chalabi via R-help wrote: Hi all, I'm running train function from caret package on my data set patientdata:     model=train(type~., data=patientdata, method="lvq", preProcess="scale", trControl=cont

[R] MDS plot in Random Forest

2017-05-25 Thread Elahe chalabi via R-help
Hi all, I have applied Random Forest on my data and divided data into test and rain set to see the prediction results and it seems good cause the accuracy is 82%. Now my question is how can I plot MDS on predicted data? here is my code: spl=sample.split(df$PatientType,SplitRatio = 0.7)

Re: [R] MDS plot in Random Forest

2017-05-26 Thread Elahe chalabi via R-help
Thanks for your reply Bert. But the question on how to plot MDS on predicted data I guess belong to here! On Thursday, May 25, 2017 9:43 AM, Bert Gunter wrote: Elahe: On Thu, May 25, 2017 at 8:15 AM, Elahe chalabi via R-help wrote: > Hi all, > I have applied Random Forest on m

[R] count number of stop words in R

2017-06-12 Thread Elahe chalabi via R-help
Hi all, Is there a way in R to count the number of stop words (English) of a string using tm package? str="Mhm . Alright . There's um a young boy that's getting a cookie jar . And it he's uh in bad shape because uh the thing is falling over . And in the picture the mother is washing dishes and

Re: [R] count number of stop words in R

2017-06-12 Thread Elahe chalabi via R-help
lish")) Patrick Casimir, PhD Health Analytics, Data Science, Big Data Expert & Independent Consultant C: 954.614.1178 From: R-help on behalf of Bert Gunter Sent: Monday, June 12, 2017 10:12:33 AM To: Elahe chalabi Cc: R-help Mailing List Subject:

Re: [R] count number of stop words in R

2017-06-12 Thread Elahe chalabi via R-help
AM, Patrick Casimir wrote: You can define stop words as below. data <- tm_map(data, removeWords, stopwords("english")) Patrick Casimir, PhD Health Analytics, Data Science, Big Data Expert & Independent Consultant C: 954.614.1178 From: R-help

[R] fill out a PDF form in R

2017-07-26 Thread Elahe chalabi via R-help
Hi all, I would like to get ideas about how to fill out a PDF form in R and to know if it's possible or not. I could not find something helpful in Internet. Does anyone know a good link for that or have experience in this? Thanks for any help! Elahe

[R] cross validation in random forest rfcv functin

2017-08-23 Thread Elahe chalabi via R-help
Hi all, I would like to do cross validation in random forest using rfcv function. As the documentation for this package says: rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...) however I don't know how to build trianx and train

[R] cross validation in random forest using rfcv functin

2017-08-23 Thread Elahe chalabi via R-help
Hi all, I would like to do cross validation in random forest using rfcv function. As the documentation for this package says: rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...) however I don't know how to build trianx and tr

[R] cross validation in random forest using rfcv functin

2017-08-23 Thread Elahe chalabi via R-help
Any responds?! On Wednesday, August 23, 2017 5:50 AM, Elahe chalabi via R-help wrote: Hi all, I would like to do cross validation in random forest using rfcv function. As the documentation for this package says: rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=

[R] ROC curve for each fold in one plot

2017-10-16 Thread Elahe chalabi via R-help
Hi all, I have tried a 5 fold cross validation using caret package with random forest method on iris dataset as example. Then I need ROC curve for each fold: > set.seed(1) > train_control <- trainControl(method="cv", number=5,savePredictions = TRUE,classProbs = TRUE) > output <- train(S

[R] findAssocs Heatmap in R

2018-10-25 Thread Elahe chalabi via R-help
Hi all, I have a document term matrix and I would like to have a heatmap (geom_tile) for 20 most associated words to a specific word in it. Here is my dtm:  corpus=Corpus(VectorSource(data$Message))  corpus=tm_map(corpus,tolower) corpus=tm_map(corpus,removePunctuation) corpus=tm_map(corpus,rem

[R] POS counting number of verbs

2018-11-05 Thread Elahe chalabi via R-help
Hi all, I have 16630 Messages in my data frame and I would like to count number of verbs in each message, to do so I have the following code: > str(tar) 'data.frame': 16630 obs. of  2 variables: $ Message            : Factor w/ 13412 levels "","'alter database  datafile' needs to be executed",..

[R] POS tagging generating a string

2018-11-06 Thread Elahe chalabi via R-help
Hi all, In my df I would like to generate a new column which contains a string showing all the verbs in each row of df$Message. > library(openNLP) > library(NLP) > dput(df) structure(list(DocumentID = c(478920L, 510133L, 499497L, 930234L ), Message = structure(c(4L, 2L, 3L, 1L), .Label = c

[R] create a heatmap for findAssocs results based on time

2018-11-15 Thread Elahe chalabi via R-help
Hi all, I have the following data for which I create a document term matrix first and then I add the time available to the dtm. In order to see the correlations to the term "updat" in the different years, I would like to have a heat-map for findassoc in a way that x-axis shows the time.

[R] subset English language using textcat package

2018-11-19 Thread Elahe chalabi via R-help
Hi all, How is it possible to subset English text from a df containing German and English texts using textcat package? > library(textcat) > dput(data) structure(list(x = structure(c(2L, 6L, 5L, 3L, 1L, 4L), .Label = c("Dieses Buch ist erstaunlich", "I love this book", "ich

[R] Prediction model in Shiny App

2019-01-21 Thread Elahe chalabi via R-help
Hi everyone, I'm new in trying Shiny app in R and for the following question I need your help. I have a Random Forest model built with Caret Package on iris data set and then with Shiny I need a UI which I can upload a .csv file as the test set and give it to the trained model and then see what

[R] create a network for a small text df

2019-01-30 Thread Elahe chalabi via R-help
Hi all, I have a small dataframe and I would like to show in a network plot how words are related to the word "problem" with arrows (keeping the order of the words in sentences). Here's the df: dput(df) structure(list(text = structure(c(1L, 7L, 3L, 4L, 5L, 6L, 2L), .Label = c(

Re: [R] create a network for a small text df

2019-02-01 Thread Elahe chalabi via R-help
######## #From: R-help On Behalf Of Elahe chalabi via R-help Sent: Wednesday, January 30, 2019 5:16 AM # I ran this net1 <- structure(list(text = structure(c(1L, 7L, 3L, 4L, 5L, 6L, 2L), .Label = c("account block solv problem", "exactly proble

[R] R package

2017-03-23 Thread Elahe chalabi via R-help
Hi all, I have a data frame containing serial numbers for US. I also have a column showing the city in US, now my question is is there a package in R able to get the city in US as input and then return the name of State for that city?! Thanks for any help! Elahe ___

[R] correct subset in R

2017-03-23 Thread Elahe chalabi via R-help
Hi all, I found an answer to the last question I asked in this group and now I want to have a correct subset of my data: I have a following df1 which is list of all cities in US and their states: $ name : Factor w/ 1008 levels "Ackley","Ackworth",..: 1 2 3 $ state: Factor w/ 1 l

[R] Add a new row based on test set predicted values and time stamps

2021-04-13 Thread Elahe chalabi via R-help
Hi all, I have the prediction for my test set which are forecasted Value for "4/1/2020" for each match of "id" and "Group". I would like to add a fourth row to each group by (Group,id) in my train set and the values for this row should come from test set : my train set:       structure(list(D

[R] Group by and duplicate a value/dplyr

2021-05-11 Thread Elahe chalabi via R-help
Hi all, I have the following data frame  dput(df)     structure(list(Department = c("A", "A", "A", "A", "A", "A", "A",  "A", "B", "B", "B", "B", "B", "B", "B", "B"), Class = c(1L, 1L,  1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L), Value = c(0L,  100L, 800L, 800L, 0L, 300L, 1200L, 1200

Re: [R] Group by and duplicate a value/dplyr

2021-05-11 Thread Elahe chalabi via R-help
-Liebig-University Giessen Tel: +49-(0)641-99-32104          Arndtstr. 2, 35392 Giessen, Germany http://www.uni-giessen.de/eichner - Am 11.05.2021 um 13:11 schrieb Elahe chalabi via R-help: > Hi all, > > I have the follo

Re: [R] FW: Group by and duplicate a value/dplyr

2021-05-11 Thread Elahe chalabi via R-help
min(x[x>0])) Cheers Petr > > -Original Message- > > From: R-help On Behalf Of Elahe chalabi > via > > R-help > > Sent: Tuesday, May 11, 2021 1:12 PM > > To: R-help Mailing List > > Subject: [R] Group by and duplicate a value/dplyr > >

[R] Group by and add a constant value based on a condition dply

2021-05-26 Thread Elahe chalabi via R-help
Hi everyone, I have the following dataframe:        structure(list(Department = c("A", "A", "A", "A", "A", "A", "A",       "A", "B", "B", "B", "B", "B", "B", "B", "B"), Class = c(1L, 1L,      1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L), Value = c(0L,      100L, 800L, 800L, 0L, 300L,

[R] dplyr filter function returns all the levels

2020-03-27 Thread Elahe chalabi via R-help
Hello everyone, I have the following dataframe               library(dplyr)     dput(df)     structure(list(Freq = c(19L, 19L, 18L, 15L, 14L, 13L, 13L, 12L,     11L, 11L, 11L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 9L), word1 = structure(c(3L,     11L, 5L, 6L, 11L, 3L, 7L, 10L, 8L, 11L, 13L, 1L, 1L,