Re: [R] Looking for package for data generation for classification and regression

2022-03-04 Thread Paul Smith
On Fri, Mar 4, 2022 at 8:07 AM Ranjan Maitra wrote: > > > I am in need of generating artificial data for machine learning > > classification and regression analysis. What I am looking for is > > something similar to Python sklearn.datasets.make_classification and > >

[R] Looking for package for data generation for classification and regression

2022-03-03 Thread Paul Smith
Dear All, I am in need of generating artificial data for machine learning classification and regression analysis. What I am looking for is something similar to Python sklearn.datasets.make_classification and sklearn.datasets.make_regression:

Re: [R] kableExtra: How to change kable font family

2019-05-27 Thread Paul Smith
Yes, Jeff, that works! Thanks! However, if I wanted to change the font family to a family different of typewriter, I guess it would be impossible. Paul On Mon, May 27, 2019 at 2:17 PM Jeff Newmiller wrote: > > What about the "monospace" setting? > > On May 27, 2019 1:08

Re: [R] kableExtra: How to change kable font family

2019-05-27 Thread Paul Smith
Thanks, Jeff, but apparently there is no option to change font family through cell_spec. Paul On Mon, May 27, 2019 at 2:22 AM Jeff Newmiller wrote: > > Perhaps... ?cell_spec > > On May 26, 2019 11:13:04 AM PDT, Paul Smith wrote: > >Dear All, > > > >Is it poss

[R] kableExtra: How to change kable font family

2019-05-26 Thread Paul Smith
Dear All, Is it possible to change the font family to typewriter of the tables generated by kable from kableExtra package? Thanks in advance, Paul __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] Best Optimization Routines

2018-02-15 Thread Paul Smith
On Tue, Feb 13, 2018 at 7:55 PM, JamesRyan(Ryan James)/E North America Business Division wrote: > I have a set of data, the production of oil from a well. And an equation to > predict that forecast. > > The equation requires 5 input variables which are real numbers with upper and

Re: [R] Most appropriate function for the following optimisation issue?

2015-10-20 Thread Paul Smith
On Tue, Oct 20, 2015 at 11:58 AM, Andy Yuan wrote: > > Please could you help me to select the most appropriate/fastest function to > use for the following constraint optimisation issue? > > Objective function: > > Min: Sum( (X[i] - S[i] )^2) > > Subject to constraint : > > Sum

[R] Testing correlation of equation in a SUR model fitted by systemfit

2014-04-15 Thread Paul Smith
Dear All, How to test whether the correlation in the matrix of correlation of a two-equations SUR model fitted by package systemfit are significant? Thanks in advance, Paul __ R-help@r-project.org mailing list

Re: [R] Solving quadratic equation in R

2012-07-27 Thread Paul Smith
On Thu, Jul 26, 2012 at 9:48 PM, Diviya Smith diviya.sm...@gmail.com wrote: Hi there, I would like to solve a simple equation in R a^2 - a = 8.313 There is no real solution to this problem but I would like to get an approximate numerical solution. Can someone suggest how I can set this up?

Re: [R] Event Studies in R

2012-06-23 Thread Paul Smith
I suspect Ivan is looking for packages to do discrete-event simulation like simulation of queues. Paul On Sat, Jun 23, 2012 at 5:15 PM, Jim Porzak jpor...@gmail.com wrote: Ivan, You need to be more specific if you want an answer. What kind of events? With or without attributes? Species

Re: [R] Extraction of rules from Support Vector Machines

2011-12-18 Thread Paul Smith
2011/12/17 Uwe Ligges lig...@statistik.tu-dortmund.de: I am using the svm() function of package e1071 for creating Support Vector Machines prediction models. As far as I understand, there is no function in this package to extract rules of prediction. Is there some other package with such a

[R] Extraction of rules from Support Vector Machines

2011-12-15 Thread Paul Smith
Dear All, I am using the svm() function of package e1071 for creating Support Vector Machines prediction models. As far as I understand, there is no function in this package to extract rules of prediction. Is there some other package with such a functionality? Thanks in advance, Paul

Re: [R] Maximization

2011-10-30 Thread Paul Smith
On Tue, Oct 25, 2011 at 12:04 PM, Eliano eliano.m.marq...@gmail.com wrote: hi people, I'm trying to maximize this function: fn= function (x) {x[1]^2+5*x[2]^2} with this restriction fn1 = function (x) {x[1]+x[2] =5} Can someone help me how to procedure this? I tried in the alabama and

