Displaying 20 results from an estimated 500 matches similar to: "Seemingly simple "lm" giving unexpected results"
2009 Jun 25
2
Error: system is computationally singular: reciprocal condition number
I get this error while computing partial correlation.
*Error in solve.default(Szz) :
system is computationally singular: reciprocal condition number =
4.90109e-18*
Why is it?Can anyone give me some idea ,how do i get rid it it?
This is the function i use for calculating partial correlation.
pcor.mat <- function(x,y,z,method="p",na.rm=T){
x <- c(x)
y <- c(y)
2005 Aug 12
3
General expression of a unitary matrix
Hi, all,
Does anybody got the most general expression of a unitary matrix?
I found one in the book, four entries of the matrix are:
(cos\theta) exp(j\alpha); -(sin\theta)exp(j(\alpha-\Omega));
(sin\theta)exp(j(\beta+\Omega)); (cos\theta) exp(j\beta);
where "j" is for complex.
However, since for any two unitary matrices, their product should also
be a unitary matrix. When I
2004 Mar 19
3
Incomplete Gamma Functions and GammaDistribution Doc errata.
Hello all,
In the course of trying to implement the CDF of an
InverseGammaDistribution, I have run across the need for an igamma()
function. Several others have needed this function but the answers I
have found so far are not totally clear to me. I'm writing for three
reasons:
1) to present a small error in the docs
2) to clarify the approach we are expected to take
3) to request,for the
2006 Jun 26
2
Inverse Error Function
Do any of the R libraries have an implementation of the Inverse Error
Function (Inverse ERF)?
ref:
http://mathworld.wolfram.com/InverseErf.html
http://functions.wolfram.com/GammaBetaErf/InverseErf/
Thanks,
Nathan
[[alternative HTML version deleted]]
2011 Nov 01
2
drawing ellipses in R
Hello,
I have been following the thread dated Monday, October 9, 2006 when Kamila Naxerova asked a question about plotting elliptical shapes. Can you explain the equations for X and Y. I believe they used the parametric form of x and y (x=r cos(theta), y=r sin(theta). I don't know what r is here ? Can you explain 1)the origin of these equations and 2) what is r?
Sincerely,
Mary A. Marion
2011 Apr 28
5
fisher exact for > 2x2 table
I'm using fisher.exact on a 4x2 table and it seems to work.
Does anyone know exactly what is going on? I thought fisher.exact is only
for 2x2 tables.
Note: I can't use chi-squared because I have a couple of cells with 0 and <
5 observations.
--
View this message in context: http://r.789695.n4.nabble.com/fisher-exact-for-2x2-table-tp3481979p3481979.html
Sent from the R help
2010 Jan 05
4
solving cubic/quartic equations non-iteratively
To R-helpers,
R offers the polyroot function for solving mentioned equations
iteratively.
However, Dr Math and Mathworld (and other places) show in detail how to
solve mentioned equations non-iteratively.
Do implementations for R that are non-iterative and that solve mentioned
equations exists?
Regards, Mads Jeppe
2006 Jun 15
2
Standard Deviation Distribution
I'm having trouble with the standard deviation distribution
as shown on http://mathworld.wolfram.com/StandardDeviationDistribution.html .
(Eric Weisstein references Kenney and Keeping 1951, which I can't check.)
I believe the graphs they show, but when I code the function in R, according to the listed formula,
I get very different graphs.
Would someone please point out my error or tell
2005 Apr 21
0
colldiag
Hello,
could anyone explain what am I doing wrong. When I use colldiag function from package perturb I get different Variance Decomposition Proportions matrix in R than in SAS, although the eigenvalues and indexes are the same.
Thanks for your attention.
Results:
in R:
eigen(cor(indep2))
$values
[1] 4.197131e+00 6.674837e-01 9.462858e-02 4.070314e-02 5.323022e-05
colldiag(indep2,c=T)
2004 Jun 16
2
erf function documentation
Hi all. I may be wrong, (and often am), but in trying
to determine how to calculate the erf function, the
documentation for 'pnorm' states:
## if you want the so-called 'error function'
erf <- function(x) 2 * pnorm(x * sqrt(2)) - 1
## and the so-called 'complementary error function'
erfc <- function(x) 2 * pnorm(x * sqrt(2),
lower=FALSE)
Should, instead, it read:
2011 Feb 11
2
fitdistr question
Hello,
I tried to fit a poisson distribution but looking at the function
fitdistr() it does not optimize lambda but simply estimates the mean
of the data and returns it as lambda. I'm a bit confused because I was
expecting an optimization of this parameter to gain a good fit...
If I would use mle() of stats4 package or mle2() of bbmle package, I
would have to write the function by myself
2002 Dec 11
3
Modified Bessel Function - 2nd kind
In order to fit a probability distribution proposed by Sichel [Journal of
the Royal Statistical Society. Series A (General), Vol. 137,
No. 1. (1974), pp. 25-34], I need a modified Bessel function of the 2nd
kind. I notice that the base package of "R" only has modified Bessel
functions of the 1st and 3rd kind. Does a modified Bessel function of the
2nd kind exist anywhere?
Many
2005 Jun 23
2
solving equation system
Hello,
I want to solve some two dimensional equation system with R. Some systems
are not solvable analytically.
Here is an example:
(I) 1/n*sum{from_i=1_to_n}(Xi) = ln lambda + digamma(c)
(II) mean(X) = x / lambda
I want to find lambda and c,
which R-function could do that task?
Carsten
[[alternative HTML version deleted]]
2008 Oct 09
4
runs of heads when flipping a coin
Can someone recommend a method to answer the following type of question:
Suppose I have a coin with a probability hhh of coming up heads (and 1-hhh
of coming up tails)
I plan on flipping the coin nnn times (for example, nnn = 500)
What is the expected probability or frequency of a run of rrr heads* during
the nnn=500 coin flips?
Moreover, I would probably (excuse the pun) want the answer for a
2005 Mar 30
6
French Curve
Dear R experts,
Did someone implemented French Curve yet? Or can anyone point me some
papers that I can follow to implement it?
thanks in advance for your help.
Paul
2007 Jun 11
1
Gini coefficient in R
If I use the Ineq library and the Gini function in this way:
>Gini(c(100,0,0,0))
I obtain the result 0.75 instead of 1 (that is the perfect inequality).
I think Gini's formula in Ineq is based on a formula as reported here:
http://mathworld.wolfram.com/GiniCoefficient.html
but in the case of perfect inequality:
x_1=.......=x_n-1 =0
x_n>0
these formula are equal to 1 - 1/n, not to
2005 Mar 02
1
power law distribution; making new distributions
hi
i have data which i think is coming from a power law
distribution P(X > a) = c/a^k and i would like to find
the exponent and constant. i would like it to use my
experimental data to find c and k.
also, if i would like to create a new distribution, is
it easy to add to R, if so, how is that done?
thanks
-gong
__________________________________
2006 Jun 05
1
negative binomial: expected number of events?
Hi
I'm fitting poisson and negative binomial distributions to event data. I'm
interested in the expected number of events occuring in a time period. For
the poisson this is determined by the parameter lambda only.
For the neg. binomial, is the expected number of events determined by the
parameter "mu" only or does parameter "size" influence the first moment as
2009 Jul 24
2
computing the radius of an arc
Hi!!
I am interesting in computing the radius of an arc that best approximates a curve. Is there an R function that I can use to draw an arc?
Nothing useful came up when I searched help.search. Does anyone have any suggestion to do this?
Thanks ../Murli
2009 Dec 08
1
Modula Generators
Hi all,
Is there function on R for calculating Modula generators? For example for primes above 100, e.g 157, i want to know which number generates the group under multiplication mod 157. i.e i want to find an element whose order is 156. The problem I occur is that modular arithmetic becomes inaccurate when dealing with large numbers.
Thanks for any help given.
Sam
[[alternative HTML