I'm following this thread and got curious about Ryacas. After installing yacas and Ryacas, I was alerted to the missing XML package for Windows. I couldn't find in on a couple of mirrors so I tried http://www.omegahat.org/RSXML/ and
install.packages("XML", repos = "http://www.omegahat.org/R") but got Installing package(s) into 'D:/Users/David Stevens/Documents/R/win-library/2.14' (as 'lib' is unspecified) Warning message: In getDependencies(pkgs, dependencies, available, lib) : package 'XML' is not available (for R version 2.14.1) for my troubles. The date on the omegahat site is 17 Jan 2012. Am I missing something? David Stevens On 1/22/2012 12:39 PM, Gabor Grothendieck wrote: > On Sun, Jan 22, 2012 at 1:25 PM, Eliano<eliano.m.marq...@gmail.com> wrote: >> People, >> >> I'm researching some Bayesian statistic topics and in the midle of my study >> i found a very simple problem and i'm trying to find a simple package to >> solve this type of equations: >> >> Lets say that i need to compute beta values for the beta distribution and i >> now for example: >> >> E(teta)=a/(a+b) = 0,5 >> Var(teta)=ab/((a+b)^2(a+b+1))=0.05 >> >> So if i want to solve this to non-linear system to find a,b for the beta >> distribution wich pack should i use? >> > The equations giving a and b as a function of m and v are: > >> library(Ryacas) >> a<- Sym("a"); b<- Sym("b") >> m<- Sym("m"); v<- Sym("v") >> Solve( List(a/(a+b) == m, a*b/((a+b)^2*(a+b+1)) == v), List(a, b) ) > expression(list(list(a == m^2 * (1 - m)/v - m, b == a/m - a))) > > Based on the above we write this R function: > > beta.parms<- function(m, v) { > a<- m^2 * (1-m)/v - m > b<- a/m - a > c(a = a, b = b) > } > > and run it: > >> beta.parms(m = 0.5, v = 0.05) > a b > 2 2 > -- David K Stevens, P.E., Ph.D., Professor Civil and Environmental Engineering Utah Water Research Laboratory 8200 Old Main Hill Logan, UT 84322-8200 435 797 3229 - voice 435 797 1363 - fax david.stev...@usu.edu [[alternative HTML version deleted]] ______________________________________________ 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.