Displaying 20 results from an estimated 80 matches for "theta1".
Did you mean:
theta
2012 Feb 09
1
Constraint on one of parameters.
...o optimize for a set of parameters and want to set a
constraint on only one parameter. Here is my function. What I want to do is
estimate the parameters of a bivariate normal distribution where the
correlation has to be between -1 and 1. Would you please advise how to
revise it?
ex=function(s,prob,theta1,theta,xa,xb,xc,xd,t,delta) {
expo1= exp(s[3]*xa+s[4]*xb+s[5]*xc+s[6]*xd)
expo2= exp(s[9]*xa+s[10]*xb+s[11]*xc+s[12]*xd)
expo3= exp(s[15]*xa+s[16]*xb+s[17]*xc+s[18]*xd)
expo4= exp(s[21]*xa+s[22]*xb+s[23]*xc+s[24]*xd)
expo5= exp(s[27]*xa+s[28]*xb+s[29]*xc+s[30]*xd)
nume1=prob[1]*(s[2]^-s[1]*s[1]*t^...
2008 Jul 26
4
parametric bootstrap
Hi
I am trying to find a parametric bootstrap confidence interval and when I used the boot function I get zero bias and zero st.error? What could be my mistake?
Thank you and take care.
Laila
[[alternative HTML version deleted]]
2010 Nov 12
1
Problem retrieving data from R2InBUGS
Dear list
I am calling the functiton bugs() provided by R2WinBugs to performs an IRT analysis. The function returns a set of estimated parameters over n replications/iterations. For each replication, two sets of person measures (theta1 and theta2) and two sets of item difficulty parameters (diff1 and diff2) are returned. The code used to obtain these estimates is as follows:
sim <- bugs(data,init,model.file="drift.bugs",parameters=c("theta1","theta2","diff1","diff2"),n.chains=...
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 = -0.05538), data=mod14data2_random)
However, I got this error:
Error in nls(y ~ theta1 - theta2 * exp(-theta3 * x), start = list(t...
2008 Nov 26
1
Finding Stopping time
...irst stopping index.
E.g. If my first stopping index was 5. I want to set 6th observation from
the generated normal variables as the first random
number, and I stop at second stopping index.
This is my code,
alpha <- 0.05
beta <- 0.07
a <- log((1-beta)/alpha)
b <- log(beta/(1-alpha))
theta1 <- 2
theta2 <- 3
cumsm<-function(n)
{y<-NULL
for(i in 1:n)
{y[i]=x[i]^2}
s=sum(y)
return(s)
}
psum <- function(p,q)
{z <- NULL
for(l in p:q)
{...
2008 Jun 27
3
For loop
Hi,
Could you please let me know to use a list in a for loop here geneset is a
loop.I am trying to match the names of the list with 1st row of the output.
result<- list()
for(i in 1:length(output)
{
result[[i]] <- geneset(which(geneset %n% output[,1]))
}
Kindly help me out
--
View this message in context: http://www.nabble.com/For-loop-tp18163665p18163665.html
Sent from the R
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...
2004 Mar 30
0
koq.q ---- Kent O' Quigley R2
...out it
Yours Faithfully
Dr. Antonello Romani
Dipartimento di Medicina Sperimentale
Sezione di Patologia Molecolare e Immunologia
via Volturno 39
43100 Parma
Italy
#-----------------------------------------------------------------------------------------------
find.mu.alfa <- function(theta, theta1, x, ell, which,...)
{
#
# find theta=c(beta,mu,alfa) which maximize
# Expected Log-Likelihood given by ell
#
# Set lower and upper bounds for mu (-Inf,Inf)
# and alfa (0,Inf)
#
lower <- c(which, T, 0) * theta
lower[c(which, T, 0) == T] <- - Inf
upper <- c(which, T, T) * theta
upp...
2023 Aug 20
3
Issues when trying to fit a nonlinear regression model
...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 = "data.frame")
I did the following to try to fit a nonlinear regression model:
#First, Procedure to Find Starting (initial) Values For Theta1, Theta2, and
Theta3
mymod2 <- y ~ theta1 - theta2*exp(-theta3*x)
strt2 <- c(theta1 = 1, theta2 = 2, theta3 = 3)
trysol2<-nlxb(formula=mymod2, data=mod14data2_random, start=strt2,
trace=TRUE)
trysol2
trysol2$coefficients[[3]]
#Fitting nonlinear Regression Model Using Starting Values Fro...
2010 Sep 24
1
Fitting GLMM models with glmer
...I obtained the same results for parameters estimates and
standarderrors, by using:
glmer(cens ~ treat + heart + offset(log(SURVT) + (1 | INST),
data=liver, family=poisson)
After that, the authors present the same model, but now bi = log(gi)
where gi has the following gamma distribution:
f(gi | theta1) = gi ^ (1/theta1 - 1) exp(-gi/theta1)/
GAMMA(1/theta1)(theta1^(1/theta1)
They used a set of transformations proposed in the paper, and with the
following rotine fitted the model achieving
estimates for the same fixed parameters and for theta1:
proc nlmixed data=liver;
parms theta1 = 1 b0 = -2:8...
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
...of freedom
Multiple R-squared: 0.717, Adjusted R-squared: 0.696
F-statistic: 33 on 1 and 13 DF, p-value: 6.76e-05
Kind regards,
Paul
El dom, 20 ago 2023 a las 14:07, Bert Gunter (<bgunter.4567 at gmail.com>)
escribi?:
> 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,
>&...
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
...ed R-squared: 0.696
> F-statistic: 33 on 1 and 13 DF, p-value: 6.76e-05
>
> Kind regards,
> Paul
>
> El dom, 20 ago 2023 a las 14:07, Bert Gunter (<bgunter.4567 at gmail.com>)
> escribi?:
>
>> 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>...
2008 Apr 22
4
how to convert non numeric data into numeric?
I am having the following error in my function
function(theta,reqdIRR)
{
theta1<-theta[1]
theta2<-theta[2]
n<-length(reqdIRR)
constant<- n*(theta1+theta2)
sum1<-lapply(reqdIRR*exp(theta1),FUN = sum)
sum2<-lapply(exp(theta2 - reqdIRR*exp(theta1)),FUN = sum)
sum = sum1 + sum2
log.fcn = constant - as.numeric(sum)
result = - log.fcn
return(result)
}
*error : ne...
2009 Nov 02
1
need help in using Hessian matrix
...to find the Hessian matrix for a complicated function from a certain
kind of data but i keep getting this error
Error in f1 - f2 : non-numeric argument to binary operator
the data is given by
U<-runif(n)
Us<-sort(U)
tau1<- 2
F1tau<- pgamma((tau1/theta1),shape,1)
N1<-sum(Us<F1tau)
X1<- Us[1:N1]
Ti<- theta1*qgamma(Us[1:N1],shape,1)
w=N1+1
V<- Us[w:r]
N2<- length(V)
V1<-theta2*qgamma(V,shape,1)
Tj<-V1+tau1-(theta2/theta1)*tau1
c1<-mat...
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 optim. Is there another method/package that I should use for
this?
Also, I wonder if there's a more elegant way to code this equation in R;
right now my function looks s...
2006 Apr 01
1
Nested error structure in nonlinear model
I am trying to fit a nonlinear regression model to data. There are
several predictor variables and 8 parameters. I will write the model as
Y ~ Yhat(theta1,...,theta8)
OK, I can do this using nls() - but "only just" as there are not as many
observations as might be desired.
Now the problem is that we have a factor "Site" and I want to include a
corresponding error component. I tried something like (excuse the
doctored R output...
2008 Jul 03
0
FW: For loop
HiI have a specific sample coming from a gamma(alpha,theta1) distribution and then divided into two parts first part follows a gamma(alpha,theta1) the second is gamma(alpha,theta2) then I would like to find the mle`s for theta1 and theta2 which I found. Now I would like to simulate those estimates 500 or 1000 times.I tried for loop but it did not work It wo...
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 gmail.com> wrote:
> Dear friends,
>
> This is the dataset I am currently working with:
> >dput(mod14data2_random)
> structure(l...
2012 Mar 14
1
Metropolis-Hastings in R
...and have
finally given up trying to do it on my own as I'm beginning to run out of
time for this, would somebody please tell me what is wrong with my latest
attempt:
n=100
mu=0
sigma=1
lik<-function(theta) exp(((theta-mu)^2)/2*sigma)
alpha<-function(theta,phi) min(lik(phi)/lik(theta),1)
theta1<-matrix(0,n,2)
theta1[1,]<-mu
for(i in 2:n){
theta<-theta1[i-1,]
phi<-theta+runif(-0.5,0.5)
k<-rbinom(1,1,alpha(theta,phi))
k1<-k1+k
theta1[i,]<-theta+k*(phi-theta)
}
plot(theta1)
Thanks alot :)
-Mike
--
View this message in context: http://r.789695.n4.nabble.com/Metropolis-...
2008 Apr 22
2
optimization setup
...)) }
#-----------------------------------------------------------
function2<-function (x, theta)
{P <- function1(x, theta)
c <- P$a * x * exp(-theta[2])
d <- P$b * exp(x)
q <- theta[1] / theta[3]
res <- c + d + q; res}
# Function to be optimized
function3 <- function(theta1,theta2,theta3) {
n <- length(data)
-sum( function2(x = data[2:n], theta = c(theta1, theta2, theta3) ))}
# 'data' is my input ts class object
#--------------------------------------------------------------------------------------
Then I want to maximize function3 with respect to theta(s)...