Displaying 20 results from an estimated 4000 matches similar to: "function to solve equations"
2009 Jul 23
1
Non-negative solutions to complicated equations
Hi all,
I have a system of 3 equations with many defined parameters and 3 variables
I need to find solutions to. I actually know the solutions I'm aiming for
(0.07,0.287,0.0061) but R tends to give me (0,0,0).
I tried the "BB" package but don't really follow how to refine my solutions
from that; these are wrong so far. Here's my code from trying that:
> f<-function(x){
2009 Jul 17
6
Solving two nonlinear equations with two knowns
Dear R users,
I have two nonlinear equations, f1(x1,x2)=0 and f2(x1,x2)=0. I try to use optim command by minimize f1^2+f2^2 to find x1 and x2. I found the optimal solution changes when I change initial values. How to solve this?
BTW, I also try to use grid searching. But I have no information on ranges of x1 and x2, respectively.
Any suggestion to solve this question?
Thanks,
Kate
2009 Oct 15
4
Generating a stochastic matrix with a specified second dominant eigenvalue
Hi,
Given a positive integer N, and a real number \lambda such that 0 < \lambda
< 1, I would like to generate an N by N stochastic matrix (a matrix with
all the rows summing to 1), such that it has the second largest eigenvalue
equal to \lambda (Note: the dominant eigenvalue of a stochastic matrix is
1).
I don't care what the other eigenvalues are. The second eigenvalue is
2009 Jul 02
2
constrained optimisation in R.
i want to estimate parameters with maximum likelihood method with contraints (contant numbers).
for example
sum(Ai)=0 and sum(Bi)=0
i have done it without the constraints but i realised that i have to use the contraints.
Without constraints(just a part-not complete):
skellamreg_LL=function(parameters,z,design)
{
n=length(z);
mu=parameters[1];
H=parameters[2];
Apar=parameters[3:10];
2009 Jul 28
1
different names for new files in a for loop
Hi,
I have an excel file with 10 columns and I am trying to create new excel files each with columns 1, 2, and columns 3-10.
Does anyone know how to change the name of the file in a for loop so that the first new file will have columns 1, 2, 3 with a name and then the next file will have columns 1, 2, 4 with a different name and so on till i get to the 8th new file with columns 1, 2, 10?
Thank
2010 Jun 03
3
General-purpose GPU computing in statistics (using R)
Hi All,
I have been reading about general purpose GPU (graphical processing units)
computing for computational statistics. I know very little about this, but
I read that GPUs currently cannot handle double-precision floating points
and also that they are not necessarily IEEE compliant. However, I am not
sure what the practical impact of this limitation is likely to be on
computational
2009 Nov 03
1
Passing Command to Optim in factanal
Hi,
I am currently trying to execute the following command:
f<-factanal(factors=k$Components$nparallel,covmat=m,n.obs=2287,rotation="varimax",control=list(opt=list(method=c("BFGS"))))
but keep getting the error: L-BFGS-B needs finite values of 'fn'
I can't figure out what I am doing wrong here, why isn't optim being told to use BFGS instead of L-BFGS-B...
2009 May 26
1
optim() question
I've seen with other software the capability for the optimizer to switch
algorithms if it is not making progress between iterations. Is this
capability available in optim()?
Thanks,
Stephen Collins, MPP | Analyst
Health & Benefits | Aon Consulting
[[alternative HTML version deleted]]
2009 Jul 20
2
EM Clustering
Hi all,
could someone send me examples of the EM Clustering algorithm and/or
some pdf describing it?
Thanks,
Douglas Sousa.
2009 Oct 07
1
sinusoidal relationship
Hi,
Suppose x and y are vectors whose elements are known. I know that there is a sinusoidal relation between them. In other words,
y=a*sin(bx) where b is probably a function of pi.
How do I find a and b in R?
Hakan
[[alternative HTML version deleted]]
2009 Oct 07
1
Simulate negative skewed, fat-tailed distribution
Hi guys
Is there a way in R to simulate/generate random numbers from a negative
skewed and fat
tailed distribution ? I would like to simulate a set of (discrete) data.
Regards,
Carlos
Carlos http://www.nabble.com/file/p25783889/graph.png graph.png
--
View this message in context: http://www.nabble.com/Simulate-negative-skewed%2C-fat-tailed-distribution-tp25783889p25783889.html
Sent from the
2009 Nov 03
1
multivariate numerical integration.
I am currently using the package 'adapt' for multivariate integration.
However this package seems to be removed from CRAN (It is still referred to
in the help file for integrate(stats) though).
I assume it has been deprecated for a reason? Is there an alternative for
multivariate numerical integration?
-----
Jeroen Ooms * Dept. of Methodology and Statistics * Utrecht University
Visit
2009 Dec 16
1
regularised incomplete beta function
Dear:
I am trying to work out the regularised incomplete beta function in R. I searched google
on this and found UCS library. But I can not find this in R packages. Does anyone have use
this before or how to insert UCS in R?
Many Thanks!
Xin
Xin
-------
Dr.Xin Shi
Senior Lecturer in Statistics
Manchester Metropolitan University Business School
Aytoun Building
Aytoun Street
Manchester
M1
2009 May 26
2
Linear Regression with Constraints
Hi!
I am a bit new to R.
I am looking for the right function to use for a multiple regression problem
of the form:
y = c1 + x1 + (c2 * x2) - (c3 * x3)
Where c1, c2, and c3 are the desired regression coefficients that are
subject to the following constraints:
0.0 < c2 < 1.0, and
0.0 < c3 < 1.0
y, x1, x2, and x3 are observed data.
I have a total of 6 rows of data in a data set.
Is
2010 Feb 23
2
significance of coefficients in Constrained regression
I am fittting a linner regression with constrained parameters, saying, all
parameters are non-negative and sum up to 1.
I have searched historical R-help and found that this can be done by
solve.QP from the quadprog package. I need to assess the significance of the
coefficient estimates, but there is no standard error of the coefficient
estimates in the output. So I can not compute the p-value.
2009 Jul 02
1
lokern package
Dear Martin,
I have been playing a lot with the glkerns() function in the "lokern"
package for "automatic" smoothing of time-series data. This kernel
smoothing approach of Gasser and Mueller seems to perform quite well for
estimating the function and its derivatives (first and second derivatives).
In fact, this is one of the best methods based on my simulation studies for
2009 Dec 01
1
eigenvalues of complex matrices
Dear all,
I want to compute the eigenvalues of a complex matrix for some statistics.
Comparing it to its matlab/octave sibling, I don't get the same eigenvalues
in R computing it from the exact same matrix.
In R, I used eigen() and arpack() that give different eigenvalues. In
matlab/octave I used eig() and eigs() that give out the same eigenvalues but
different to the R ones.
For real
2009 Nov 18
2
Error "system is computationally singular" by using function dmvnorm
Dear R users,
i try to use function dmvnorm(x, mean, sigma, log=FALSE)
from R package mvtnorm to calculate the probability of x
under the multivariate normal distribution with mean equal
to mean and covariance matrix sigma.
I become the following
Error in solve.default(cov, ...) :
system is computationally singular: reciprocal condition
number = 1.81093e-19
What could be the reason of it?
2009 Jun 17
3
Matrix inversion-different answers from LAPACK and LINPACK
Hello.
I am trying to invert a matrix, and I am finding that I can get different
answers depending on whether I set LAPACK true or false using "qr". I had
understood that LAPACK is, in general more robust and faster than LINPACK,
so I am confused as to why I am getting what seems to be invalid answers.
The matrix is ostensibly the Hessian for a function I am optimizing. I want
to get
2009 Nov 02
2
a prolem with constrOptim
Hi,
I apologize for the long message but the problem I encountered can't be stated in a few lines.
I am having some problems with the function constrOptim. My goal is to maximize the likelihood of product of K multinomials, each with four catagories under linear constraints on the parameter values. I have found that the function does not work for many data configurations.
#The likelihood