Displaying 18 results from an estimated 18 matches for "startval".
Did you mean:
startva
2010 Sep 29
1
nlminb and optim
...k* my likelihood is written properly and I *think* I am handling flow control issues in a relatively decent way. I may be misinterpreting optim or nlminb reports.
In any event, should anyone take the time to review this and offers pointers I would be grateful.
Harold
fit <- function(data, Q, startVal = NULL, ...){
if(!is.null(startVal) && length(startVal) != ncol(data) ){
stop("Length of argument startVal not equal to the number of parameters estimated")
}
if(!is.null(startVal)){...
2009 Nov 29
1
optim or nlminb for minimization, which to believe?
...tasets methods base
other attached packages:
[1] ltm_0.9-2 polycor_0.7-7 sfsmisc_1.0-9 mvtnorm_0.9-8 msm_0.9.4 MASS_7.3-3 MiscPsycho_1.5
[8] statmod_1.4.1
loaded via a namespace (and not attached):
[1] splines_2.10.0 survival_2.35-7 tools_2.10.0
mml2 <- function(data, Q, startVal = NULL, gr = TRUE, ...){
if(!is.null(startVal) && length(startVal) != ncol(data) ){
stop("Length of argument startVal not equal to the number of parameters estimated")
}
if(!is.null(startVal)){...
2011 Dec 11
1
nls start values
...189981, 2.098671, 2.122207,
2.012621, 1.963610,
1.884184, 1.955160, 1.801175, 1.829686, 1.773260, 1.588768, 1.563774,
1.559192)
tpoints <-
c(0,0,0,2,2,2,4,4,4,6,6,6,8,8,8,12,12,12,14,14,14,16,16,16,18,18,18,20,20,20,24,24,24)
shift=mean(gene_expression) # y-axis (expression) shift
# Perfect fit
startvals <- list(phase=pi, amp=0.5)
sine_nls <- nls(gene_expression ~ sin(tpoints * afreq + phase) * amp +
shift, start=startvals, algorithm="port", lower=lowervals, upper=uppervals)
# Convergence failure
startvals <- list(phase=0, amp=0.5)
sine_nls <- nls(gene_expression ~ sin(tpoin...
2008 Feb 24
0
problem with ML estimation
...y inaccurate.
I am sending my programme. It would be of great help if someone can point
me, where I am going wrong.
############################################################
library(MASS)
Sigma <- matrix(c(4,2.8,2.8,4),2,2)
y<-mvrnorm(n=1000, rep(0, 2), Sigma)
mlebinorm<- function(startval, y)# startval = Initial Values to be passed ,
y= data
{
startval<-as.numeric(startval)
oneside=matrix(c(0,0,0,0,-1,0,0,0,0,1),5,2)
otherside = c(-0.9999999,-0.999999)
n<- ncol(y)
nf<- function(x)
{
mu1<-x[1]
mu2<-x[2]
sig1<-x[3]
sig2<-x[4]
rho<-x[5]
nf<-...
2008 Apr 25
5
Non-linear system of equations
...I solve the following simple example?
x^2 - y^2 = 6
x ? y = 3
I heard about nlsystemfit, but I don?t know how to run it exactly. I have tried the following code, but it doesn?t really work:
f1 <-y~ x[1]^2-x[2]^2-6
f2 <-z~ x[1]-x[2]-3
f <- list(f1=0,f2=0)
nlsystemfit("OLS",f,startvals=c(0,0))
Thank You in advance for your help.
Evgeniq Petrova
2011 Apr 13
0
ddply and nlminb
...= x[5]
TH = 45
theta = x[6]
qe = qeo + dqe*T
theta =
phi = (TH-To)/(To-TL)
Fm = Fmo*((T-TL)*(TH-T)^ phi) / ((To-TL)*(TH-To)^ phi)
Aest = (qe*PAR + Fm - ((qe*PAR + Fm)^2 - 4*theta*qe*PAR*Fm)^0.5)/(2.*theta)
result = sum((Aest-A)^2 )
}
# ------------ Define parameter starting values and limits
startval = c(0.05,-0.01,20, -5,15,0.5)
lowval = c(0.01,-0.05, 5,-15, 7,0.1)
uppval = c(0.2, 0.02,50, 0,25,0.99)
# ------------ Fit using entire data set
R3 <- nlminb(startval, fnonRecHypT, control=list(trace=1),
lower=lowval, upper = uppval)
# ------------ estimate fit parameter standard err...
2012 Dec 10
3
[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)
...VAddRecExpr>(Accum) &&
cast<SCEVAddRecExpr>(Accum)->getLoop() == L)) {
SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap;
@@ -3071,11 +3091,40 @@ const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) {
}
const SCEV *StartVal = getSCEV(StartValueV);
- const SCEV *PHISCEV = getAddRecExpr(StartVal, Accum, L, Flags);
+ const SCEV *PHISCEV;
+ if (zext && trunc) {
+ // We have an induction variable 'iv' of the form:
+ // iv=add(zext(trunc(...
2011 Mar 10
2
R beginner - Error in as.vector(x, mode)
Hi everyone,
I am new to R and keep getting the message
Error in as.vector(x, mode)
while trying to run nlsystemfit.
Below is my exact code. The data is in Stata format because I only
recently swapped to R and am trying to compare results from Stata to
make sure I know what is going on.
I have searched google and read sever R-help articles with this error.
They all say the problem is to do
2012 Dec 11
1
Debian packaging and openblas related crash when profiling in R
...p(thetareal, c(FALSE, o[ss, ]))
8: emfred(x, thetaold, indx$o, indx$m, indx$ivector, indx$icap,
indx$AMr1, indx$AMr2, AM1stln = AM1stln, returntype = "theta",
priors = priors, empri = empri, collect = collect)
9: emarch(x.stacked$x, p2s = p2s, thetaold = NULL, tolerance =
tolerance, startvals = startvals, x.stacked$priors, empri = empri,
frontend = frontend, collect = collect, autopri = prepped$autopri,
emburn = emburn)
10: amelia.default(datM, m = 5, idvars = "group")
11: amelia(datM, m = 5, idvars = "group")
Warning: stack imbalance in '<-', 108 the...
2011 Sep 02
1
Using capture.output within a function
Dear R-users
I'm running a maximum likelihood procedure using the spg package. I'd like
to save some output produced in each iteration to a file, but if I put the
capture.output() within the function I get the following message; Error in
spg(par = startval, fn = loglik, gr = NULL, method = 3, lower = lo, :
Failure in initial function evaluation!Error in -fn(par, ...) : invalid
argument to unary operator
I have considered putting the capture.output() after the function, but there
are some issues with R stalling on me so I'd like that the outpu...
2005 Sep 26
2
nls and na/Nan/Inf error
I am trying to it a particular nonlinear model common in Soil Science to
moisture release data from soil. I have written the function as shown
below according to the logist example in Ch8 of Pinheiro & Bates. I am
getting the following error (R version 2.1.1)
*Error in qr(attr(rhs, "gradient")) : NA/NaN/Inf in foreign function
call (arg 1)*
Below is the function and data.
/#
2007 Jun 07
1
MITOOLS: Error in eval(expr, envir, enclos) : invalid 'envir' argument
...2 1 1 2 1 1 1 2 ...
$ os : num 0 1 0 0 1 1 1 0 0 1 ...
$ css : num 0 1 0 0 1 1 1 0 0 1 ...
$ rfs : num 0 1 1 0 1 1 1 0 0 1 ...
$ comp : num 0 1 1 0 1 1 1 0 0 1 ...
> set.seed(200)
> M <- 50 # Number of imputations
> am.imp <- amelia(utt.mi, m=M, p2s=1, startvals=1, write.out=F,
+ idvars=c('os','css','rfs','comp'),
+
noms=c('gender','symptoms','site','multifoc','ctnm','prebca','precystec'
,
+ 'smk','surgery','ptnm.t','nodes','grade...
2010 Apr 11
0
[LLVMdev] Proposal: stack/context switching within a thread
...cause execution to transfer back
; to this context as if from a return from llvm.swapcontext. The linked
; context pointer stored in %pThisCtx is not modified.
declare void llvm.swapcontext({}* %pThisCtx, {}* %pNewCtx)
A simple example using these intrinsics:
define void @co1({}* %thisCtx, i32 %startVal) nounwind {
entry:
%prevCtx = call {}* @llvm.getlinkcontext(%thisCtx)
; Now call print messages. After each print message, temporarily yield
; control back to the previous context.
call void @printCo1FirstMessage(i32 %startVal)
call void @llvm.swapcontext({}* %thisCtx, {}* %prevCtx)
c...
2003 Dec 02
0
names of parameters from nonlinear model?
...e operation to test to
see if the column is all zeros and tally up a character vector with the
names of the columns to obtain the terms in equation i
eqn.terms <- vector()
for( v in 1:length( est$estimate ) ) {
j <- attr( eval( deriv( as.formula( eqns[[i]] ), names(
startvals ) ) ), "gradient" )
if( qr( j[,v] )$rank > 0 ) {
eqn.terms <- rbind( eqn.terms,
name <- names( est$estimate )[v] )
}
}
derivs[[i]] <- deriv( as.formula( eqns[[i]] ), eqn.terms,
hessian=T )...
2007 May 31
0
Using MIcombine for coxph fits
...etach(package: Hmisc)
---------------
After examining the missing data patterns, impute 10 datasets using the
amelia function from the Amelia package. Check the densities of the
continuous variables to make sure they make sense.
---------------
library(Amelia)
am.imp <- amelia(d, m=10, p2s=1, startvals=1, write.out=F,
noms=c('status','sex','hepmeg','trt'))
compare.density(data=d, output=am.imp, var='trig')
compare.density(data=d, output=am.imp, var='platelet')
---------------
Since everything looks ok, fit Cox models to each of the 10 imputed
dat...
2010 Apr 11
3
[LLVMdev] Proposal: stack/context switching within a thread
Kenneth Uildriks <kennethuil at gmail.com> wrote:
> As I see it, the context switching mechanism itself needs to know
> where to point the stack register when switching. The C routines take
> an initial stack pointer when creating the context, and keep track of
> it from there. If we don't actually need to interoperate with
> contexts created from the C routines, we have
2018 May 10
2
LLVM SCEV isAddRecNeverPoison and strength reduction
+CC llvm-dev
On Tue, May 8, 2018 at 2:34 AM, Gal Zohar <Gal.Zohar at ceva-dsp.com> wrote:
> I noticed that SCEV, when trying to perform strength reduction, doesn’t use
> the ability to prove an induction variable does not signed/unsigned wrap due
> to infinite loops.
>
> Is there an easy way to use the isAddRecNeverPoison function when
> determining if strength reduction
2005 Dec 14
2
suggestions for nls error: false convergence
Hi,
I'm trying to fit some data using a logistic function defined as
y ~ a * (1+m*exp(-x/tau)) / (1+n*exp(-x/tau)
My data is below:
x <- 1:100
y <- c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,1,1,1,2,2,2,2,2,3,4,4,4,5,
5,5,5,6,6,6,6,6,8,8,9,9,10,13,14,16,19,21,
24,28,33,40,42,44,50,54,69,70,93,96,110,127,127,141,157,169,