Re: [R] Solver in R

2010-09-11 Thread Carl Witthoft


Use BBsolve in the BB  package.  It'll do darn near anything.

Carl

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Solver in R

2010-09-11 Thread Berend Hasselman


You can also have a look at and try package nleqslv.

Berend
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Solver-in-R-tp2535115p2535813.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Solver in R

2010-09-11 Thread Berend Hasselman


Another idea.
From your formulation it seems that r does not depend on t and Xt so you
wouldn't need a solver.
You could solve for r explicitly so

r - R0/sum(Xt)

/Berend
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Solver-in-R-tp2535115p2535815.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Solver in R

2010-09-10 Thread David Winsemius


On Sep 10, 2010, at 5:35 PM, Chien-Pang Chin wrote:


Hi all:



I'm looking for a package that similar to solver in MS. All I need  
is find a

r to satisfy R0=sum( , where t are from 1 to n and Xt are come from
another formula.

The most package I found were to max or min the obj. function. Is  
there any

package can do it?


If you minimize R0 - sum(r * Xt ), you should get your answer.

--
David.


Thanks.

 Peter



David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Solver in R

2010-09-10 Thread David Winsemius


On Sep 10, 2010, at 5:44 PM, David Winsemius wrote:



On Sep 10, 2010, at 5:35 PM, Chien-Pang Chin wrote:


Hi all:



I'm looking for a package that similar to solver in MS. All I need  
is find a

r to satisfy R0=sum( , where t are from 1 to n and Xt are come from
another formula.

The most package I found were to max or min the obj. function. Is  
there any

package can do it?


If you minimize , you should get your answer.


Ooops, sorry. Make that:

abs( R0 - sum(r * Xt ) )  # or

( R0 - sum(r * Xt ) )^2




--
David.


Thanks.

Peter



David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] solver in R

2008-03-31 Thread Richard Rowe
library(MASS) check out fitdistr( )  ... ?fitdistr
This isn't 'solver', but then again R isn't MS Excel!

Roslina Zakaria wrote:
 Dear R-users,
 Is there any function in R that works similarly like solver in Excel.  I have 
 a set of daily rainfall data and I would like to estimate alpha and beta for 
 the gamma function.

 Here is my daily rainfall data:
 [1]  0.2  1.2  0.0  0.0  0.0  0.0  0.0  0.6  0.0  0.0  0.0  0.0  0.0  0.0  
 0.0  0.0  4.8  1.6  0.0  1.8  1.8  0.0  2.6
  [24] 33.0 19.0  0.0  0.0  0.6  0.0  0.0  6.8  0.2  0.0  0.0  0.0  0.0  0.2  
 0.0  0.0  0.0  0.0  0.0  0.0  1.6  5.4  0.0
  [47]  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.2  0.0  0.0  6.0  6.6  
 0.0  0.0  0.0  0.0  0.2  0.0  0.0  0.0  0.0
  [70]  0.0  0.0  0.0  0.0  0.0  0.0  0.0 12.8  0.0  0.0  0.0  0.0  0.0  0.0  
 0.2  0.0  3.8  2.2  1.2 12.2  3.0  0.0  0.0
  [93]  0.0  0.0  5.0  3.6  0.0  0.0  0.0  1.8  1.8  1.2  1.2  1.6  3.6  0.2  
 0.8  0.0  0.0  0.0  0.0  0.0  1.4 16.6  0.0
 [116]  1.6  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  
 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.8  5.4
 [139]  1.6  5.8  0.4 34.2  0.0  0.4  0.4  1.4  1.8  0.0  0.0  0.2  0.0  2.4 
 24.2  0.4  0.0  0.0  0.0  1.6  0.0  0.0  0.0
 [162]  0.0  0.2  0.0  0.0  0.0  4.4  0.0  4.4 21.2  3.0  0.4  0.0  0.0  0.0  
 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0
 [185]  0.0  0.8  0.8  3.6  0.0  1.2  0.0  0.0  0.0  0.0  0.0  0.0 13.8  1.6  
 6.6  5.0  0.0  1.2  0.0  1.0  1.2  2.4  6.0
 [208]  2.8  7.0  0.2  0.6  0.0  0.0  0.0  0.0  0.0  3.2  0.2  2.4  0.0  0.0  
 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  2.0
 [231]  0.0  0.0  0.0  0.0  0.0  0.0  0.0  1.2  6.6  2.4  1.0  0.0  0.0  0.0  
 0.0  0.0  0.0  0.0  0.0  1.6  0.0  0.0  0.0
 [254]  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.4  2.6  0.0  0.6  
 4.8  0.0  0.2  3.8 17.0  0.2  0.0  0.0  0.0
 [277] 43.6  2.6  0.0  0.0  0.0  0.4  8.2 14.4  0.2  0.0  0.0  0.0  1.8  0.0  
 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  1.2
 [300]  0.0

 Thank you in advance for your help.


   
 
 Looking for last minute shopping deals?

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

   


-- 
Dr Richard Rowe
Zoology  Tropical Ecology
School of Marine  Tropical Biology
James Cook University
Townsville 4811
AUSTRALIA

ph +61 7 47 81 4851
fax +61 7 47 25 1570
JCU has CRICOS Provider Code 00117J

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.