[R] Function for running a sign test

2011-09-19 Thread Paul Smith
Dear All, Has R got a function to perform a sign test? I have done some searching but with no luck. Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Function for running a sign test

2011-09-19 Thread Paul Smith
and a website stating authoritatively that there is no R function for the sign test, so its all a matter of your chosen authority, I suppose. Sarah On Mon, Sep 19, 2011 at 6:10 AM, Paul Smith phh...@gmail.com wrote: Dear All, Has R got a function to perform a sign test? I have done some

[R] How to change the color of the bar lines of a histogram?

2011-08-18 Thread Paul Smith
Dear All, How to change the color of the bar lines of a histogram? I have read ?hist which mentions the parameter 'col', but this one is to configure the color of the bars filling. Thanks in advance, Paul __ R-help@r-project.org mailing list

Re: [R] How to change the color of the bar lines of a histogram?

2011-08-18 Thread Paul Smith
That is it, Uwe! Thanks! Paul 2011/8/18 Uwe Ligges lig...@statistik.tu-dortmund.de: Read further on and find border:  hist(rnorm(10), border=yellow) Uwe Ligges On 18.08.2011 13:14, Paul Smith wrote: Dear All, How to change the color of the bar lines of a histogram? I have read

Re: [R] Goodness of fit of binary logistic model

2011-08-06 Thread Paul Smith
immediately see that this model MUST fit the data, so that any evidence for lack of fit has to be misleading. Frank Peter Dalgaard-2 wrote: On Aug 5, 2011, at 23:16 , Paul Smith wrote: Thanks, Frank. The following piece of code generate data, which exhibit the problem I reported

Re: [R] Can glmnet handle models with numeric and categorical data?

2011-08-05 Thread Paul Smith
On Fri, Aug 5, 2011 at 8:45 AM, Martin Maechler maech...@stat.math.ethz.ch wrote: Note the following: As soon as you use categorical predictors, i.e., factors, and particularly when these have many levels (instead of just being binary), the resulting model matrix is often sparse, i.e. contains

