search for: theta2

Displaying 20 results from an estimated 61 matches for "theta2".

Did you mean: theta
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]]
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(theta1 = 0...
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
2008 Nov 26
1
Finding Stopping time
...ndex. 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) { z[l-p+1] <-...
2023 Aug 20
3
Issues when trying to fit a nonlinear regression model
...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 From Previo...
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 find...
2009 Nov 02
1
need help in using Hessian matrix
...(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<-matrix(Ti,ncol=1) c2<-matrix(Tj,ncol=1) cc<-data.frame(rbind(c1,c2))[,1] require(numDeriv) m1<- function(x) #a function that generates the estimates { loglik<-function(alpha,theta1,...
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
...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, >> >&gt...
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
...d: 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> >>...
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 something...
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 wont do the loop the problem is that I need to evaluate n1 which is the number of units in the first part. n1 could be dif...
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) (given...
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 : neg.log.gumbel(1,reqdI...
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(list(index =...
2007 Sep 12
1
enquiry
Dear R-help, I am trying to estimate a Cox model with nested effects basing on the minimization of the overall AIC; I have two frailties terms, both gamma distributed. There is a error message (theta2 argument misses) and I don?t understand why. I would like to know what I have wrong. Thank you very much for your time. fitM7 <- coxph(Surv(lifespan,censured) ~ south + frailty(id, dist='gamma')+ frailty(mob, dist='gamma'), data= usa) tempfun <- function(theta1, theta2...
2007 Jul 26
3
substituting dots in the names of the columns (sub, gsub, regexpr)
...ng two problems, related to the function sub, grep, regexpr and similia. The header of the file(s) I have to import is like this. c("y (m)", "BD (g/cm3)", "PR (Mpa)", "Ks (m/s)", "SP g./g.", "P (m3/m3)", "theta1 (g/g)", "theta2 (g/g)", "AWC (g/g)") To get rid of spaces and symbols in the names of the columns, I use read.table(... check.names=TRUE) and I get: str <- c("y..m.", "BD..g.cm3.", "PR..Mpa.", "Ks..m.s.", "SP.g..g.", "P..m3.m3.", &quot...
2011 May 23
6
Reading Data from mle into excel?
...ls.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) } OU.lik<-function(theta1,theta2,theta3){ n<-length(X) dt<-deltat(X) -sum(dcOU(X[2:n],dt,X[1:(n-1)],c(theta1,theta2,theta3),log=TRUE)) } require(stats4) require(sde) set.seed(1) #X<-sde.sim(model="OU",theta=c(3,1,2),N=10000,delta=1) mle(OU.lik,start=list(theta1=1,theta2=1,theta3=1), method="L-BFGS-B",...
2006 Oct 17
4
if statement error
Hi List, I was not able to make this work. I know it is a simple one, sorry to bother. Give me some hints pls. Thanks! Jen if(length(real.d)>=30 && length(real.b)>=30 && beta1*beta2*theta1*theta2>0 ) { r <- 1; corr <- 1; } real.d and real.b are two vectors, beta1,beta2,theta1,and theta2 are constants. The error occurred like this: Error in if (length(real.d) >= 30 && length(real.b) >= 30 && beta1 * beta2 * : missing value where TRUE/FALSE need...
2009 Oct 27
1
Poisson dpois value is too small for double precision thus corrupts loglikelihood
Hi - I have a likelihood function that involves sums of two possions: L = a*dpois(Xi,theta1)*dpois(Yi,theta2)+b*(1-c)*a*dpois(Xi,theta1+theta3)*dpois(Yi,theta2) where a,b,c,theta1,theta2,theta3 are parameters to be estimated. (Xi,Yi) are observations. However, Xi and Yi are usually big (> 20000). This causes dpois to returns 0 depending on values of theta1, theta2 and theta3. My first question is: is...
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 contain: (X,Y) # for example, SIGMA(1,1) I would like to replace the comma wit...