similar to: How can I solve this function in R?

Displaying 20 results from an estimated 10000 matches similar to: "How can I solve this function in R?"

2008 Jul 19
2
How to solve systems of nonlinear equations in R?
Hey, I was wondering if there existed a R function similar to 'fsolve' or 'fzero' Matlab functions? Thanks! Francois Aucoin [[alternative HTML version deleted]]
2008 Apr 07
1
How to include a vignette with my package?
I want to include a vignette with a package I wrote. I did follow the "Writting R extentions" document step by step, but went I run "Rcmd build", an error occurs. It goes like this: " * creating vignettes ... ERROR . . . . :7: Emergency stop L7L ==> Fatal error occurred, no output PDF file produced!texify: pdflatex failed for some reason <see log file>.
2008 Jun 04
1
Minimizing the negative log likelihood function...
Hey, The following is a function I wrote which generates random variables from a Kappa (2-parameter) distribution. rkappa <- function(n,beta,alpha){ if(alpha <= 0) stop("alpha must be greater than zero!") if(beta <= 0) stop("beta must be greater than zero!") Vec <- beta*exp((1/alpha)*(log(-(alpha/(-1 + exp(alpha*log(runif(n,0,1))))))+
2006 Mar 20
2
Special characters: plus/minus - a method that works
Dear R-people: François Michonneau's method to obtain the special character plus/minus works on Windows 2000 professional. Many Thanks to François for his work! Phil Smith Centers for Disease Control and Prevention Atlanta, GA _____ From: François MICHONNEAU [mailto:francois.michonneau@gmail.com] Sent: Monday, March 20, 2006 1:58 PM To: r-help@stat.math.ethz.ch; Smith, Phil
2007 Nov 30
2
finding roots (Max Like Est)
I have this maximum liklihood estimate problem i need to find the roots of the following: [sum (from i=1 to n) ] ((2(x[i]-parameter)/(1+(x[i]-parameter)^2))=0 given to me is the x vector which has length 100 how would I find the roots using R? I have 2 thoughts...... 1 is using a grid search ... eg. brute force, just choosing a whole bunch of different values for my parameter .... such as
2007 Apr 25
4
How to solve difficult equations?
This below is not solvable with uniroot to find "a": fn=function(a){ b=(0.7/a)-a (1/(a+b+1))-0.0025 } uniroot(fn,c(-500,500)) gives "Error in uniroot(fn, c(-500, 500)) : f() values at end points not of opposite sign" I read R-help posts and someone wrote a function: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/92407.html but it is not very precise. Is there any
2005 Sep 14
4
How to drag/drop visitable anchors ?
Hi ! I have the following: <li id="photo_<%= @photo.id %>" class="photo"> <%= link_to(image_tag(url_for_file_column(:photo, :picture)), {:action => ''photo'', :id => @photo}, {:title => @photo.description}) %> </li> <script type="text/javascript" language="JavaScript"><!--
2008 Dec 31
1
uniroot() problem
I have a strange problem with uniroot() function. Here is the result : > uniroot(th, c(-20, 20)) $root [1] 4.216521e-05 $f.root [1] 16.66423 $iter [1] 27 $estim.prec [1] 6.103516e-05 Pls forgive for not reproducing whole code, here my question is how "f.root" can be 16.66423? As it is finding root of a function, it must be near Zero. Am I missing something? -- View this message
2004 Oct 21
2
an introduction to R in french
Hello wizaRds ! I am looking for a french and recent version of "An introduction to R". Does anybody know where i could find on of these. Thanks. -- Romain Fran??ois 25, avenue Guy Moquet 94 400 Vitry sur seine FRANCE _______________________ _______________________ francoisromain at free.fr 01 46 80 65 60 06 18 39 14 69
2013 Jan 13
2
Regarding the recent changes to @<-
Hello all, In one of the packages (phylobase) I'm contributing to, we define a class as follows: setClass("phylo4", representation(edge = "matrix", edge.length = "numeric", label = "character", edge.label = "character", order =
2007 Jun 19
1
Iterative Solver [Converting Matlab's solve()]
I can't for the life of me figure out how to get the roots for this simple (but sovable only iteratively) equation in R: x = z*(1-(1-2/z)^y where x and y are known, and z is unknown. In Matlab, this amounts to: [my.solution] = solve('x = z*(1-(1-2/z)^y') my.solution.real = solution(y-1,y) % bottom line displays non-imaginary solution (last element) Obviously, I'm deeply
2012 Jul 23
2
Solving equations in R
Hi there, I would like to solve the following equation in R to estimate 'a'. I have the amp, d, x and y. amp*y^2 = 2*a*(1-a)*(-a*d+(1-a)*x)^2 test data: amp = 0.2370 y= 0.0233 d= 0.002 x= 0.091 Can anyone suggest how I can set this up? Thanks, Diviya [[alternative HTML version deleted]]
2005 Sep 22
6
Autocomplete - setting a second value?
I''m using the autocomplete function, and need a way to grab a second value from the ajax request... an example would probably speak better: This is my HTML: <input name="CustomerName" id="CustomerName" type="text" /> <div id="CustomerList"></div> <input name="CustomerID" id="CustomerID"
2012 Jul 26
3
Solving quadratic equation in R
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? Thanks in advance, Diviya [[alternative HTML version deleted]]
2011 Sep 03
3
question with uniroot function
Dear all, I have the following problem with the uniroot function. I want to find roots for the fucntion "Fp2" which is defined as below. Fz <- function(z){0.8*pnorm(z)+p1*pnorm(z-u1)+(0.2-p1)*pnorm(z-u2)} Fp <- function(t){(1-Fz(abs(qnorm(1-(t/2)))))+(Fz(-abs(qnorm(1-(t/2)))))} Fp2 <- function(t) {Fp(t)-0.8*t/alpha} th <- uniroot(Fp2, lower =0, upper =1,
2009 Jan 11
4
How to get solution of following polynomial?
Hi, I want find all roots for the following polynomial : a <- c(-0.07, 0.17); b <- c(1, -4); cc <- matrix(c(0.24, 0.00, -0.08, -0.31), 2); d <- matrix(c(0, 0, -0.13, -0.37), 2); e <- matrix(c(0.2, 0, -0.06, -0.34), 2) A1 <- diag(2) + a %*% t(b) + cc; A2 <- -cc + d; A3 <- -d + e; A4 <- -e fn <- function(z) { y <- diag(2) - A1*z - A2*z^2 - A3*z^3 - A4*z^4
2007 Jan 31
2
what is the purpose of an error message in uniroot?
Hi all, This is probably a blindingly obvious question: Why does it matter in the uniroot function whether the f() values at the end points that you supply are of the same sign? For example: f <- function(x,y) {y-x^2+1} #this gives a warning uniroot(f,interval=c(-5,5),y=0) Error in uniroot(f, interval=c(-5, 5), y = 0) : f() values at end points not of opposite sign #this doesn't give a
2010 May 21
3
CANCEL Reason
Hello all, I need that Asterisk Always use Reason in a CANCEL. How to do? thank you *Fran?ois * -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100521/f3a91f36/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: francois.vcf Type: text/x-vcard Size: 400
2007 Apr 03
5
Inifinite loop problem with DRb server
Hi all, We''re attempting to use Ferret with the DRb server at the moment, and it doesn''t work, at all... = Executive Summary The DRb server process keeps on calling the remote index to the DRb server process... Which means DRb is calling itself, and itself, and itself, until Ruby kills the Thread with a SystemStackLevel error. = The excruciating details... # Mongrel is
2010 Aug 12
2
Derivative
How would I numerically find the x value where the derivative of the function below is zero? x <- seq(1,2, by = .01) y <- 5*cos(2*x)-2*x*sin(2*x) plot(x,abs(y), type = "l", ylab = "|y|")