Displaying 20 results from an estimated 1000 matches similar to: "nonlinear least squares, multiresponse"
2003 Aug 27
3
seeking help with with()
I tried to define a function like:
fnx <- function(x, by.vars=Month)
print(by(x, by.vars, summary))
But this doesn't work (does not find x$Month; unlike other functions,
such as
subset(), the INDICES argument to "by" does not look for variables in
dataset
x. Is fully documented, but I forget every time). So I tried using
"with":
fnxx <- function(x, by.vars=Month)
2013 Feb 05
1
R -HELP REQUEST
Good morning to you all,
Sorry for taking your time from your research and
teaching schedules.
If you have a non-stationary univariate time Series
data that has the transformation:
Say; l.dat<-log (series)
d.ldat<-diff (l.dat, differences=1)
and you fit say arima model.
predit.arima<-predict (fit.series, n.ahead=10,
xregnew= (n+1) :( n+10))
How could I re-transform
2019 Feb 01
3
nlminb with constraints failing on some platforms
Hello,
R 3.5.2 on ubuntu 18.04. sessionInfo() at the end.
Works with me, same results, cannot reproduce the error.
f <- function(x) sum( log(diff(x)^2+.01) + (x[1]-1)^2 )
opt <- nlminb(rep(0, 10), f, lower=-1, upper=3)
str(opt)
xhat <- rep(1, 10)
all.equal(opt$par, xhat, tol=0) # good: 5.53 e-7
#[1] "Mean relative difference: 5.534757e-07"
all.equal(opt$objective,
2019 Jan 28
8
nlminb with constraints failing on some platforms
I've noticed unstable behavior of nlminb on some Linux systems. The problem can be reproduced by compiling R-3.5.2 using gcc-8.2 and running the following snippet:
f <- function(x) sum( log(diff(x)^2+.01) + (x[1]-1)^2 )
opt <- nlminb(rep(0, 10), f, lower=-1, upper=3)
xhat <- rep(1, 10)
abs( opt$objective - f(xhat) ) < 1e-4 ## Must be TRUE
The example works perfectly when
2003 May 17
1
how to handle 'multiresponse' variable?
Hello!
I have dataset where one variable is 'multiresponse', like this:
[1] "1 2" "1 2 3" "4" "1 4" "4 3" etc.
'responses' separated by space. observations in different 'rows'
of data.frame.
I can do strsplit(data$var,' ') and make a list, where multiple
responses are elements of character vectors, like this:
$
2001 Sep 10
1
Multiresponse parameter estimation
I am looking for a way to do multiresponse parameter estimation for a
problem that is quite similar in form to the alpha-pinene example in Bates
and Watts (1988), p. 147, where the model is a set of ODEs. I am
specifically interested in obtaining the parameter covariance matrix, as
well. Which package(s) in R would I use to do such a thing?
Mark Schaffer
Dept. of Chemical Engineering
2006 Sep 11
2
faster way?
Hi,
Is there a faster way to do this? It takes forever, even on a
moderately sized dataset.
n <- dim(dsn)[1]
dsn2 <- dsn[order(-dsn$xhat),]
dsn2[1, "cumx"] <- dsn2[1, "xhat"]
for (i in 2:n) {
dsn2[i, "cumx"] <- dsn2[i - 1, "cumx"] + dsn2[i, "xhat"]
}
[[alternative HTML version deleted]]
2012 Nov 16
2
R-Square in WLS
Hi,
I am fitting a weighted least square regression and trying to compute
SSE,SST and SSReg but I am not getting SST = SSReg + SSE and I dont know
what I am coding wrong. Can you help please?
xnam <-colnames(X) # colnames Design Matrix
fmla1 <- as.formula(paste("Y ~",paste(xnam, collapse=
2019 Feb 01
1
nlminb with constraints failing on some platforms
> On 1 Feb 2019, at 10:00, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>
> ........
>>> sessionInfo()
>> R version 3.5.2 (2018-12-20)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>> Running under: Scientific Linux release 6.4 (Carbon)
>
>> Matrix products: default
>> BLAS/LAPACK:
1999 Nov 30
1
image stops detecting wrong sized z matrix (PR#352)
Full_Name: Albrecht Gebhardt
Version: 0.90.0
OS: Linux + Tru64
Submission from: (NULL) (143.205.61.72)
This is where example(krige) from library(sgeostat) stops with R 0.90.0:
krige> image(grid$x, grid$y, grid$krige$zhat, add = T)
Error in length(x) == nrow(z) : comparison (1) is possible only for vector
types
in previous versions of R the above image() call worked, because image()
did the
2013 Oct 09
1
mixed model MANOVA? does it even exist?
Hi,
Sorry to bother you again.
I would like to estimate the effect of several categorical factors (two
between subjects and one within subjects) on two continuous dependent
variables that probably covary, with subjects as a random effect. *I want
to control for the covariance between those two DVs when estimating the
effects of the categorical predictors** on those two DVs*. The thing is, i
2017 Nov 07
2
Using MLE on a somewhat unusual likelihood function
So I am trying to use the mle command (from stats4 package) to estimate a
number of parameters using data but it keeps throwing up this error message:
Error in solve.default(oout$hessian) :
Lapack routine dgesv: system is exactly singular: U[1,1] = 0
This error sometimes indicates that the list of starting values is too far
from optimum but this is unlikely since I picked values close to where
2019 Feb 04
2
nlminb with constraints failing on some platforms
I get the failure message. To be specific:
adcomp.git>R CMD BATCH --quiet test_nlminb.R
adcomp.git>cat test_nlminb.Rout
> f <- function(x) sum( log(diff(x)^2+.01) + (x[1]-1)^2 )
> opt <- nlminb(rep(0, 10), f, lower=-1, upper=3)
> xhat <- rep(1, 10)
> abs( opt$objective - f(xhat) ) < 1e-4? ## Must be TRUE
[1] FALSE
My system is described by:
adcomp.git>uname
2009 Dec 06
1
R + Hull-White model using nonlinear least squares
Hi guys
I have data that contains the variances vt of the yields of 1, 2, 3, 4,
5,10, 20 year bonds. Assuming the Hull-White model for the yield of a t-year
zero-coupon bond, I have to estimate the ? of the Hull-White model using
nonlinear least squares and give a 95% con?dence interval for each
parameter. Please can you guys tell how to find out ? using R. Any
suggestion regarding what functions
2009 Jul 01
1
Iteratively Reweighted Least Squares of nonlinear regression
Dear all,
When doing nonlinear regression, we normally use nls if e are iid normal.
i learned that if the form of the variance of e is not completely known,
we can use the IRWLS (Iteratively Reweighted Least Squares )
algorithm:
for example, var e*i =*g0+g1*x*1
1. Start with *w**i = *1
2. Use least squares to estimate b.
3. Use the residuals to estimate g, perhaps by regressing e^2 on
2008 Aug 14
0
3D constrained nonlinear least squares fit
Hi,
I am new to R, and am trying to solve the following optimization problem:
This is a nonlinear least squares problem. I have a set of 3D voxels. All I
need is to find a least squares fit to this data. The data model actually
represent a cube-like structure, consisting of seven straight lines. The
lines have some intersections (and at this intersection both of the
participating lines end).
2008 Oct 08
0
genoud nonlinear least squares optimisation
Hello,
I am trying to optimise a nonlinear model to derive 'best-fit' parameter
esimates using the genoud function. I have been using the genetic algorithm
- gafit - in order to do this, but I am getting parameter estimates that do
not always reach the global minimum. I am very keen to apply genoud to
optimising this model to see if my results will improve, and also out of
personal
2010 Nov 05
0
User defined function and nonlinear least-squares fit
Hello,
I'd like to fit a user defined function to a data set, but I have problems
to find my problem. The user defined function is a combination of two
rectangular functions, and the listing below gives an example for what I
want to do. The problem is, that I get the error message for fit1 and fit2
"Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at
initial
2012 Sep 19
0
Discrepancies in weighted nonlinear least squares
Dear all,
I encounter some discrepancies when comparing the deviance of a weighted and
unweigthed model with the AIC values.
A general example (from 'nls'):
DNase1 <- subset(DNase, Run == 1)
fm1DNase1 <- nls(density ~ SSlogis(log(conc), Asym, xmid, scal), DNase1)
This is the unweighted fit, in the code of 'nls' one can see that 'nls'
generates a vector
2019 Jan 31
1
nlminb with constraints failing on some platforms
Prof Nash, Prof Galanos
Is it possible to use a generic code stub in front of packages that use
optimx to improve optimx use or curtail it according to the requirements?
Best Regards
Amit
+91 7899381263
________________________________________________________________________
Please request Skype as available
5th Year FPM (Ph.D.) in Finance and Accounting Area
Indian Institute