similar to: How to solve a non-linear system of equations using R

Displaying 20 results from an estimated 4000 matches similar to: "How to solve a non-linear system of equations using R"

2010 Jan 26
3
Problem with "nls" function
Dear R users, I have a response variable in a csv file called "y" and a matrix of predictor variables in a csv file called "mat". I have used the function "nls" I have specified the nonlinear relation between these variable.The code I have witten is called Rprog which begins with the phrase: L.minor.m1<-nls(Y~a ....etc.. The program when I execute the program, I
2003 Oct 31
1
constrained nonlinear optimisation in R?
Hello. I have searched the archives but have not found anything. I need to solve a constrained optimisation problem for a nonlinear function (“maximum entropy formalism”). Specifically, Optimise: -1*SUM(p_ilog(p_i)) for a vector p_i of probabilities, conditional on a series of constraints of the form: SUM(T_i*p_i)=k_i for given values of T_i and k_i (these are constraints on
2019 Sep 11
2
'==' operator: inconsistency in data.frame(...) == NULL
Sorry, I can't reproduce the example below even on the same machine. However, the following example produces the same error as NULL values in prior examples: > setClass("FOOCLASS", +????????? representation("list") + ) > ma = new("FOOCLASS", list(M=matrix(rnorm(300), 30,10))) > isS4(ma) [1] TRUE > data.frame(a=1:3) == ma Error in
2006 Jan 12
1
Problem with NLSYSTEMFIT()
Hello, I want to solve a nonlinear 3SLS problem with "nlsystemfit()". The equations are of the form y_it = f_i(x,t,theta) The functions f_i(.) have to be formulated as R-functions. When invoking "nlsystemfit()" I get the error Error in deriv.formula(eqns[[i]], names(parmnames)) : Function 'f1' is not in the derivatives table
2006 Jul 24
1
Referring on the value of a counter in a loop
Dear all The following is a very basic and beginner's question on loops. Suppose you have data (say, 1000 cases) with two variables named "answer" (string) and "class" (numeric). The latter runs from 1 to 78 and categorizes the data. I need to create a file "answer_1.txt" for the cases with class==1, and so on, up to "answer_78.txt" I have been
2001 Oct 26
2
wilcox.test point estimates perverse (PR#1150)
The point estimates produced by wilcox.test are perverse (not wrong, just brain damaged). The Hodges-Lehmann estimator that goes with the signed rank test is the median of the Walsh averages. The Hodges-Lehmann estimator that goes with the rank sum test is the median of the pairwise differences. wilcox.test agrees except that it uses the following very peculiar definition of "sample
2009 Aug 06
1
solving system of equations involving non-linearities
Hi, I would appreciate if someone could help me on track with this problem. I want to compute some parameters from a system of equations given a number of sample observations. The system looks like this: sum_i( A+b_i>0 & A+b_i>C+d_i) = x sum_i( C+d_i>0 & C+d_i>A+b_i) = y sum_i( exp(E+f_i) * ( A+b_i>0 & A+b_i>C+d_i) = z A, C, E are free variables while the other
2009 Feb 22
2
how to recover a list structure
I am experiencing some problems at working with lists at high level. In the following "coef" contains the original DWT coefficients organized in a list. Thorugh applying the following two commands: coef.abs <- lapply(unlist(coef,recursive=FALSE,use.names =TRUE),abs) coef.abs.sorted <- sort(unlist(coef.abs),decreasing=TRUE) I get vector "coef.abs.sorted" containing
2011 Feb 16
0
Constraints in projection pursuit regression
Hi, I am solving a projection pursuit regression problem, of the form y = \sum_i f_i (a_i^T x), where a_i are unknown directions, while f_i are unknown univariate link functions. The following is known about each f_i: 1. f_i (0) = 0  (that is, each f_i passes through the origin) 2. f_i is monotonic. Is there a way to ensure that the function ppr() in R produces solutions that respect the
2011 Jan 15
2
Rounding variables in a data frame
Hi All I am trying to use the round function on some columns of a dataframe while leaving others unchanged. I wish to specify those columns to leave unchanged. My attempt is below - here, I would like the column d3 to be left but columns d1, d2 and d4 to be rounded to 0 decimal places. I would welcome any suggestions for a nicer way of doing this. d1= rnorm(10,10) d2= rnorm(10,6) d3=
2009 Mar 20
4
how to make aggregation in R ?
Hi, I am trying to aggregate the sum of my test data.frame as follow: testDF <- data.frame(v1 = c("a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "c", "c", "c", "c", "c", "d", "d", "d", "d",
2011 Apr 21
1
Help with matching rows
Dear Sir, Please excuse my akwardness as I a new to R and computers, but would kindly appreciate help. { a <- sample (1:10,100,replace=T ) b <-sample(10:20,100,replace=T) c <- sample(20:30,100,replace=T) d <- sample(30:40,100,replace=T) e <- sample(40:50,100,replace=T) } d1 <- a d2 <- b d3 <-c d4 <- d d5 <- e data.frame(d1,d2,d3,d4,d5) dd <-
2015 Feb 23
5
iterated lapply
Hi everybody, with the following code I generate a list of functions. Each function reflects a "condition". When I evaluate this list of functions by another lapply/sapply, I get an unexpected result: all values coincide. However, when I uncomment the print(), it works as expected. Is this a bug or a feature? conditions <- 1:4 test <- lapply(conditions, function(mycondition){
2009 Feb 09
2
How to plot multiple graphs each with multiple y variables
I am new to R and have a problem that I haven't been able to find the answer to in the guides or online. I have multiple datasets, D1, D2, D3, D4, D5, D6, D7 and D8, and I would like to produce two plots side by side using mfrow.  The first plot should contain data from D1-D4, the second should contain D5-D8. I can plot these separately using the code, par(mfrow=c(1,1))
2010 Jun 14
2
Which is the easiest (most elegant) way to force "aov" to treat numerical variables as categorical ?
Hi R help, Hi R help, Which is the easiest (most elegant) way to force "aov" to treat numerical variables as categorical ? Sincerely, Andrea Bernasconi DG PROBLEM EXAMPLE I consider the latin squares example described at page 157 of the book: Statistics for Experimenters: Design, Innovation, and Discovery by George E. P. Box, J. Stuart Hunter, William G. Hunter. This example use
2011 May 17
2
Minimum value by ID
Hello, I have a longitudinal dataset where each individual has a different number of entries. Thus, it is of the following structure: x <- runif(12) id.var <- factor(c(rep("D1",4),rep("D2",2),rep("D3",3),rep("D4",3))) dat <- as.data.frame(x) dat$id.var <- id.var dat > dat x id.var 1 0.9611269 D1 2 0.6738606 D1 3
2005 Oct 10
5
User unable to change their password using smbpasswd
May anyone help me solve the problem? I use samba 2.2.2 on Solaris 8 ngnvob02 [** NONE **]/export/home/sitlb $ cd /usr/local/samba/bin ngnvob02 [** NONE **]/usr/local/samba/bin $ ./smbpasswd Old SMB password: New SMB password: Retype new SMB password: machine 127.0.0.1 rejected the tconX on the IPC$ share. Error was : = ERRSRV - ERRbadpw. Failed to change password for sitlb But I can change the
2003 Oct 23
1
Variance-covariance matrix for beta hat and b hat from lme
Dear all, Given a LME model (following the notation of Pinheiro and Bates 2000) y_i = X_i*beta + Z_i*b_i + e_i, is it possible to extract the variance-covariance matrix for the estimated beta_i hat and b_i hat from the lme fitted object? The reason for needing this is because I want to have interval prediction on the predicted values (at level = 0:1). The "predict.lme" seems to
2015 Feb 24
3
iterated lapply
From: Daniel Kaschek <daniel.kaschek at physik.uni-freiburg.de> > ... When I evaluate this list of functions by > another lapply/sapply, I get an unexpected result: all values coincide. > However, when I uncomment the print(), it works as expected. Is this a > bug or a feature? > > conditions <- 1:4 > test <- lapply(conditions, function(mycondition){ >
2012 Sep 19
3
[LLVMdev] newbie question on getelementptr
Hi All, I'm new to LLVM and I'm having a coding problem. I'm creating a GlobalVariable that contains a StructType that contains a Function. The function returns i32 and takes two i32's. Here is my code: GlobalVariable* retrieved = module->getGlobalVariable("myGV"); ... Constant* result = ConstantExpr::getGetElementPtr(retrieved, indices); How do I get my Function