Displaying 20 results from an estimated 300 matches similar to: "solve the quadratic equation ax^2+bx+c=0"
2005 Nov 17
2
R questions
Dear Sir/Madam,
I am a beginner in R. Here is my questions.
1. Can you give me one test for randomness (a name and descriptive
paragraph is sufficient).
2. I have learned a uniform random number generator [e.g. not the
algorithms: i)Wichmann-Hill, ii) Marsaglia-Multicarry, iii) Super-Duper
(Marsaglia), iv) Mersenne-Twister, v) TAOCP-1997 (Knuth), or vi) TAOCP-2002
(Knuth)] . Is there any other
2012 Mar 26
1
assigning vector or matrix sparsely (for use with mclapply)
Dear R wizards---
I have a wrapper on mclapply() that makes it a little easier for me to
do multiprocessing. (Posting this may make life easier for other
googlers.) I pass a data frame, a vector that tells me what rows
should be recomputed, and the function; and I get back a vector or
matrix of answers.
d <- data.frame( id=1:6, val=11:16 )
loc <- c(TRUE,TRUE,FALSE,TRUE,FALSE,TRUE)
2010 Apr 20
2
QCA3 segfault
Hi
I have just dwonloaded QCA3 onto this machine (ubuntu, karmic, amd64) and a
mac. The examples run fine on teh mac, but crashed R on ubuntu. Any help
much apprecia\ted.
Thanks
Richard
------------------------------------------------------------------------------
Terminal log:
> conditions <-
>
2008 Dec 16
1
refer to next line within a data-frame an select cases
Hi,
I have a problem sorting and selecting entries within a data-frame and
I don't know if it is possible to solve it with R ... (probably yes,
but I have no idea how).
Following Data;
row1 row2
a 12
pos NA
a 3
neg NA
a 5
neg NA
a 11
pos NA
I want to extract the values in row 2 in the lines with an "a" in row1.
But I want to have two vectors: vector x with all
2007 Oct 16
1
underdetermined system
Hi, sorry, I'm an idiot.. and I know I'm missing something stupid..
I thought if we solve an underdetermine system with QR, my soln is:
min ||x|| (L2 sense) such that Ax = b
then say i have:
> w <- matrix(c(1, 5), ncol=2)
> sw = 2
> qrW = qr(t(w) %*% w)
> qr.coef(qrW, t(w) %*% sw)
[,1]
[1,] 2
[2,] NA
but we also have soln (0, 2/5) which obviously has a
2018 Feb 09
1
Optim function returning always initial value for parameter to be optimized
Hello,
I'm trying to fminimize the following problem:
You have a data frame with 2 columns.
data.input= data.frame(state1 = (1:500), state2 = (201:700) )
with data that partially overlap in terms of values.
I want to minimize the assessment error of each state by using this function:
err.th.scalar <- function(threshold, data){
state1 <- data$state1
state2 <- data$state2
2012 Jan 30
2
ode() tries to allocate an absurd amount of memory
Hi there R-helpers:
I'm having problems with the function ode() found in the package deSolve.
It seems that when my state variables are too numerous (>33000 elements),
the function throws the following error:
Error in vode(y, times, func, parms, ...) :
cannot allocate memory block of size 137438953456.0 Gb
In addition: Warning message:
In vode(y, times, func, parms, ...) : NAs
2010 Mar 11
4
help about solving two equations
I have two matrix s1 and s2, each of them is 1000*1.
and I have two equations:
digamma(p)-digamma(p+q)=s1,
digamma(q)-digamma(p+q)=s2,
and I want to sovle these two equations to get the value of x and y, which are also two 1000*1 matrices.
I write a program like this:
f <- function(x) {
p<- x[1]; q <- x[2];
((digamma(p)-digamma(p+q)-s1[2,]) )^2 +((digamma(q)-digamma(p+q)-s2[2,]) )^2
2011 Dec 01
1
ordinal data simulation
Dear all,
I am doing an ordinal data simulation. I?have a question regarding the cut off values between categories. Suppose I have three categories, if I do regression, there should be two cut off values. I find some simulation code for the ordinal data. However, they usually only generate a uniform random number and compare the probability with the random number. Could any one be so kind to
2012 Nov 15
2
Optimizing
Hello,
I am fairly new with R and am having trouble finding an optimal group. I
checked the help functions for the various optimize commands and it was a
little over my head.
I have a dataset with 4 columns, name, type, value, and cost. The set
consists of a list of people, which have 3 types. I want to choose 6
people, two of each type, and maximize the sum of their values. However,
I'm
2016 Apr 07
5
Suddenly increased my hard disk
Hi John,
Am currently running dos mode not graphical mode.
Could you have any other method.
Hi Ashish,
You are correct.
qmailtoaster backup file which was around 184 GB in backup.gz type and i
have removed .bz2 type file with the same backup/mailbkup directory.
After removed .bz2 file it's gone backup.gz also which was 184 GB file.
I have run this command locate .gz but couldn't find out
2006 Jan 11
1
can remote_function update two div simultaneously?
hi all
i m using remote_function , & i need to update two divs at same time (so no :success/:failure)....
is there any posiible soln for this
thanks
rohit
---------------------------------
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2009 Jun 19
2
Manipulate solution of simplex
Hi,
I need some help. I'm doing a project that demands me to obtain several
simplex solutions and I would like to can keep the solution in a vector or
something to be able to use it after I get it.
The comand simplex() prints the solution but how can I keep it?
Another alternative would be to export it to excel, how can I do this?
I just see the solution and have to note it on a paper or
2010 Jul 27
2
lattice: option to sort x when type = l
Hi,
(please Cc me)
In xyplot (), type = "l" (or one that includes "l", *el*) is
(generally) meaningful only when the 'x' variable is sorted. In
practice, one either sorts the data frame before hand or writes a tiny
panel function which sorts the supplied x and then calls the default
panel.xyplot(). Trouble arises when there is a conditional variable as
well as a
2010 Dec 15
5
Solution to differential equation
Hello,
I am trying to find the analytical solution to this differential equation
dR/dt = k1*(R^k2)*(1-(R/Rmax)); R(0) = Ro
k1 and k2 are parameters that need to fitted, while Ro and Rmax are the
baseline and max value (which can be fitted or fixed). The response (R)
increases
initially at an exponential rate governed by the rate constants k1 and k2.
Response has a S-shaped curve as a function
2005 Nov 19
5
help with apply, please
Dear list,
I have a problem with a toy example:
mtrx <- matrix(c(1,1,0,1,1,1,0,1,1,0,0,1), nrow=3)
rownames(ma) <- letters[1:3]
I would like to determine which is the minimum combination of rows that
"covers" all columns with at least a 1.
None of the rows covers all columns; all three rows clearly covers all
columns, but there are simpler combinations (1st and the 3rd, or 2nd
2010 Sep 24
3
boundary check
Dear R,
I have a covariates matrix with 10 observations, e.g.
> X <- matrix(rnorm(50), 10, 5)
> X
[,1] [,2] [,3] [,4] [,5]
[1,] 0.24857135 0.30880745 -1.44118657 1.10229027 1.0526010
[2,] 1.24316806 0.36275370 -0.40096866 -0.24387888 -1.5324384
[3,] -0.33504014 0.42996246 0.03902479 -0.84778875 -2.4754644
[4,] 0.06710229 1.01950917
2006 Jan 10
1
eigen()
Hi
I am having difficulty with eigen() on R-devel_2006-01-05.tar.gz
Specifically, in R-2.2.0 I get expected behaviour:
> eigen(matrix(1:100,10,10),FALSE,TRUE)$values
[1] 5.208398e+02+0.000000e+00i -1.583980e+01+0.000000e+00i
[3] -4.805412e-15+0.000000e+00i 1.347691e-15+4.487511e-15i
[5] 1.347691e-15-4.487511e-15i -4.269863e-16+0.000000e+00i
[7] 1.364748e-16+0.000000e+00i
2010 Nov 20
10
An empty grey diagram
Hi folks,
Win7 64bit
R 1.12.0
I run following command on R:-
> ToothGrowth
> attach(ToothGrowth)
> plot(dose,len)
> matrics=lm(len~dose)
> abline(metrics)
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
plot.new has not been called yet
Only a grey diagram is displayed without content
> plot(abline(metrics))
Error in int_abline(a = a, b = b, h = h, v
2019 May 03
2
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
On 03/05/2019 10:31, Serguei Sokol wrote:
> On 02/05/2019 21:35, Florian Gerber wrote:
>> Dear all,
>>
>> when using optim() for a function that uses the parent environment, I
>> see the following unexpected behavior:
>>
>> makeFn <- function(){
>> ???? xx <- ret <- NA
>> ???? fn <- function(x){
>> ??????? if(!is.na(xx)