[R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
Dear All, I have just estimated this model: --- Logistic Regression Model lrm(formula = Y ~ X16, x = T, y = T) Model Likelihood DiscriminationRank Discrim. Ratio TestIndexes

Re: [R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
On Fri, Aug 5, 2011 at 4:54 PM, David Winsemius dwinsem...@comcast.net wrote: I have just estimated this model: --- Logistic Regression Model lrm(formula = Y ~ X16, x = T, y = T)                    Model Likelihood     Discrimination  

Re: [R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
On Fri, Aug 5, 2011 at 5:35 PM, David Winsemius dwinsem...@comcast.net wrote: I have just estimated this model: --- Logistic Regression Model lrm(formula = Y ~ X16, x = T, y = T)                   Model Likelihood     Discrimination    

Re: [R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
On Fri, Aug 5, 2011 at 7:07 PM, David Winsemius dwinsem...@comcast.net wrote: I have just estimated this model: --- Logistic Regression Model lrm(formula = Y ~ X16, x = T, y = T)                  Model Likelihood     Discrimination    

Re: [R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
Thanks, Frank. The following piece of code generate data, which exhibit the problem I reported: - set.seed(123) intercept = -1.32 beta = 1.36 xtest = rbinom(1000,1,0.5) linpred = intercept + xtest*beta prob = exp(linpred)/(1 + exp(linpred)) runis =

[R] Automatic creation of binary logistic models

2011-08-04 Thread Paul Smith
Dear All, Suppose that you are trying to create a binary logistic model by trying different combinations of predictors. Has R got an automatic way of doing this, i.e., is there some way of automatically generating different tentative models and checking their corresponding AIC value? If so, could

Re: [R] Automatic creation of binary logistic models

2011-08-04 Thread Paul Smith
in the bestglm() package will do the trick. Jeremy On 4 August 2011 12:23, Paul Smith phh...@gmail.com wrote: Dear All, Suppose that you are trying to create a binary logistic model by trying different combinations of predictors. Has R got an automatic way of doing this, i.e., is there some

Re: [R] Automatic creation of binary logistic models

2011-08-04 Thread Paul Smith
On Thu, Aug 4, 2011 at 9:35 PM, Marc Schwartz marc_schwa...@me.com wrote: Suppose that you are trying to create a binary logistic model by trying different combinations of predictors. Has R got an automatic way of doing this, i.e., is there some way of automatically generating different

[R] Can glmnet handle models with numeric and categorical data?

2011-08-04 Thread Paul Smith
Dear All, Can the x matrix in the glmnet() function of glmnet package be a data.frame with numeric columns and factor columns? I am asking this because I have a model with both numeric and categorical predictors, which I would like to study with glmnet. I have already tried to use a data.frame,

Re: [R] Can glmnet handle models with numeric and categorical data?

2011-08-04 Thread Paul Smith
On Fri, Aug 5, 2011 at 12:02 AM, Marc Schwartz marc_schwa...@me.com wrote: Can the x matrix in the glmnet() function of glmnet package be a data.frame with numeric columns and factor columns? I am asking this because I have a model with both numeric and categorical predictors, which I would

Re: [R] Drawing a histogram from a massive dataset

2011-07-19 Thread Paul Smith
On Tue, Jul 19, 2011 at 12:30 AM, Joshua Wiley jwiley.ps...@gmail.com wrote: [snip] I guess that I must have a data frame to plot a histogram. Not at all! ## a *vector* of 100 million observation x - rnorm(10^8) ## a histogram for it (see attached for the result from my system) hist(x)

Re: [R] Drawing a histogram from a massive dataset

2011-07-18 Thread Paul Smith
AM, Paul Smith phh...@gmail.com wrote: Dear All, I have a massive dataset from which I would like to draw a histogram. Any ideas on how to accomplish this? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Drawing a histogram from a massive dataset

2011-07-18 Thread Paul Smith
On Mon, Jul 18, 2011 at 9:11 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: [snip] I guess that I must have a data frame to plot a histogram. Not at all! ## a *vector* of 100 million observation x - rnorm(10^8) ## a histogram for it (see attached for the result from my system) hist(x) No

[R] Drawing a histogram from a massive dataset

2011-07-15 Thread Paul Smith
Dear All, I have a massive dataset from which I would like to draw a histogram. Any ideas on how to accomplish this? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] Plot and curve inside C++

2011-03-06 Thread Paul Smith
Dear All, I would like to use - plot, - curve inside a C++ program. What R package do you recommend? Rcpp? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Nash Equilibrium

2010-12-04 Thread Paul Smith
On Sat, Dec 4, 2010 at 10:09 AM, Christophe Dutang duta...@gmail.com wrote: Months ago, when I wanted to compute Nash equilibria (both standard and generalized), I only found one package that implements the discrete, i.e. when the player payoff is represented by a matrix. Could you please

Re: [R] constrained optimization -which package?

2010-09-28 Thread Paul Smith
On Tue, Sep 28, 2010 at 9:47 PM, Leonardo Monasterio leonardo.monaste...@gmail.com wrote: In the function bellow I  want to find the maximum value of v, subject to the constrain that the sum of x is equal to 1.  I want to maximize: v-t(x)%*%distance%*%x Subject to: sum(x)=1 Where: x is a

Re: [R] Bug on r-bc?

2010-07-27 Thread Paul Smith
On Tue, Jul 27, 2010 at 5:12 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: The following code should return 1, but it returns 0: source(http://r-bc.googlecode.com/svn/trunk/R/bc.R;) bc(9 % 2) See FAQ 2 on the r-bc package home page: http://r-bc.googlecode.com Thanks to all

[R] Bug on r-bc?

2010-07-26 Thread Paul Smith
Dear All, The following code should return 1, but it returns 0: source(http://r-bc.googlecode.com/svn/trunk/R/bc.R;) bc(9 % 2) Do you confirm this bug? Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Bug on r-bc?

2010-07-26 Thread Paul Smith
On Mon, Jul 26, 2010 at 11:42 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: The following code should return 1, but it returns 0: source(http://r-bc.googlecode.com/svn/trunk/R/bc.R;) bc(9 % 2) See FAQ 2 on the r-bc package home page: http://r-bc.googlecode.com Thanks to all

Re: [R] (no subject)

2010-07-24 Thread Paul Smith
2010/7/23 w 霍 hw_joyce...@hotmail.com: I use the constrOptim to maximize a function with four constriants but the answer does not leave from the starting value and there is only one outer iteration. The function is defined as follows: tm-function(p){ p1-p[1]; p2-p[2]; p3-p[3];

Re: [R] minimization function

2010-04-10 Thread Paul Smith
On Sat, Apr 10, 2010 at 4:58 PM, li li hannah@gmail.com wrote:    I am trying to minimize the quardratic form w'Aw, with certain constraints. In particular,    (1) A=(a_{ij}) is n by n matrix and it is symmetric positive definite,        a_{ii}=1 for all i;        and 0a_{ij}1 for i not

Re: [R] minimization function

2010-04-10 Thread Paul Smith
On Sat, Apr 10, 2010 at 5:13 PM, Paul Smith phh...@gmail.com wrote:    I am trying to minimize the quardratic form w'Aw, with certain constraints. In particular,    (1) A=(a_{ij}) is n by n matrix and it is symmetric positive definite,        a_{ii}=1 for all i;        and 0a_{ij}1 for i

Re: [R] Playing with rgl: a Youtube video

2009-12-21 Thread Paul Smith
On Mon, Dec 21, 2009 at 12:42 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: I've just posted a demo made with the rgl package to Youtube, visible here:  http://www.youtube.com/watch?v=prdZWQD7L5c For future reference, here are the steps I used: 1.  Design a shape to be displayed, and then

[R] Boxplot with grouped data

2009-10-22 Thread Paul Smith
Dear All, Is there some way of drawing a boxplot, with R, when one does not have the original continuous data, but only the data grouped in classes? The function boxplot() can only deal with original data. Thanks in advance, Paul __

Re: [R] Boxplot with grouped data

2009-10-22 Thread Paul Smith
On Thu, Oct 22, 2009 at 5:31 PM, Jakson A. Aquino jaksonaqu...@gmail.com wrote: Is there some way of drawing a boxplot, with R, when one does not have the original continuous data, but only the data grouped in classes? The function boxplot() can only deal with original data. Do you mean a

Re: [R] Problem with downloading workspace file from a web address

2009-09-27 Thread Paul Smith
2009/9/27 Uwe Ligges lig...@statistik.tu-dortmund.de: To load a previously saved workspace, one can do the following: load(/path/to/the/saved/workspace/file) However, if the path to the saved workspace file is a web address, one gets the following error: «Error in readChar(con, 5L,

[R] Problem with downloading workspace file from a web address

2009-09-26 Thread Paul Smith
Dear All, To load a previously saved workspace, one can do the following: load(/path/to/the/saved/workspace/file) However, if the path to the saved workspace file is a web address, one gets the following error: «Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection In

Re: [R] Appending strings at the beginning of a text file

2009-08-26 Thread Paul Smith
the writeLines. On Tue, Aug 25, 2009 at 2:48 PM, Paul Smith phh...@gmail.com wrote: Thanks, Henrique. I think you mean the following: fConn - file('test.txt', 'r+') Lines - readLines(fConn) writeLines(c(Text at beginning of file\n, Lines), con = fConn) close(fConn) (With paste(), it does

[R] Appending strings at the beginning of a text file

2009-08-25 Thread Paul Smith
Dear All, I have a piece of text that I want to append to a text file at the beginning of the text file. I have thought about using cat() with the option 'append=T', but the appending, in this case, is done at the bottom of the text file. Any ideas? Thanks in advance, Paul

Re: [R] Appending strings at the beginning of a text file

2009-08-25 Thread Paul Smith
wrote: Try this; fConn - file('test.txt', 'r+') Lines - readLines(fConn) writeLines(paste(Text at beginning of file, Lines, sep = \n),    con = fConn) On Tue, Aug 25, 2009 at 12:54 PM, Paul Smith phh...@gmail.com wrote: Dear All, I have a piece of text that I want to append

Re: [R] Looking for Rdonlp2

2009-06-28 Thread Paul Smith
Thanks, Mario. With a different browser, it works, but not with Firefox 3.5b4. Paul On Sat, Jun 27, 2009 at 7:19 PM, Mario Vallemva...@cscs.ch wrote: Retry, it works for me. Ciao!               mario Paul Smith wrote: Dear All, I tried to download the package Rdonlp2 from the address

[R] Looking for Rdonlp2

2009-06-27 Thread Paul Smith
Dear All, I tried to download the package Rdonlp2 from the address given at CRAN Task View: Optimization and Mathematical Programming: http://arumat.net/Rdonlp2/ However, this link seems to be dead. Any ideas? Thanks in advance, Paul __

Re: [R] Optimization Question

2009-06-12 Thread Paul Smith
On Thu, Jun 11, 2009 at 9:56 PM, Brecknock, Peterpeter.breckn...@bp.com wrote: Apologies if this is not the correct list for this question. The Rglpk package offers the following example in its documentation library(Rglpk) ## Simple mixed integer linear program. ## maximize: 3 x_1 + 1 x_2 +

[R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Dear All, Perhaps, what I am asking is impossible, but I am asking it anyway. I have got several pdf files with rows of colored rectangles: red rectangles should be read as 0; green rectangles as 1. No other color exists. Is there some way to have R reading the colored rectangles to a matrix or

Re: [R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Thanks, Baptiste and Zeljko. I am attaching here an example of the picture of the rectangles. Paul On Tue, May 12, 2009 at 1:23 PM, baptiste auguie ba...@exeter.ac.uk wrote: Depending on the nature of your pdf file, it may be possible to use the grImport package. I've never used it before,

Re: [R] Fwd: From two colors to 01 sequences

2009-05-12 Thread Paul Smith
On Tue, May 12, 2009 at 2:35 PM, Zeljko Vrba zv...@ifi.uio.no wrote: Aha, so you DON'T have only red and green rectangles in the picture, there is also white in between, and some pale delimiter lines.  Nevertheless, both things ease the job slightly, and the approach I described should work.  

[R] Code of the max() function

2009-05-04 Thread Paul Smith
Dear All, Where can one find the code of the max() function? Is that written in C? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Code of the max() function

2009-05-04 Thread Paul Smith
On Mon, May 4, 2009 at 7:47 PM, David Winsemius dwinsem...@comcast.net wrote: Where can one find the code of the max() function? Is that written in C? pages 43-54 of: http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf ... is an article by Uwe Ligges on accesssing source code. Thanks,

Re: [R] is there a way to read a specific column from a txt file

2009-05-03 Thread Paul Smith
On Sun, May 3, 2009 at 6:36 PM, Wensui Liu liuwen...@gmail.com wrote: Sometimes, it is too costly to read the whole data file into R. I am looking for solution in scan() and read.Lines() but don't they work. Try the following (assuming a 3 columns data file): mydata -

Re: [R] reverse truncate to extract only decimal values

2009-04-16 Thread Paul Smith
On Thu, Apr 16, 2009 at 10:30 PM, T.D.Rudolph prairie.pic...@gmail.com wrote: Is there a way of truncating in the opposite direction so as to retain only the values to the right of the decimal?? i.e. rather than: trunc(39.5) [1] 39 i would get something like: revtrunc(39.5) [1] 0.5

Re: [R] nls factor

2009-04-15 Thread Paul Smith
On Wed, Apr 15, 2009 at 1:27 PM, Manuel Gutierrez manuelgutierrezlo...@gmail.com wrote: I want to fit the model y=a*x^b using nls; where a should be different for each level of a factor. What is the easiest way to fit it? Can i do it with nls? I've looked the help pages and the MASS example in

Re: [R] nls factor

2009-04-15 Thread Paul Smith
On Wed, Apr 15, 2009 at 2:33 PM, Paul Smith phh...@gmail.com wrote: On Wed, Apr 15, 2009 at 1:27 PM, Manuel Gutierrez manuelgutierrezlo...@gmail.com wrote: I want to fit the model y=a*x^b using nls; where a should be different for each level of a factor. What is the easiest way to fit it? Can

Re: [R] issue with L-BFGS-B in optim (optim just hangs)

2009-04-15 Thread Paul Smith
On Wed, Apr 15, 2009 at 3:57 PM, Tiago Marques ti...@mcs.st-and.ac.uk wrote: I am using optim, with method=L-BFGS-B, to maximize a likelihood inside a large simulation exercise. This runs fine for most simulated data sets, but for some reason, about 1 out of 100 times, optim will just hang.

Re: [R] Quantative procedure assessing if data is normal

2009-04-13 Thread Paul Smith
On Mon, Apr 13, 2009 at 7:42 AM, Henry Cooper henry.1...@hotmail.co.uk wrote: As part of an R code assingment I have been asked to find a quantitative procedure for assessing whether or not the data are normal? I have previously used the graphical procedure using the qqnorm command. Any

Re: [R] Generating random integers

2009-04-12 Thread Paul Smith
On Sun, Apr 12, 2009 at 1:21 PM, jim holtman jholt...@gmail.com wrote: floor(runif(1000, 1,101))   I need to generate random integer(s) in a range (say that beetween 1 to   100) in R. Another way: sample(1:100,1000,replace=T) Paul __

Re: [R] R interpreter not recognized

2009-04-09 Thread Paul Smith
On Thu, Apr 9, 2009 at 9:01 AM, Maria I. Tchalakova maria.tchalak...@gmail.com wrote: I am trying to install a program based on R, but I am receiving the following error message: r...@darkstar:/home/maria/UCS# perl System/Install.perl Error: Can't run the R interpreter (/usr/local/bin/R).

Re: [R] Code of sample() in C

2009-04-06 Thread Paul Smith
int j = (int)(len * runif(0.0, 1.0));      y[i] = x[j];      x[j] = x[--n];    }    free(x);  }  return 0; } On Sun, 5 Apr 2009 20:11:04 +0100 Paul Smith phh...@gmail.com wrote: Thanks, Ranjan. Got it! I am now wondering whether there is some simpler way of implementing

Re: [R] Code of sample() in C

2009-04-06 Thread Paul Smith
(random.seed, w);        fprintf(fran, %d %d\n, seed1, seed2);        fclose(fran); You will again need to include Rmath.h and declare the standalone parameter in the calling program also. HTH! Best wishes, Ranjan On Mon, 6 Apr 2009 10:41:19 +0100 Paul Smith phh...@gmail.com wrote

[R] Code of sample() in C

2009-04-05 Thread Paul Smith
Dear All, I would like to use the function sample() in a program written in C. Is there somewhere the code of sample() written in C? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Code of sample() in C

2009-04-05 Thread Paul Smith
, Ranjan On Sun, 5 Apr 2009 15:35:25 +0100 Paul Smith phh...@gmail.com wrote: Dear All, I would like to use the function sample() in a program written in C. Is there somewhere the code of sample() written in C? Thanks in advance, Paul __ R

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Paul Smith
SANN. Does your answer change if instead of 100 variables or bins there are 20,000? From the documentation L-BFGS-B is designed for a large number of variables. But maybe SANN can handle this as well. Kevin Paul Smith phh...@gmail.com wrote: Apparently, the convergence is faster

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Paul Smith
On Thu, Apr 2, 2009 at 3:49 PM, rkevinbur...@charter.net wrote: Sorry I sent a description of the function I was trying to minimize but I must not have sent it to this group (and you). Hopefully with this clearer description of my problem you might have some suggestions. It is basically a

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
On Sun, Mar 29, 2009 at 9:45 PM, rkevinbur...@charter.net wrote: I have an optimization question that I was hoping to get some suggestions on how best to go about sovling it. I would think there is probably a package that addresses this problem. This is an ordering optimzation problem.

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
for the suggestions. Kevin Paul Smith phh...@gmail.com wrote: On Sun, Mar 29, 2009 at 9:45 PM,  rkevinbur...@charter.net wrote: I have an optimization question that I was hoping to get some suggestions on how best to go about sovling it. I would think there is probably a package

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
to learn what others propose. Of course, if we don't know anything about the function f then it amounts to an exhaustive search on the 100! permutations -- probably not a feasible job. Regards,  Hans Werner Paul Smith wrote: On Sun, Mar 29, 2009 at 9:45 PM,  rkevinbur...@charter.net wrote: I

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
an appropriate program here such as the free software Bprolog. I would be interested to learn what others propose. Of course, if we don't know anything about the function f then it amounts to an exhaustive search on the 100! permutations -- probably not a feasible job. Regards,  Hans Werner Paul

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
the exact optimal solution, which does not take too long. Paul On Mon, Mar 30, 2009 at 5:11 PM, Paul Smith phh...@gmail.com wrote: Optim with SANN also solves your example: --- f - function(x) sum(c(1:50,50:1)*x) swapfun - function(x,N=100) {  loc

Re: [R] Non-Linear Optimization - Query

2009-03-18 Thread Paul Smith
On Tue, Mar 17, 2009 at 7:55 PM, Berend Hasselman b...@xs4all.nl wrote: You can also try my package nleqslv for solving systems of non linear equations (using Broyden or Newton with a selection of global strategies). library(nleqslv) xinit - rep(1,3)               # or rep(0,3) for a

Re: [R] Non-Linear Optimization - Query

2009-03-18 Thread Paul Smith
On Wed, Mar 18, 2009 at 7:43 PM, Berend Hasselman b...@xs4all.nl wrote: system.time(ans.nl - nleqslv(x=p0, fn=broydt))[1] user.self    8.17 On my Imac 2.16Ghz and R 2.8.1 and Mac OS X 10.5.6 this took approximately 5 seconds. Interesting is this experiment. I set the jacobian for a

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Paul Smith
, how do I construct my system of equations? Thanks again Lars. On Mon, Mar 16, 2009 at 9:54 PM, Paul Smith phh...@gmail.com wrote: On Tue, Mar 17, 2009 at 12:09 AM, Lars Bishop lars...@gmail.com wrote: I couple of weeks ago, I’ve asked for a package recommendation for nonlinear

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Paul Smith
On Tue, Mar 17, 2009 at 7:10 PM, Ravi Varadhan rvarad...@jhmi.edu wrote: Here is how you can implement the Lagrangian multiplier approach and solve the first-order KKT conditions to obtain the solution for Paul Smith's example:        require(BB) f2 - function(x) { f - rep(NA, length(x))

Re: [R] Non-Linear Optimization - Query

2009-03-16 Thread Paul Smith
On Tue, Mar 17, 2009 at 12:09 AM, Lars Bishop lars...@gmail.com wrote: I couple of weeks ago, I’ve asked for a package recommendation for nonlinear optimization. In my problem I have a fairly complicated non-linear objective function subject to one non-linear equality constrain. I’ve been

Re: [R] Sorting rows of a matrix independent of each other

2009-03-13 Thread Paul Smith
On Fri, Mar 13, 2009 at 5:26 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Oh, this seemed so simple (and I'm sure the answer will be, as usual, so thanks in advance for enlightening me). I need to sort each row of a matrix independent of the others. For example,    

Re: [R] R solve equation

2009-02-09 Thread Paul Smith
On Mon, Feb 9, 2009 at 4:46 PM, Giovanni Petris gpet...@uark.edu wrote: As suggested by somebody else, uniroot() can be used to solve equations in one unknown variable. However, you will never get the exact x in R, only an approximate root... Best, Giovanni Date: Sat, 07 Feb 2009 02:20:10

Re: [R] R solve equation

2009-02-08 Thread Paul Smith
On Sat, Feb 7, 2009 at 10:20 AM, oryie 43248...@qq.com wrote: I want to use R to calculate the variable x which is in some eqation, give an example: 3*x-log(x)+1=0, how to solve equation to get the exact x in R? You could use uniroot(), but your equation has no real solution. Paul

Re: [R] Odp: Matrix

2009-02-02 Thread Paul Smith
On Mon, Feb 2, 2009 at 4:05 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi r-help-boun...@r-project.org napsal dne 02.02.2009 16:52:06: Hi, I have a very basic question on merging two matrices by alternating the rows. For illustration, assume two matrices - A looks like: 10 10 10 10

Re: [R] How to draw the graph of f(x,y) = x * y ?

2008-09-24 Thread Paul Smith
On Wed, Sep 24, 2008 at 4:05 AM, Ben Bolker [EMAIL PROTECTED] wrote: The function curve() draws the graph of functions from R to R. Is there some homologous function to curve() to draw functions from R^2 to R? There is a curve3d function in the emdbook package on CRAN. Thanks, Ben and

[R] Bug in persp?

2008-09-24 Thread Paul Smith
Dear All, I am not sure whether the following can be considered a bug: x - seq(-1,1,length=20) y - x z - matrix(1,20,20) persp(x,y,z) Error in persp.default(x, y, z) : invalid 'z' limits It works with: persp(x,y,z,zlim=c(0,1.5)) Should not persp set the z limits by default when the matrix

Re: [R] How to draw the graph of f(x,y) = x * y ?

2008-09-24 Thread Paul Smith
means a 2-D curve will be extruded along the Y dimension. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith Sent: Wednesday, September 24, 2008 06:20 To: [EMAIL PROTECTED] Subject: Re: [R] How to draw the graph of f(x,y) = x * y ? On Wed, Sep

[R] How to draw the graph of f(x,y) = x * y ?

2008-09-23 Thread Paul Smith
Dear All, The function curve() draws the graph of functions from R to R. Is there some homologous function to curve() to draw functions from R^2 to R? Thanks in advance, Paul __ R-help@r-project.org mailing list

Re: [R] How to draw the graph of f(x,y) = x * y ?

2008-09-23 Thread Paul Smith
On Tue, Sep 23, 2008 at 6:32 PM, Duncan Murdoch [EMAIL PROTECTED] wrote: The function curve() draws the graph of functions from R to R. Is there some homologous function to curve() to draw functions from R^2 to R? No, you would have to write it yourself. The basic idea is to use outer() to

Re: [R] new to R

2008-09-06 Thread Paul Smith
On Sat, Sep 6, 2008 at 5:10 AM, sudeshna [EMAIL PROTECTED] wrote: hi im starting with R.have no idea to start...plz help Search the Internet for online tutorials and/or read an introductory book (search for them, e.g., on Amazon.Com). Good luck, Paul

Re: [R] nonlinear constrained optimization

2008-08-20 Thread Paul Smith
On Tue, Aug 19, 2008 at 7:37 PM, Ravi Varadhan [EMAIL PROTECTED] wrote: The Tango project website (from Brazil) has some R functions to implement Algencan. I haven't used it, but I would be interested to hear others' experience if someone has already used it or will be using it. Ravi, The

Re: [R] nonlinear constrained optimization

2008-08-20 Thread Paul Smith
On Tue, Aug 19, 2008 at 8:12 PM, Hans W. Borchers [EMAIL PROTECTED] wrote: Please have a look at the 'Rdonlp2' package at http://arumat.net/Rdonlp2/. It provides non-linear optimization with nonlinear constraints. Notwithstanding, be aware of the following limitation of Donlp2: If the problem

Re: [R] nonlinear constrained optimization

2008-08-19 Thread Paul Smith
On Tue, Aug 19, 2008 at 8:35 AM, Chua Siang Li [EMAIL PROTECTED] wrote: Hi. I need some advises on how to use R to find pi (i is the index) with the following objective function and constraint: max (sum i)[ f(ai, bi, pi) * g(ci, di, pi) * Di ] s.t. (sum i)[ f(ai, bi, pi) * Di *

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread Paul Smith
On Fri, Aug 15, 2008 at 6:15 PM, John Sorkin [EMAIL PROTECTED] wrote: Fedora 9 R 2.7.1 I tried to install R on my Linux system using install.packages(Rcmdr, dependencies=TRUE). I received many, many, many error messages. I hope someone can suggest a fix. The output from warnings() is

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread Paul Smith
Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Paul Smith [EMAIL PROTECTED] 08/15/08 4:02 PM On Fri, Aug 15, 2008 at 6:15 PM, John Sorkin [EMAIL

Re: [R] Accessing individual variables from summary of lm

2008-07-22 Thread Paul Smith
On Tue, Jul 22, 2008 at 5:44 AM, ascentnet [EMAIL PROTECTED] wrote: I am trying to access the R2, intercept, and slope out of the summary from an lm so that I can insert it into a database using RODBC. How can I access these individually? Try: data(swiss) model - lm(Infant.Mortality ~

Re: [R] drawing segments through points with pch=1

2008-07-20 Thread Paul Smith
On Sun, Jul 20, 2008 at 1:44 PM, David Epstein [EMAIL PROTECTED] wrote: Please excuse me for asking such basic questions: Here is my code y=c(1.21,0.51,0.14,1.62,-0.8,0.72,-1.71,0.84,0.02,-0.12) ybar=mean(y) ll=length(y); ybarv=rep(ybar,ll) x=1:ll plot(x,ybarv,pch=1)

Re: [R] asp and ylim

2008-07-20 Thread Paul Smith
On Sun, Jul 20, 2008 at 11:14 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Try lattice: library(lattice) xyplot(y ~ x, ylim = c(0.5, 0.7), aspect = iso) Alternatively, set.seed(42) x - runif(10) y - runif(10) plot(x[(y=0.5) (y=0.7)],y[(y=0.5) (y=0.7)],ylim=c(0.5,0.7),asp=1) Paul

  1   2   >