Re: [R] Hierarchical Clustering Using Mutual Information
Thanks a lot. I have just test it and... it works! :-) J. Martin Maechler [EMAIL PROTECTED] wrote: Julio == Julio Thomas on Fri, 9 Dec 2005 21:13:20 + (GMT) writes: Julio Dear R-helpers, Is there somebody who knows if R has Julio already a build in function for Hierarchical Julio Clustering which uses Mutual Information as proximity Julio measure? The most prominent hiearchical clustering functions in R, hclust() and agnes() and diana() {package 'cluster'}, are based on general dissimilarity matrices; so you just need to be able compute d(i,j) - Mutual_Information( unit[i], unit[j] ) and then use for example hclust(). If 'MI' was a matrix with these numbers, you'd use dMI - as.dist(MI) hc.res - hclust(dMI, ) plot(hc.res, .) Martin Maechler, ETH Zurich __ 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 - [[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] floor()
Dear All, Is this right? floor((5.05-floor(5))*100) [1] 4 I would expect 5, or am I wrong? Thanks and regards, W - [[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
Re: [R] floor()
Yep! You are right I am going through it right now Thanks W Austin, Matt [EMAIL PROTECTED] wrote: I believe this is a FAQ. Examine: format((5.05-floor(5))*100, nsmall=16) [1] 4.9822 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Werner Bier Sent: Tuesday, November 29, 2005 3:35 PM To: r-help@stat.math.ethz.ch Subject: [R] floor() Dear All, Is this right? floor((5.05-floor(5))*100) [1] 4 I would expect 5, or am I wrong? Thanks and regards, W - [[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 - [[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] x-axis in dendrogram
Hi there, Is it possible to fix the x-axis on a dendrogram and allow vertical lines to intersect to each other? Regards, Julio - [[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] From using ginv()
Dear All, Does anybody know the meaning of this error from using ginv() function please? Error in La.svd(x, nu, nv) : error code 1 from Lapack routine 'dgesdd' Many thanks in advance. Regards, Werner - [[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] solve() versus ginv()
Dear All, While inverting a matrix the following error appears on my console: Error in solve.default(my_matrix) : Lapack routine dgesv: system is exactly singular With this respect, I have been replacing the solve() function with ginv(): the Moore-Penrose generalized inverse of a matrix. These are the questions I would like to ask you: 1. Would you also replace solve() with ginv() in these scenarios and using R? 2. Or is there something I should take care by using ginv() you would suggest me please? Many thanks in advance. Best regards, Werner - [[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] a class matrix with class ordered data
Deart R-help, I could not transfer ordered data into a matrix, does anybody knows if there is something wrong in the code below please? Thanks in advance, Tom Y - ordered( unlist( Q[,1:2] ) ) z - matrix(0, nrow(Q), 2) z - Y is.ordered(z) [1] T is.matrix(z) [1] F i.e. Is it possibile somehow to have is.matrix(z) equal TRUE? __ [[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] Compute dissimilarity matrix for ordinal data
Dear All, I have been trying to use the daisy routine to compute the dissimilarity matrix but I have not been successful in defining the data as ordinal. Might you kindly help me please? Thanks in advance and best regards, Tom __ [[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] Cross-validation
Dear R-help, I was wondering if somebody has a strong opinion on the following matter: Would you see appropriate to apply the leave-one-out cross validation techinque in time series modelling? Thanks in advance, Tom __ [[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
Re: [R] Essay identification
Thank you so much for all your answers. Papers, codes, examples, methods...THANKS A LOT! :-) P.S. Thanks to Richard R, Berton, Gabor, Roger P, Ted H et all :-) [EMAIL PROTECTED] wrote: On 12-Jun-05 Berton Gunter wrote: I assume that you know the usual procedure is to 'score' each essay by a vector that gives the frequency of occurrence of commonly used (sometimes adding subject matter specific) words and phrases. This multivariate response is then fed in as a training set into your favorite supervised learning/classification procedure. R has many of these -- trees, logisic regression, boosting, Random Forests,svm's,LDA,SOM's (whoops -- that's an Unsupervised one), ... . Try RSiteSearch('Classification',restrict=('functions'). The devil is in the details as to what works best, I believe. With only 78 exemplars in 10 groups, unless there is a lot of separation (disparate styles that you could probably detect manually) it may be difficult. It also depends on how large each group is (balance is generally better). Cheers, Bert I would add to Berton's list such scores as numbers of different words used, sentence lengths, relative frequencies of verbs, nouns, adjectives, adverbs, and so on, perhaps scaled by overall length. Length of Essay might even be a discriminant! You could also look at more subtle characteristics such as Zipf bins[*] -- the relative numbers of different words which occur once only, twice, three times, ... (though I'm not sure how you would score such a thing for classification purposes). [*] A term I've just invented inspired by the original instance of this by the linguist Zipf, later giving rise to the logarithmic distribution in the historic paper by Fisher, Corbett Williams in the Numbers of Species and Numbers of Individuals in butterfly traps. If you really want to go to town you can try things related to grammatical complexity, e.g. numbers of subordinate clauses per sentence, relative clauses, the reach of relative pronouns (how far from the referring pronoun is the thing referred to) and so on. There's quite an extensive literature on this sort of thing. though it's not as fashionable as it used to be. Th real problem is that you can get carried away by good ideas of things to try! The other factor to bear in mind is that if the Essays can be grouped by subject this is likely to influence many of the scores (such as the above). Hoping this helps and does not distract! Ted. E-Mail: (Ted Harding) Fax-to-email: +44 (0)870 094 0861 Date: 13-Jun-05 Time: 00:43:10 -- XFMail -- - [[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
Re: [R] kalman filter
yep! please type ?KalmanLike or check the dse libraries Tom m p [EMAIL PROTECTED] wrote: Hello, is there any implementation of Kalman filter in R? Thanks, Mark __ 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 - [[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] Perl installation under SuSe
Hi R-Help, I have just downloaded RSPerl_0.7-0.tar.gz under SuSe. If I type [EMAIL PROTECTED]: ~work R CMD INSTALL -c RSPerl_0.7-0.tar.gz i get the following error message makedir: cannot create directory '/user/lib/R/library/00LOCK' : Permission denied ERROR: failed to lock directory '/usr/lib/R/library' for modifing I would really appreciate if somebody can help me please. Thanks in advance, Tom __ [[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] Essay identification
Hi R-help, I have a database of 10 students who have written an overall of 78 essays. The challenge? I would like to identify who wrote the 79th essay. Has anybody used R in this context? Even if not, would you suggest me which pattern recognition technique I might possibly apply? Thanks a lot and regards, Tom - [[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] wild function
Dear all, With reference to the optim R documentation, parscale definition seems to say that if e.g. ¦f(x+1,y) - f(x,y)¦ and ¦f(x,y+1) - f(x,y)¦ are not of comparable magnitude then we should set the parscale argument. But then I was wondering why parscale is set to 20 in the wild function example. This function has only one parameter and if we set parscale equal to 1 then the solution near the global minimum is not found. Many thanks in advance to all of you and kind regards, Tom __ [[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
Re: [R] Proba( Ut+2=1 / ((Ut+1==1) (Ut==1))) ?
or maybe something like this x- sample(c(1, -1), 100, TRUE); t - p - 0 for (i in 1: (lenght(x)-2)) { if (x[i]+x[i+1]+x[i+2] == 3) t- t+1; if (x[i]+x[i+1]+x[i+2] == -3) p-p+1} P1-t/length(x); P2-p/length(x) Tom Dimitris Rizopoulos [EMAIL PROTECTED] wrote: maybe something like this: x - sample(c(1, -1), 100, TRUE) y - rle(x) ## ind1 - y$length[y$value == 1] sum(ind1[ind1 2] - 2) ind2 - y$length[y$value == -1] ## sum(ind1[ind1 2] - 2) could be helpful. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/336899 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm - Original Message - From: vincent To: Sent: Monday, April 25, 2005 6:03 PM Subject: [R] Proba( Ut+2=1 / ((Ut+1==1) (Ut==1))) ? Dear all, First I apologize if my question is quite simple, but i'm very newbie with R. I have vectors of the form v = c(1,1,-1,-1,-1,1,1,1,1,-1,1) (longer than this one of course). The elements are only +1 or -1. I would like to calculate : - the frequencies of -1 occurences after 2 consecutives -1 - the frequencies of +1 occurences after 2 consecutives +1 It looks probably something like : Proba( Ut+2=1 / ((Ut+1==1) (Ut==1))) could someone please give me a little hint about how i should/could begin to proceed ? Thanks (Thanks also to the R creators/contributors, this soft seems really great !) __ 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-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 __ [[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] optim() non-finite finite-difference value
Dear all, I am using the optim() function which it stops with the following error messagge: error in optim(...) non-finite finite-difference value I was wondering if somebody might suggest me a way to fix it please. Thanks in advance to all of you. Kind regards, Tom __ [[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] Optim(...parscale...)
Hi there, The optim(par, fn, ...parscale...) function in R requires 'parscale' which is defined as: A vector of scaling values for the parameters. Optimisation is performed on 'par/parscale' and these should be comparable in the sense that a unit change in any element (??) produces a unit change in the scaled value. I am just not understanding the comparable...produces. Should we compare fn(par/parscale+1)- fn(par/parscale) with fn(parscale+1) - fn(parscale)? With this respect, we might refer to the choice of parscale=20 in the wild function given in the optim R documentation if you wish. Many thanks in advance for your consideration. Kind regards, Tom - [[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