Displaying 20 results from an estimated 1000 matches similar to: "4-parameter logistic model"
2004 May 15
2
questions about optim
Hi,
I am trying to do parameter estimation with optim, but I can't get it to
work quite right-- I have an equation X = Y where X is a gaussian, Y is a
multinomial distribution, and I am trying to estimate the probabilities of
Y( the mean and sd of X are known ), Theta1, Theta2, Theta3, and Theta4; I
do not know how I can specify the constraint that Theta1 + Theta2 + Theta3 +
Theta4 = 1 in
2018 Feb 13
3
Help with regular expressions
R 3.4.2
OS X
Colleagues
I would appreciate some help with regular expressions.
I have string that looks like:
" ITERATION ,THETA1 ,THETA2 ,THETA3 ,THETA4 ,THETA5 ,THETA6 ,THETA7 ,SIGMA(1,1) ,SIGMA(2,1) ,SIGMA(2,2)?
In the entries that
2012 Mar 16
2
Elegant Code
Hi,
Can anyone help to write a more elegant version of my code? I am sure
this can be put into a loop but I am having trouble creating the
objects b1,b2,b3,...,etc.
b1 <- rigamma(50,1,1)
theta1 <- rgamma(50,0.5,(1/b1))
sim1 <- rpois(50,theta1)
b2 <- rigamma(50,1,1)
theta2 <- rgamma(50,0.5,(1/b2))
sim2 <- rpois(50,theta2)
b3 <- rigamma(50,1,1)
theta3 <-
2018 Feb 13
0
Help with regular expressions
Hi Dennis,
How about:
# define the two values to search for
x<-2
y<-3
# create your search string and replacement string
repstring<-paste(x,y,sep=",")
newstring<-paste(x,y,sep=".")
# this is the string that you want to change
thetastring<-"SIGMA(2,3)"
sub(repstring,newstring,thetastring)
[1] "SIGMA(2.3)"
Use gsub if you want to change
2004 Mar 18
1
profile error on an nls object
Hello all,
This is the error message that I get.
> hyp.res <- nls(log(y)~log(pdf.hyperb(theta,X)), data=dataModel,
+ start=list(theta=thetaE0),
+ trace=TRUE)
45.54325 : 0.1000000 1.3862944 -4.5577142 0.0005503
3.728302 : 0.0583857346 0.4757772859 -4.9156128701 0.0005563154
1.584317 : 0.0194149477 0.3444648833 -4.9365149150 0.0004105426
1.569333 :
2018 Feb 13
1
Help with regular expressions
You can either use positive lookahead/lookbehind - but support for that is a bit flaky. Or write a proper regex, and use
backreferences to keep what you need.
R > x <- "abc 1,1 ,1 1, x,y 2,3 "
R > gsub("(\\d),(\\d)", "\\1.\\2", x, perl = TRUE)
[1] "abc 1.1 ,1 1, x,y 2.3 "
B.
> On Feb 12, 2018, at 9:34 PM, Jim Lemon <drjimlemon at
2011 Aug 09
1
nls, how to determine function?
Hi R help,
I am trying to determine how nls() generates a function based on the
self-starting SSlogis and what the formula for the function would be.
I've scoured the help site, and other literature to try and figure
this out but I still am unsure if I am correct in what I am coming up
with.
**************************************************************************
dat <-
2017 Oct 20
1
Error messages using nonlinear regression function (nls)
Hi
Keep your messages in the list, you increase your chance to get some answer.
I changed your data to groupedData object (see below), but I did not find any problem in it.
plot(wlg)
gives reasonable picture and I am not such expert to see any problem with data. Seems to me, that something has to be wrong with nlsList function.
> wheat.list <- nlsList(Prop ~ SSlogis(end,Asym, xmid,
2004 Feb 26
2
Structural Equation Model
Hello all!
I want to estimate parameters in a MIMIC model. I have one latent
variable (ksi), four reflexive indicators (y1, y2, y3 and y4) and four
formative indicators (x1, x2, x3, x4). Is there a way to do it in R? I
know there is the SEM library, but it seems not to be possible to
specify formative indicators, that is, observed exogenous variables
which causes the latent variable.
Thanks,
2009 Sep 07
1
Scan and read.table
Dear R experts..
I am trying to read data-sections in a large consolidated dataset,
containing section headers and the data . There are many options available
to implement, I was wondering what optimal function, to extract section
headers and data (w/ columns), could be used on the dataset that looks like
as provided at the end of this email? In each section of a dataset, 1st line
of the section
2023 Aug 20
2
Issues when trying to fit a nonlinear regression model
Dear Bert,
Thank you so much for your kind and valuable feedback. I tried finding the
starting values using the approach you mentioned, then did the following to
fit the nonlinear regression model:
nlregmod2 <- nls(y ~ theta1 - theta2*exp(-theta3*x),
start =
list(theta1 = 0.37,
theta2 = exp(-1.8),
theta3 =
2023 Aug 20
3
Issues when trying to fit a nonlinear regression model
Dear friends,
This is the dataset I am currently working with:
>dput(mod14data2_random)
structure(list(index = c(14L, 27L, 37L, 33L, 34L, 16L, 7L, 1L,
39L, 36L, 40L, 19L, 28L, 38L, 32L), y = c(0.44, 0.4, 0.4, 0.4,
0.4, 0.43, 0.46, 0.49, 0.41, 0.41, 0.38, 0.42, 0.41, 0.4, 0.4
), x = c(16, 24, 32, 30, 30, 16, 12, 8, 36, 32, 36, 20, 26, 34,
28)), row.names = c(NA, -15L), class =
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Oh, sorry; I changed signs in the model, fitting
theta0 + theta1*exp(theta2*x)
So for theta0 - theta1*exp(-theta2*x) use theta1= -.exp(-1.8) and theta2 =
+.055 as starting values.
-- Bert
On Sun, Aug 20, 2023 at 11:50?AM Paul Bernal <paulbernal07 at gmail.com> wrote:
> Dear Bert,
>
> Thank you so much for your kind and valuable feedback. I tried finding the
> starting
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Dear Bert,
Thank you for your extremely valuable feedback. Now, I just want to
understand why the signs for those starting values, given the following:
> #Fiting intermediate model to get starting values
> intermediatemod <- lm(log(y - .37) ~ x, data=mod14data2_random)
> summary(intermediatemod)
Call:
lm(formula = log(y - 0.37) ~ x, data = mod14data2_random)
Residuals:
Min
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Basic algebra and exponentials/logs. I leave those details to you or
another HelpeR.
-- Bert
On Sun, Aug 20, 2023 at 12:17?PM Paul Bernal <paulbernal07 at gmail.com> wrote:
> Dear Bert,
>
> Thank you for your extremely valuable feedback. Now, I just want to
> understand why the signs for those starting values, given the following:
> > #Fiting intermediate model to get
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
I got starting values as follows:
Noting that the minimum data value is .38, I fit the linear model log(y -
.37) ~ x to get intercept = -1.8 and slope = -.055. So I used .37,
exp(-1.8) and -.055 as the starting values for theta0, theta1, and theta2
in the nonlinear model. This converged without problems.
Cheers,
Bert
On Sun, Aug 20, 2023 at 10:15?AM Paul Bernal <paulbernal07 at
2008 Apr 22
2
optimization setup
Hi, here comes my problem, say I have the following functions (example case)
#------------------------------------------------------------
function1 <- function (x, theta)
{a <- theta[1] ( 1 - exp(-theta[2]) ) * theta[3] )
b <- x * theta[1] / theta[3]^2
return( list( a = a, b = b )) }
#-----------------------------------------------------------
function2<-function (x, theta)
{P
2011 May 23
6
Reading Data from mle into excel?
Hi there,
I ran the following code:
vols=read.csv(file="C:/Documents and Settings/Hugh/My Documents/PhD/Swaption
vols.csv"
, header=TRUE, sep=",")
X<-ts(vols[,2])
#X
dcOU<-function(x,t,x0,theta,log=FALSE){
Ex<-theta[1]/theta[2]+(x0-theta[1]/theta[2])*exp(-theta[2]*t)
Vx<-theta[3]^2*(1-exp(-2*theta[2]*t))/(2*theta[2])
dnorm(x,mean=Ex,sd=sqrt(Vx),log=log)
}
2002 Sep 27
2
How to apply SSfpl with binary data
Dear R-help subscribers
Would you tell me how to apply SSfpl with binary data as below?
Unfortunately, there is not the EXAMPLE in help(SSfpl) for binary data but for quantitative data(Chick).
V1: dose
V2: log-transformed dose
V3: response (rate)
V1 V2 V3
1 0.775 -0.2548922 0.1666667
2 5.000 1.6094379 0.8148148
3 10.000 2.3025851 0.5000000
4 20.000 2.9957323
2011 Jul 09
3
Confusing piece of R code
m0<-epxression((4*theta1*theta2-theta3^2)/(2*x*theta3^2)-0.5*theta1*x)
params<-all.vars(m0) this reads all the params
from m0 so theta1,2 and 3 correct?
params<-params[-which(params=="x")] checks which params are multiplied
by x?
np<-length(params)
for(i in 1:6){
esp<-get(sprintf("m%d",i-1))