[R] Non-parametric four-way interactions?

2006-07-26 Thread Paul Smith
Dear All I am trying to study four-way interactions in an ANOVA problem. However, qqnorm+qqline result (at http://phhs80.googlepages.com/qqnorm.png) is not promising regarding the normality of data (960 observations). The result of Shapiro-Wilk test is also not encouraging: W = 0.9174, p-value

Re: [R] Non-parametric four-way interactions?

2006-07-27 Thread Paul Smith
On 7/27/06, Frank E Harrell Jr [EMAIL PROTECTED] wrote: I am trying to study four-way interactions in an ANOVA problem. However, qqnorm+qqline result (at http://phhs80.googlepages.com/qqnorm.png) is not promising regarding the normality of data (960 observations). The result of

Re: [R] Non-parametric four-way interactions?

2006-07-28 Thread Paul Smith
On 7/27/06, Frank E Harrell Jr [EMAIL PROTECTED] wrote: Tony Lachenbruch has written some about this, also see my book (it's web page is biostat.mc.vanderbilt.edu/rms). I don't know about the power of interaction tests, but for main effect tests in the absence of interaction, the Wilcoxon

[R] Syntax of Levene's test

2006-08-02 Thread Paul Smith
Dear All I am trying to use Levene's test (of package car), but I do not understand quite well how to use it. '?levene.test' does not unfortunately provide any example. My data are in a data frame and correspond to 4 factors plus response. Could someone please give me an example about how to use

Re: [R] Syntax of Levene's test

2006-08-02 Thread Paul Smith
On 8/2/06, John Fox [EMAIL PROTECTED] wrote: The argument y is the response variable and group is a factor defining groups (as ?levene.test says). If you have more than one factor, then you can use interaction() to create from them a factor with levels given by the product set of the levels of

Re: [R] Syntax of Levene's test

2006-08-02 Thread Paul Smith
On 8/3/06, John Fox [EMAIL PROTECTED] wrote: Levene's test tests the null hypothesis that the variance are equal, so a small p-value suggests that they are not. Looking at your output, it seems odd that you have as many as 96 groups. Thanks again, John. I have 4 factors with 3, 4, 4 and 2

[R] Looking for transformation to overcome heterogeneity of variances

2006-08-03 Thread Paul Smith
Dear All My data consists in 96 groups, each one with 10 observations. Levene's test suggests that the variances are not equal, and therefore I have tried to apply the classical transformations to have homocedasticity in order to be able to use ANOVA. Unfortunately, no transformation that I have

Re: [R] Looking for transformation to overcome heterogeneity of variances

2006-08-03 Thread Paul Smith
On 03 Aug 2006 15:45:10 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote: My data consists in 96 groups, each one with 10 observations. Levene's test suggests that the variances are not equal, and therefore I have tried to apply the classical transformations to have homocedasticity in order

Re: [R] Looking for transformation to overcome heterogeneity of variances

2006-08-03 Thread Paul Smith
On 03 Aug 2006 16:32:38 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote: My data consists in 96 groups, each one with 10 observations. Levene's test suggests that the variances are not equal, and therefore I have tried to apply the classical transformations to have homocedasticity in

Re: [R] Looking for transformation to overcome heterogeneity of variances

2006-08-04 Thread Paul Smith
Thanks to all contributors for the fruitfulness of this discussion. I am speculating about a simpler solution: to use a non-parametric approach. To avoid the requirement of having normal residuals, Frank Harrell has suggested here the following non-parametric procedure: library(Design) # also

Re: [R] How to export data to Excel Spreadsheet?

2006-08-07 Thread Paul Smith
On 8/7/06, Xin [EMAIL PROTECTED] wrote: I try to export my output's data to Excel spreadsheet. My outputs are: comb3 [,1] [,2] [,3] [1,] a b c [2,] a b d [3,] a b e [4,] a b f [5,] a b g See ? write.table ? write.csv Paul

Re: [R] Vector Join

2006-08-13 Thread Paul Smith
On 8/13/06, Michael Zatorsky [EMAIL PROTECTED] wrote: I'm working on producing a simple cumulative frequency distribution. Thanks to the help of the good people on this list I now have four vectors that I'd like to join/relate into a table. e.g. v1 - myHistogram$breaks #

Re: [R] column to row

2006-08-14 Thread Paul Smith
On 8/14/06, yohannes alazar [EMAIL PROTECTED] wrote: I have a data in two columns and how can i convert it to one row . thank you in advance inpute 1 2 3 4 5 6 7 8 9 1 out put 1 2 3 4 5 6 7 8 9 1 An example follows: input - matrix(1:10,5,2) input [,1] [,2] [1,]16

Re: [R] Autocompletion

2006-08-16 Thread Paul Smith
On 8/16/06, Óttar Ísberg [EMAIL PROTECTED] wrote: I may be guilty of not doing my homework, but still, I've searched. I'm a relative newcomer to R (my forte is at present MATLAB, but for various reasons I'm trying to get literate in R). My question is: Is there an autocompletion feature buried

Re: [R] Autocompletion

2006-08-16 Thread Paul Smith
On 8/16/06, Óttar Ísberg [EMAIL PROTECTED] wrote: That was quick, and thanks. I'm afraid I wasn't precise enough. I'm using Windows XP and by autocompletion I mean typing the first few letters of a command and then have the system either complete the command or give you possible options, as in

Re: [R] 4^2 factorial help

2006-08-18 Thread Paul Smith
On 8/18/06, Correia, L, Mr [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: To whom it may concern: I am trying a factorial design a system of mine that has two factors. Each factor was set at four different levels, with one replication for each of the combinations. My data is as follows:

Re: [R] Check values in colums matrix

2006-08-24 Thread Paul Smith
On 8/24/06, Muhammad Subianto [EMAIL PROTECTED] wrote: I have a dataset (20 columns 1000 rows) which some of columns have the same value and the others have different values. Here are some piece of my dataset: obj - cbind(c(1,1,1,4,0,0,1,4,-1), c(0,1,1,4,1,0,1,4,-1),

[R] Can R compute the expected value of a random variable?

2006-08-26 Thread Paul Smith
Dear All Can R compute the expected value of a random variable? Thanks in advance, Paul __ 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] Can R compute the expected value of a random variable?

2006-08-27 Thread Paul Smith
On 8/26/06, Mike Nielsen [EMAIL PROTECTED] wrote: Yes. Can R compute the expected value of a random variable? Mike: thank you very much indeed for your so insightful and complete answer. I have meanwhile deepened my research and, as a consequence, I have found the following solution, which

Re: [R] Help on apply() function

2006-08-30 Thread Paul Smith
On 8/30/06, Mark Lyman [EMAIL PROTECTED] wrote: I have a problem with apply function. I have to two matrices of dimension of one column but n rows. I have to check whether one matrix is greater than other by going thru each row (ie) using if condition to check one matrix with another

[R] Fitting Pareto distribution to some data

2006-09-03 Thread Paul Smith
Dear All I am trying to fit Pareto distribution to some data. MASS package does not support Pareto distribution. Is there some alternative way? Thanks in advance, Paul __ R-help@stat.math.ethz.ch mailing list

Re: [R] Fitting Pareto distribution to some data

2006-09-04 Thread Paul Smith
On 9/3/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: I am trying to fit Pareto distribution to some data. MASS package does not support Pareto distribution. Is there some alternative way? Actually fitdistr{MASS} does if you supply the pdf for a Pareto. That is not in base R, but easy to

Re: [R] Fitting Pareto distribution to some data

2006-09-04 Thread Paul Smith
, at 10:55 AM, Paul Smith wrote: Dear All I am trying to fit Pareto distribution to some data. MASS package does not support Pareto distribution. Is there some alternative way? Thanks in advance, Paul __ R-help@stat.math.ethz.ch

[R] Gnuplot epslatex format also in R?

2006-09-12 Thread Paul Smith
Dear All Is there some way of exporting R plots to epslatex, i.e., to a file with the eps file and another one with the LaTeX commands (representing the text in the plots), likewise Gnuplot does? If so, could you please indicate it to me? Thanks in advance, Paul

Re: [R] Gnuplot epslatex format also in R?

2006-09-12 Thread Paul Smith
On 9/12/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: Is there some way of exporting R plots to epslatex, i.e., to a file with the eps file and another one with the LaTeX commands (representing the text in the plots), likewise Gnuplot does? If so, could you please indicate it to me? R

Re: [R] extract a value from vector

2006-09-12 Thread Paul Smith
On 9/12/06, Ethan Johnsons [EMAIL PROTECTED] wrote: A quick question, please! How do you extract a certain value of vector? i.e. x = c(2,5,3,6,21,3,6,24, ) How do you get the 1st one (which is 2); the 5th one (which is 21); etc? Simple, Ethan: x[1], x[5], ... Paul

Re: [R] Gnuplot epslatex format also in R?

2006-09-13 Thread Paul Smith
On 9/12/06, Anupam Tyagi [EMAIL PROTECTED] wrote: R has an xfig driver, and AFAIK you can do this from xfig. Is there an xfig port for Windows, without cygwin? If so, I will be thankful for a pointer to the where it can be downloaded from. I have been looking for it for some time.

[R] Classification trees and written conditions

2006-05-18 Thread Paul Smith
Dear All When drawing a classification tree with plot(mytree) text(mytree) the conditions are written just before the nodes branch. My question is: can one be certain that those conditions refer to the left-side branches? (The R documentation surprisingly lacks the information that I am asking

Re: [R] Classification trees and written conditions

2006-05-18 Thread Paul Smith
On 5/18/06, Carlos Ortega [EMAIL PROTECTED] wrote: Are you referring to ?: - library(tree) - library(rpart) On 5/18/06, Paul Smith [EMAIL PROTECTED] wrote: Dear All When drawing a classification tree with plot(mytree) text(mytree) the conditions are written just before the nodes

Re: [R] Classification trees and written conditions

2006-05-18 Thread Paul Smith
On 5/18/06, Carlos Ortega [EMAIL PROTECTED] wrote: Yes, that is right. The conditions on top of the branches refer to the left-hand side. Thanks, Carlos. Then, it should be explicitly said in ? text.rpart. Paul __ R-help@stat.math.ethz.ch mailing

[R] Using R to illustrate the Central Limit Theorem

2005-04-21 Thread Paul Smith
Dear All I am totally new to R and I would like to know whether R is able and appropriate to illustrate to my students the Central Limit Theorem, using for instance 100 independent variables with uniform distribution and showing that their sum is a variable with an approximated normal

Re: [R] Using R to illustrate the Central Limit Theorem

2005-04-23 Thread Paul Smith
On 4/23/05, Matthias Kohl [EMAIL PROTECTED] wrote: here is another idea to illustrate the Central Limit Theorem which is based on our package distr. Thanks to all for your numerous suggestions. Since I am just beginning with R, it will take a while before I can fully digest your help. Have a

[R] Restarting R without quitting R

2005-04-23 Thread Paul Smith
Dear All Is there some way of restarting R, without quitting R? In other words, I am looking for something like the commands reset (MuPAD) or restart (Maple). Thanks in advance, Paul __ R-help@stat.math.ethz.ch mailing list

Re: [R] Restarting R without quitting R

2005-04-23 Thread Paul Smith
On 4/23/05, Uwe Ligges [EMAIL PROTECTED] wrote: Is there some way of restarting R, without quitting R? In other words, I am looking for something like the commands reset (MuPAD) or restart (Maple). No, but of course you could write a function that fires up a new instance of R and quits

Re: [R] good editor for R sources ?

2005-04-26 Thread Paul Smith
On 4/26/05, Uwe Ligges [EMAIL PROTECTED] wrote: (Sorry if the question has already been answered.) Could someone please suggest a good text editor for writing R sources ? (I know emacs exists ... but I find it a bit heavy). I use crimson (http://www.crimsoneditor.com) which is small

Re: [R] good editor for R sources ?

2005-04-26 Thread Paul Smith
On 4/26/05, Liaw, Andy [EMAIL PROTECTED] wrote: (Sorry if the question has already been answered.) Could someone please suggest a good text editor for writing R sources ? (I know emacs exists ... but I find it a bit heavy). I use crimson (http://www.crimsoneditor.com) which is

[R] Density curve over a histogram

2005-04-27 Thread Paul Smith
Dear All I would like to draw a picture with the density curve of a normal distribution over a histogram of a set of random numbers extracted from the same normal distribution. Is that possible? Thanks in advance, Paul __ R-help@stat.math.ethz.ch

Re: [R] Density curve over a histogram

2005-04-27 Thread Paul Smith
On 4/27/05, Achim Zeileis [EMAIL PROTECTED] wrote: I would like to draw a picture with the density curve of a normal distribution over a histogram of a set of random numbers extracted from the same normal distribution. Is that possible? To quote Simon `Yoda' Blomberg: This is R. There is

[R] User-defined random variable

2005-04-30 Thread Paul Smith
Dear All I would like to know whether it is possible with R to define a discrete random variable different from the ones already defined inside R and generate random numbers from that user-defined distribution. Thanks in advance, Paul __

Re: [R] User-defined random variable

2005-05-02 Thread Paul Smith
On 5/1/05, Matthias Kohl [EMAIL PROTECTED] wrote: I would like to know whether it is possible with R to define a discrete random variable different from the ones already defined inside R and generate random numbers from that user-defined distribution. Yes. One generic way is to specify the

[R] Command to add two vectors

2005-05-03 Thread Paul Smith
Dear All Is there some command to add two vectors? Thanks in advance, Paul __ 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] Command to add two vectors

2005-05-03 Thread Paul Smith
On 5/3/05, Josef Eschgfaeller [EMAIL PROTECTED] wrote: Is there some command to add two vectors? x+y Thanks a lot, Josef. Paul __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

[R] Density of the sum of two random variables

2005-05-04 Thread Paul Smith
Dear All I would like to know whether it is possible with R to get the mathematical expression of the density of a sum of two independent continuous random variables. Thanks in advance, Paul __ R-help@stat.math.ethz.ch mailing list

[R] Histogram for mixed random variables

2005-05-05 Thread Paul Smith
Dear All I would like to get the histogram for the following model with discrete and continuous random variables: * with probability 1/3, a random number is drawn from the continuous uniform distribution (min=0, max=1); * with probability 2/3, a random number is drawn from a different continuous

Re: [R] Density of the sum of two random variables

2005-05-05 Thread Paul Smith
On 5/5/05, Spencer Graves [EMAIL PROTECTED] wrote: Have you considered package distr? It will do something similar to what you request, I think; it may or may not be adequate for your purposes. Thanks, Spencer and Duncan. Maybe, the best choice is to use Maple or MuPAD for that.

[R] Looking for greater floating-point precision

2006-11-16 Thread Paul Smith
Dear All For my calculations, I am needing to use more floating-point precision than the default one of R. Is that possible? And, if yes, how? Thanks in advance, Paul __ R-help@stat.math.ethz.ch mailing list

Re: [R] Looking for greater floating-point precision

2006-11-17 Thread Paul Smith
On 11/16/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: For my calculations, I am needing to use more floating-point precision than the default one of R. Is that possible? And, if yes, how? See package gmp (but that will be slow and cumbersome for all but simple calculations). The real

[R] Ryacas not working properly

2006-11-18 Thread Paul Smith
Dear All I have just installed the package Ryacas, but getting the following: library(Ryacas) Loading required package: XML yacas(1/2 * 3/4) [1] Starting Yacas! Error in socketConnection(host = 127.0.0.1, port = 9734, server = FALSE, : unable to open connection In addition: Warning

Re: [R] Ryacas not working properly

2006-11-19 Thread Paul Smith
On 11/19/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Checkout the INSTALLATION - UNIX and TROUBLESHOOTING sections of the home page: http://code.google.com/p/ryacas/ I have just installed the package Ryacas, but getting the following: library(Ryacas) Loading required package: XML

Re: [R] Ryacas not working properly

2006-11-19 Thread Paul Smith
On 11/19/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: You might try posting your problem on the comp.os.linux.networking group since it appears to be a configuration problem with telnet on your machine. Thanks, Gabor. I am going to do that and I will let you know about the result. Paul

Re: [R] Ryacas not working properly

2006-11-19 Thread Paul Smith
On 19 Nov 2006 16:11:52 +0100, Peter Dalgaard [EMAIL PROTECTED] wrote: Paul Smith [EMAIL PROTECTED] writes: On 11/19/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: You might try posting your problem on the comp.os.linux.networking group since it appears to be a configuration problem

Re: [R] Ryacas not working properly

2006-11-19 Thread Paul Smith
On 11/19/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Sorry but there is not much else I can tell you. I don't have a UNIX system myself though I do know that others have used Ryacas on UNIX since the notes on the home page are based, in part, on their feedback of successfully using it on

Re: [R] Ryacas not working properly

2006-11-19 Thread Paul Smith
On 11/19/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Sorry but there is not much else I can tell you. I don't have a UNIX system myself though I do know that others have used Ryacas on UNIX since the notes on the home page are based, in part, on their feedback of successfully

Re: [R] Ryacas not working properly

2006-11-19 Thread Paul Smith
On 11/19/06, Marc Schwartz [EMAIL PROTECTED] wrote: OK, after digging around for a couple of hours on this, thinking that this might be a firewall/SELinux/On Demand Services problem, I have, I think, nailed it down to two key things on FC6: 1. It requires the use of the '--enable-server'

Re: [R] Ryacas not working properly

2006-11-19 Thread Paul Smith
On 11/19/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Thanks, Marc. I have placed a link to your post on the Ryacas home page. Also, Ryacas 0.2-3 is now on Omegahat (as well as google groups). Apparently, the link HowTo - Enable Telnet on Linux at Ryacas site is misleading, as it suggests

[R] Conversion from expression to numeric

2006-11-23 Thread Paul Smith
Dear All I am trying to convert from the type expression to the type numeric. The following works: x - expression(6.2) as.numeric(as.character(x)) [1] 6.2 However, the following does not work: x - expression(62/100) as.numeric(as.character(x)) [1] NA Warning message: NAs introduced by

Re: [R] Conversion from expression to numeric

2006-11-23 Thread Paul Smith
On 11/23/06, Barry Rowlingson [EMAIL PROTECTED] wrote: x - expression(62/100) as.numeric(as.character(x)) [1] NA Warning message: NAs introduced by coercion Any idea about how to deal with the second case? eval-uate the expression: x - expression(62/100) eval(x) [1]

Re: [R] Conversion from expression to numeric

2006-11-23 Thread Paul Smith
On 23 Nov 2006 18:20:17 +0100, Peter Dalgaard [EMAIL PROTECTED] wrote: I am trying to convert from the type expression to the type numeric. The following works: x - expression(6.2) as.numeric(as.character(x)) [1] 6.2 However, the following does not work: x -

[R] Ryacas and fractions with simultaenously very large numerators and denominators

2006-11-23 Thread Paul Smith
Dear All I am doing the following: x - yacas(3/2) for (i in 2:400) +x - yacas(paste(x,*,x)) x expression(Inf^1.260864167e+117/Inf^6.304320836e+116) Eval(x) [1] NaN No luck this way. However, I am successful with y - yacas((3/2)^400) y

Re: [R] Ryacas and fractions with simultaenously very large numerators and denominators

2006-11-23 Thread Paul Smith
On 23 Nov 2006 20:17:15 +0100, Peter Dalgaard [EMAIL PROTECTED] wrote: I am doing the following: x - yacas(3/2) for (i in 2:400) +x - yacas(paste(x,*,x)) x expression(Inf^1.260864167e+117/Inf^6.304320836e+116) Eval(x) [1] NaN No luck this way. However, I am successful

Re: [R] Ryacas not working properly

2006-11-25 Thread Paul Smith
On 11/19/06, Marc Schwartz [EMAIL PROTECTED] wrote: this might be a firewall/SELinux/On Demand Services problem, I have, I think, nailed it down to two key things on FC6: 1. It requires the use of the '--enable-server' configure option for yacas itself. 2. There is a directory permissions

Re: [R] Ryacas not working properly

2006-11-25 Thread Paul Smith
On 11/25/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Ryacas starts up yacas with an initialization file R.ys which puts the server in a mode which outputs XML (which is what Ryacas reads). It does that by specifying --init /whatever/R.ys on the yacas command line when it is run. You can

[R] Question about rpart and regression trees

2007-01-22 Thread Paul Smith
Dear All I would like to use rpart to obtain a regression tree for a dataset like the following: Y X1 X2 X3 X4 5.500033B A 3 2 0.35625148 D B 6 5 0.8062546 E C 4 3 5.100014C A 3

Re: [R] Question about rpart and regression trees

2007-01-23 Thread Paul Smith
On 1/23/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: I would like to use rpart to obtain a regression tree for a dataset like the following: Y X1 X2 X3 X4 5.500033 B A 3 2 0.35625148D B 6 5 0.8062546 E C

Re: [R] Announcing another R search engine

2007-02-04 Thread Paul Smith
On 2/4/07, Sasha Goodman [EMAIL PROTECTED] wrote: Oh, I almost forgot: The search engine is at: http://www.rseek.org --Sasha On 2/3/07, Sasha Goodman [EMAIL PROTECTED] wrote: Hello all, I wanted to announce a new R search engine I made that covers all the major R mailing lists,

Re: [R] Random Integers

2007-02-25 Thread Paul Smith
Is there an R function to generate random integers? Thanks in advance. For example, if you want 5 random integers from the sequence 1:50, you can do the following: sample(1:50,5) Paul __ R-help@stat.math.ethz.ch mailing list

[R] Cannot install iWidgetsRGtk

2007-04-04 Thread Paul Smith
Dear All I am trying to install iWidgetsRGtk (on a Linux machine), but getting the following error: install.packages(iWidgetsRGtk,repos=http://www.math.csi.cuny.edu/pmg;) Warning in download.packages(unique(pkgs), destdir = tmpd, available = available, : no package 'iWidgetsRGtk' at

Re: [R] Cannot install iWidgetsRGtk

2007-04-04 Thread Paul Smith
On 4/4/07, Michael Lawrence [EMAIL PROTECTED] wrote: iWidgetsRGtk is an obsolete package. Instead, install gWidgetsRGtk from CRAN. That's g not i. Thanks, Michael. That is solved now. Paul On 4/4/07, Paul Smith [EMAIL PROTECTED] wrote: Dear All I am trying to install iWidgetsRGtk

Re: [R] Computing the rank of a matrix.

2007-04-06 Thread Paul Smith
On 4/6/07, José Luis Aznarte M. [EMAIL PROTECTED] wrote: Hi! Maybe this is a silly question, but I need the column rank (http://en.wikipedia.org/wiki/Rank_matrix) of a matrix and R function 'rank()' only gives me the ordering of the elements of my matrix. How can I compute the column

[R] A problem about all possible sequences

2007-04-17 Thread Paul Smith
Dear All Suppose a sequence of length 10 generated by the following rule: the first element is 0 with 50% of probability or 1 with the same probability; the second element likewise; and so on. Is there some R command to obtain all possible different sequences formed by the above rule? I am aware

Re: [R] A problem about all possible sequences

2007-04-17 Thread Paul Smith
On 4/17/07, Robin Hankin [EMAIL PROTECTED] wrote: f - function(n){expand.grid(rep(list(0:1),n))} f(10) [snip] Thanks, Robin, that is it! Paul On 17 Apr 2007, at 15:26, Paul Smith wrote: Dear All Suppose a sequence of length 10 generated by the following rule: the first element

[R] Bad optimization solution

2007-05-07 Thread Paul Smith
Dear All I am trying to perform the below optimization problem, but getting (0.5,0.5) as optimal solution, which is wrong; the correct solution should be (1,0) or (0,1). Am I doing something wrong? I am using R 2.5.0 on Fedora Core 6 (Linux). Thanks in advance, Paul

Re: [R] Bad optimization solution

2007-05-07 Thread Paul Smith
even slightly you will have no problem. Paul Smith [EMAIL PROTECTED] To Sent by: R-help r-help@stat.math.ethz.ch [EMAIL PROTECTED

Re: [R] Bad optimization solution

2007-05-07 Thread Paul Smith
On 5/7/07, Paul Smith [EMAIL PROTECTED] wrote: I think the problem is the starting point. I do not remember the details of the BFGS method, but I am almost sure the (.5, .5) starting point is suspect, since the abs function is not differentiable at 0. If you perturb the starting point

Re: [R] Bad optimization solution

2007-05-08 Thread Paul Smith
/agingandhealth/People/Faculty/Varadhan.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith Sent: Monday, May 07, 2007 6:26 PM To: R-help Subject: Re: [R] Bad

Re: [R] Bad optimization solution

2007-05-08 Thread Paul Smith
for your function is singular, it has eigenvalues of 0 and 2. In short, there is no substitute to using your analytic powers! Ravi. - Original Message - From: Paul Smith [EMAIL PROTECTED] Date: Tuesday, May 8, 2007 4:33 am Subject: Re: [R] Bad optimization solution To: R-help r-help

[R] Increasing precision of rgenoud solutions

2007-05-09 Thread Paul Smith
Dear All I am using rgenoud to solve the following maximization problem: myfunc - function(x) { x1 - x[1] x2 - x[2] if (x1^2+x2^2 1) return(-999) else x1+x2 } genoud(myfunc, nvars=2, Domains=rbind(c(0,1),c(0,1)),max=TRUE,boundary.enforcement=2,solution.tolerance=0.01) How

[R] Nonlinear constrains with optim

2007-05-10 Thread Paul Smith
Dear All I am dealing at the moment with optimization problems with nonlinear constraints. Regenoud is quite apt to solve that kind of problems, but the precision of the optimal values for the parameters is sometimes far from what I need. Optim seems to be more precise, but it can only accept

Re: [R] Increasing precision of rgenoud solutions

2007-05-10 Thread Paul Smith
=== Paul Smith writes: Dear All I am using rgenoud to solve the following maximization problem: myfunc - function(x) { x1 - x[1] x2 - x[2] if (x1^2+x2^2 1) return(-999) else x1+x2 } genoud(myfunc, nvars=2, Domains=rbind(c(0,1),c(0,1)),max=TRUE

Re: [R] Increasing precision of rgenoud solutions

2007-05-10 Thread Paul Smith
=== Paul Smith writes: Thanks, Jasjeet, for your reply, but maybe I was not enough clear. The analytical solution for the optimization problem is the pair (sqrt(2)/2,sqrt(2)/2), which, approximately, is (0.707106781186548,0.707106781186548). The solution provided

Re: [R] Nonlinear constrains with optim

2007-05-10 Thread Paul Smith
. Starting from a solution given by Rgenoud or its ilk is probably a good idea. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) Paul Smith wrote: Dear All I am dealing at the moment

[R] Looking for easy way of getting the starting value for constrOptim

2007-07-02 Thread Paul Smith
Dear All, I am using constrOptim, but facing a difficulty: how can I get the starting value? Is there some automatic way of getting it? Since I have many inequalities as constraints (all linear), it is quite difficult to find a feasible value. I have tried to use rgenoud solution as a feasible

[R] Fine tunning rgenoud

2007-07-03 Thread Paul Smith
Dear All, I am trying to solve the following maximization problem, but I cannot have rgenoud giving me a reliable solution. Any ideas? Thanks in advance, Paul library(rgenoud) v - 0.90 O1 - 10 O2 - 20 O0 - v*O1+(1-v)*O2 myfunc - function(x) { U0 - x[1] U1 -

Re: [R] Fine tunning rgenoud

2007-07-03 Thread Paul Smith
that the solution is right. That is why I am trying to get a solution with rgenoud, but unsuccessfully until now. Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith Sent: Tuesday, July 03, 2007 4:10 PM To: R-help Subject: [R] Fine

Re: [R] Fine tunning rgenoud

2007-07-03 Thread Paul Smith
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith Sent: Tuesday, July 03, 2007 5:10 PM To: R-help Subject: Re: [R] Fine tunning rgenoud On 7/3/07, Ravi Varadhan [EMAIL PROTECTED] wrote: You had indicated in your previous email that you are having trouble finding

Re: [R] Fine tunning rgenoud

2007-07-03 Thread Paul Smith
by constrOptim is not interior; the gradient is not equal to zero. Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith Sent: Tuesday, July 03, 2007 5:10 PM To: R-help Subject: Re: [R] Fine tunning rgenoud On 7/3/07, Ravi Varadhan

Re: [R] Fine tunning rgenoud

2007-07-04 Thread Paul Smith
, but it works in many cases. Paul - Original Message - From: Paul Smith [EMAIL PROTECTED] Date: Tuesday, July 3, 2007 7:32 pm Subject: Re: [R] Fine tunning rgenoud To: R-help r-help@stat.math.ethz.ch On 7/4/07, Ravi Varadhan [EMAIL PROTECTED] wrote: It should be easy enough

Re: [R] Fine tunning rgenoud

2007-07-04 Thread Paul Smith
0.00136226156979156 2.47224893929883e-11 0.00121959537442013 0.00249964872330666 1.58514632925203e-05 0.213308634647407 - Original Message - From: Paul Smith [EMAIL PROTECTED] Date: Wednesday, July 4, 2007 6:00 am Subject: Re: [R] Fine tunning rgenoud To: R-help

Re: [R] Fine tunning rgenoud

2007-07-04 Thread Paul Smith
On 7/4/07, Paul Smith [EMAIL PROTECTED] wrote: On 7/4/07, RAVI VARADHAN [EMAIL PROTECTED] wrote: My point is that it might be better to try multiple (feasible) starting values for constrOptim to ensure that you have a good local minimum, since it appears that constrOptim converges

Re: [R] Optimization

2007-07-17 Thread Paul Smith
On 7/16/07, massimiliano.talarico [EMAIL PROTECTED] wrote: I need a suggest to obtain the max of this function: Max x1*0.021986+x2*0.000964+x3*0.02913 with these conditions: x1+x2+x3=1; radq((x1*0.114434)^2+(x2*0.043966)^2+(x3*0.100031)^2)=0.04; x1=0; x1=1; x2=0; x2=1; x3=0; x3=1;

Re: [R] constraint in constrOptim

2007-08-02 Thread Paul Smith
On 8/2/07, André Rossi [EMAIL PROTECTED] wrote: I'm using the function constrOptim together with the SANN method and my objective function (f) has two parameters. One of the parameters needs be into (2^(-10), 2^4) range and the other into (2^(-2), 2^12) range. How can I do it using

Re: [R] constraint in constrOptim

2007-08-02 Thread Paul Smith
On 8/2/07, Paul Smith [EMAIL PROTECTED] wrote: I'm using the function constrOptim together with the SANN method and my objective function (f) has two parameters. One of the parameters needs be into (2^(-10), 2^4) range and the other into (2^(-2), 2^12) range. How can I do it using

[R] Optimal control package?

2007-08-04 Thread Paul Smith
Dear All, Is there some package to do optimal control? Thanks in advance, Paul __ 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

Re: [R] Differentiation

2007-08-20 Thread Paul Smith
On 8/20/07, nalluri pratap [EMAIL PROTECTED] wrote: try library(numDeriv) ?genD Pratap Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote: Hi, Could anyone tell me what is the command used in R to do 1. Differentiation 2. Newton Raphson method (Numerical Analysis in

Re: [R] Evaluating f(x(2,3)) on a function f- function(a,b){a+b}

2007-08-22 Thread Paul Smith
On 8/22/07, Søren Højsgaard [EMAIL PROTECTED] wrote: I have a function and a vector, say f - function(a,b){a+b} x - c(2,3) I want to evaluate f on x in the sense of computing f(x[1],x[2]). I would like it to be so that I can write f(x). (I know I can write a wrapper function g -

Re: [R] Calculating diameters of cirkels in a picture.

2007-08-23 Thread Paul Smith
On 8/23/07, Bart Joosen [EMAIL PROTECTED] wrote: Maybe this is more a programming questions than a specific R-project question, but maybe there is someone who can point me in the right direction. I have a picture of cirkels which I took with a digital camera. Now I want to use the diameter

Re: [R] Q: how to interrupt long calculation?

2007-08-29 Thread Paul Smith
On 8/29/07, D. R. Evans [EMAIL PROTECTED] wrote: The subject says it all really: I've tried hitting control-C (multiple times), but that doesn't seem to be a reliable way to interrupt a long calculation. What is the right way to interrupt a calculation that has been proceeding for several

[R] R CMD BATCH: cat does not print

2007-08-30 Thread Paul Smith
Dear All, I am trying to write my first R script. The code is simply cat(Hello!\n) However, when I run $ R CMD BATCH myscript.R I do not see Hello! on the console. I am using Fedora 7 (Linux) and R-2.5.1. Any ideas? Thanks in advance, Paul __

Re: [R] R CMD BATCH: cat does not print

2007-08-30 Thread Paul Smith
On 8/30/07, Barry Rowlingson [EMAIL PROTECTED] wrote: I am trying to write my first R script. The code is simply cat(Hello!\n) However, when I run $ R CMD BATCH myscript.R I do not see Hello! on the console. I am using Fedora 7 (Linux) and R-2.5.1. Any ideas? You

Re: [R] R CMD BATCH: cat does not print

2007-08-30 Thread Paul Smith
On 8/30/07, Vladimir Eremeev [EMAIL PROTECTED] wrote: Use rscript Rscript myscript.R or Rscript -e 'cat(Hello!\n)' will show Hello! on the console. R CMD BATCH writes its output to the file myscript.Rout Thanks, Vladimir. Rscript is exactly what I was looking for! Paul Paul Smith

  1   2   >