Displaying 20 results from an estimated 1000 matches similar to: "nls problem"
2006 Sep 15
1
Formula aruguments with NLS and model.frame()
I could use some help understanding how nls parses the formula argument
to a model.frame and estimates the model. I am trying to utilize the
functionality of the nls formula argument to modify garchFit() to handle
other variables in the mean equation besides just an arma(u,v)
specification.
My nonlinear model is
y<-nls(t~a*sin(w*2*pi/365*id+p)+b*id+int,data=t1,
2006 Sep 07
0
Help understanding how nls parses the formula argument to estimate the model
I could use some help understanding how nls parses the formula argument
to a model.frame and estimates the model. I am trying to utilize the
functionality of the nls formula argument to modify garchFit() to handle
other variables in the mean equation besides just an arma(u,v)
specification.
My nonlinear model is
y<-nls(t~a*sin(w*2*pi/365*id+p)+b*id+int,data=t1,
2006 Sep 21
0
Help understanding how nls parses the formula argument to estimate the model
I could use some help understanding how nls parses the formula argument
to a model.frame and estimates the model. I am trying to utilize the
functionality of the nls formula argument to modify garchFit() to handle
other variables in the mean equation besides just an arma(u,v)
specification.
My nonlinear model is
y<-nls(t~a*sin(w*2*pi/365*id+p)+b*id+int,data=t1,
2004 Jun 10
2
nls and R scoping rules
I apologize for posting this in essence the second time (no light at the
end of the tunnel yet..):
is there a way to enforce that "nls" takes both, the data *and* the
model definition from the parent environment? the following fragment
shows the problem.
#======== cut here==========
wrapper <- function (choose=0)
{
x <- seq(0,2*pi,len=100)
y <- sin(1.5*x);
y <-
2001 Feb 19
2
problems sourcing in vs interactive
If I source in the function (see below) calib(), I get:
> source("papers/helle/threshold.r")
> calib()
Error in eval(expr, envir, enclos) : Object "energy" not found
But if I cut and paste the code for calib() one line at a time into the R
window it works fine.
calib<-function()
{
contrast<-c(.01,.02,.0325,.055,.0775,.1,.125,.15,.175,.2)
2008 Jun 26
3
bug in nls?
Dear all
Nobody responded to my previous post so far so I try with more offending
subject.
I just encountered a strange problem with nls formula. I tried to use nls
in cycle but I was not successful. I traced the problem to some parse
command.
Here is an example
DF<-data.frame(x=1:10, y=3*(1:10)^.5+rnorm(10))
coef(lm(log(DF[,2])~log(DF[,1])))
(Intercept) log(DF[, 1])
0.7437320
2008 Aug 05
1
Fix for nls bug???
Hi All,
I've hit a problem using nls. I think it may be a restriction in the
applicability of nls and I may have found a fix, but I've been wrong before.
This example is simplified to the essentials. My real application is much
more complicated.
Take a function of matrix 'x' with additional arguments:
matrix 'aMat' whose values are _not_ to be determined by nls
vector
2006 Dec 23
1
simple NLS query
dear R experts: I am trying to orient myself using nls(). so, I am
just trying to copy and adapt an example in the nls() function:
> d= data.frame( y= runif(10), x= runif(10) )
> nls( y ~ 1/(1+x), data = d, start= list(x=0.5,y=0.5), trace=TRUE)
Error in n%%respLength : non-numeric argument to binary operator
the error message seems internal, so it would be nicer if there was a
2004 Jun 03
5
Confidence intervals for predicted values in nls
Dear all
I have tried to estimate the confidence intervals for predicted values of a
nonlinear model fitted with nls. The function predict gives the predicted
values and the lower and upper limits of the prediction, when the class of
the object is lm or glm. When the object is derived from nls, the function
predict (or predict.nls) gives only the predicted values. The se.fit and
interval aguments
2009 Feb 12
0
Error Message: Error in dim(data) <- dim : attempt to set an attribute on NULL
I have the following code, from which I get the following error message:
Error in dim(data) <- dim : attempt to set an attribute on NULL
I think the error is coming from the part of my code in BOLD RED. The script works fine until then.
#Load libraries
source("http://bioconductor.org/biocLite.R")
biocLite()
library(limma)
library(Biobase)
#change directory to folder where
2011 May 01
1
Different results of coefficients by packages penalized and glmnet
Dear R users:
Recently, I learn to use penalized logistic regression. Two packages
(penalized and glmnet) have the function of lasso.
So I write these code. However, I got different results of coef. Can someone
kindly explain.
# lasso using penalized
library(penalized)
pena.fit2<-penalized(HRLNM,penalized=~CN+NoSus,lambda1=1,model="logistic",standardize=TRUE)
pena.fit2
2012 May 28
0
GLMNET AUC vs. MSE
Hello -
I am using glmnet to generate a model for multiple cohorts i. For each i, I
run 5 separate models, each with a different x variable. I want to compare
the fit statistic for each i and x combination.
When I use auc, the output is in some cases is < .5 (.49). In addition, if
I compare mean MSE (with upper and lower bounds) ... there is no difference
across my various x variables, but
2013 May 05
1
slope coefficient of a quadratic regression bootstrap
Hello,
I want to know if two quadratic regressions are significantly different.
I was advised to make the test using
step 1 bootstrapping both quadratic regressions and get their slope
coefficients.
(Let's call the slope coefficient *â*^1 and *â*^2)
step 2 use the slope difference *â*^1-*â*^2 and bootstrap the slope
coefficent
step 3 find out the sampling distribution above and
2009 Feb 19
1
Read.table not reading in all columns
Hello,
I am reading in a file called fit2.txt (Limma). fit2.txt has 38 columns but when I dim(fit2) I only get 6 columns. The first column that it does not read in is df.residual.
fit2<-read.table(fit2, file="fit2.txt",sep="\t",quote="",comment.char="",as.is=TRUE)
The first few lines of fit2.txt (does not include all 38 columns) looks like this:
2009 Feb 12
0
Comparing slopes in two linear models
Hi everyone,
I have a data frame (d), wich has the results of mosquitoes trapping in
three different places.
I suspect that one of these places (Local=='Palm') is biased by low
numbers and will yield slower slopes in the variance-mean regression over
the areas. I wonder if these slopes are diferents.
I've looked trought the support list for methods for comparing slopes and
found the
2010 Mar 17
1
accessing info in object slots from listed objects using loops
Hey,
I have stacked a couple of garchFit objects in a list with names $fit1,
$fit2, ..., $fiti assigning objects names using a loop, i.e. after running
the loop modelStack = list($fit1, $fit2,...,$fiti).
Thus the following apply;
a = modelStack$fit2, then a is the second garchFit object of formal class
'fGarch' with 11 slots, @call, @formula... etc.
I then want to extract information in
2011 Mar 25
2
A question on glmnet analysis
Hi,
I am trying to do logistic regression for data of 104 patients, which
have one outcome (yes or no) and 15 variables (9 categorical factors
[yes or no] and 6 continuous variables). Number of yes outcome is 25.
Twenty-five events and 15 variables mean events per variable is much
less than 10. Therefore, I tried to analyze the data with penalized
regression method. I would like please some of the
2011 May 29
1
Fitting spline using Pspline
Hey all,
I seem to be having trouble fitting a spline to a large set of data using
PSpline. It seems to work fine for a data set of size n=4476, but not for
anything larger (say, n=4477). For example:
THIS WORKS:
-----------------------------
random = array(0,c(4476,2))
random[,1] = runif(4476,0,1)
random[,2] = runif(4476,0,1)
random = random[order(random[,1]),]
plot(random[,1],random[,2])
2009 May 12
1
questions on rpart (tree changes when rearrange the order of covariates?!)
Greetings,
I am using rpart for classification with "class" method. The test data is
the Indian diabetes data from package mlbench.
I fitted a classification tree firstly using the original data, and then
exchanged the order of Body mass and Plasma glucose which are the
strongest/important variables in the growing phase. The second tree is a
little different from the first one. The
2004 May 07
0
rpart for CART with weights/priors
Hi,
I have a technical question about rpart:
according to Breiman et al. 1984, different costs for misclassification in
CART can be modelled
either by means of modifying the loss matrix or by means of using different
prior probabilities for the classes,
which again should have the same effect as using different weights for the
response classes.
What I tried was this:
library(rpart)