search for: tau2

Displaying 20 results from an estimated 24 matches for "tau2".

Did you mean: tau
2012 Jul 11
2
nls problem: singular gradient
...<- 0.5 tau1 <- 0.02 # generate yy(t) yy <- 1/2 * ( 1- tanh((t - t0)/smallc) * exp(-t / tau1) ) + rnorm(length(t))*0.01 # show the curve plot(x=t, y=yy, pch=18) # prepare data dd <- data.frame(y=yy, x=t) nlsfit <- nls(data=dd, y ~ 1/2 * ( 1- tanh((x - ttt)/smallc) * exp(-x / tau2) ), start=list(ttt=0.4, tau2=0.1) , trace=TRUE) # get error: # Error in nls(data = dd, y ~ 1/2 * (1 - tanh((x - ttt)/smallc) * exp(-x/tau2)), : # singular gradient -- Jonas Stein <news at jonasstein.de>
2013 Apr 09
0
[R-SIG-Finance] EM algorithm with R manually implemented?
...pi2<-0.5 > mu1<--0.01 > mu2<-0.01 > sigma1<-0.01 > sigma2<-0.02 > loglik[1]<-0 > loglik[2]<-sum(pi1*(log(pi1)+ > log(dnorm(dat,mu1,sigma1))))+sum(pi2*(log(pi2)+log(dnorm(dat,mu2,sigma2)))) > > > > tau1<-0 > tau2<-0 > k<-1 > > # loop > while(abs(loglik[k+1]-loglik[k])>= 0.00001) { > > # E step > > tau1<-pi1*dnorm(dat,mean=mu1,sd=sigma1)/(pi1*dnorm(x,mean=mu1,sd=sigma1)+pi2*dnorm(dat,mean=mu2,sd=sigma2)) > > tau2<-pi2*dnorm(dat,mean=mu2,sd=sigma2)/...
2012 May 05
3
metafor
Dear users of metafor, I am working on a meta-analysis using the metafor package. I have a excel csv database that I am working with. I am interested in pooling the effect measures for a particular subgroup (European women) in this csv database. I am conducting both sub-group and meta-regression. In subgroup-analyses, I have stratified the database to create a separate csv file just for European
2012 Aug 01
1
optim() for ordered logit model with parallel regression assumption
...readin[myvars] # remove all missings mydta <- na.omit(mydta) # theta is the parameter vector ologit.lf <- function(theta, y, X) { n <- nrow(X) k <- ncol(X) # b is the coefficient vector for independent variables b <- theta[1:k] # tau1 is cut-point 1 tau1 <- theta [k+1] # tau2 is cut-point 2 tau2 <- theta [k+2] # tau3 is cut-point 1 tau3 <- theta [k+3] if (y == 1){ p <- (1/(1+exp( - tau1 + X %*% b))) } if (y == 2) { p <- (1/(1+exp( - tau2 + X %*% b))) - (1/(1+exp( - tau1 + X %*% b))) } if (y == 3) { p <- (1/(1+exp( - tau3 + X %*%...
2009 Dec 04
1
z to r transformation within print.rma.uni and forest from the package metafor
...mods=NULL, data=dm, intercept=TRUE, slab=c(dm$Article, dm$StudyNo), subset=NULL, measure="ZCOR", add=1/2, to="only0", vtype="LS", method="DL", weighted=TRUE, level=95, digits=4, btt=NULL, tau2=NULL, knha=FALSE, control=list()) With PosOutc being the column containing the raw correlations and N being the column with the sample sizes. I assume that this will imply that a) although the 'tau2' value is set to NULL, still a random-effects analysis is calculated b) the raw c...
2011 Feb 26
0
A problem about realized garch model
...fter I simulate data from the model and estimate the data, I can't get precise estimation for my setting parameters. This is my simulation code: ======================= sim<-function(theta) { omega = theta[1] bet = theta[2] gam = theta[3] xi = theta[4] phi = theta[5] tau1 = theta[6] tau2 = theta[7] sigma.u = theta[8] n = theta[9] n.warm = 500 n = n+n.warm z = rnorm(n+1) u = rnorm((n+1),0,sigma.u) logh.pre = 1 logx.pre = xi+phi*logh.pre+tau1*z[1]+tau2*(z[1]^2-1)+u[1] logh = c(logh.pre,rep(0,n)) r = c(rep(0,(n+1))) logx = c(logx.pre,rep(0,n)) for(i in 2:(n+1)) { logh[i...
2007 Mar 12
4
meta-regression, MiMa function, and R-squared
Dear Wolfgang Viechtbauer and list members: I have discovered your "MiMa" function for fitting meta-analytic mixed-effects models through an earlier discussion on this list. I think it is extremely useful and fills an important gap. In particular, since it is programmed so transparently, it is easy to adapt it for one's own needs. (For example, I have found it easy to identify
2003 Jun 01
0
integrate
Im tryng to understand an error i get with integrate. this is 1.7.0 on solaris 2.8. ##i am trying to approximate an integral of this function, f<-function(b) exp(-(b-mu)^2/(2*tau2))/(p-exp(b))*10^6 ##with tau2 <- .005;mu <- 7.96;p <- 2000 ##from -inf to different upper limits. using integrate(f,-Inf,log(p-exp(1))) ##i get the following error: ##Error in integrate(f, -Inf, log(p - exp(1))) : ## the integral is probably divergent ##whats confusing is that i only g...
2008 Apr 04
1
Problems with Unit Root testing using ur.df function
...<- lm(z.diff ~ z.lag.1 + 1 + z.diff.lag) tau <- coef(summary(result))[2, 3] phi1.reg <- lm(z.diff ~ -1 + z.diff.lag) phi1 <- anova(phi1.reg, result)$F[2] teststat <- as.matrix(t(c(tau, phi1))) colnames(teststat) <- c('tau2', 'phi1') } if (type == "trend") { result <- lm(z.diff ~ z.lag.1 + 1 + tt + z.diff.lag) tau <- coef(summary(result))[2, 3] phi2.reg <- lm(z.diff ~ -1 + z.diff.lag) phi3.reg <- lm(z.diff ~ z.diff.lag)...
2008 Mar 25
3
derivatives in R
Hi, I posted this message earlier in "Rmetrics" and I don't know whether I posted in the wrong place, so I'm posting it again in Rhelp. I have a function in x and y and let's call it f(x,y). I need to get the Hessian matrix. i.e I need (d^2f/dx^2), (d^2f/dxdy), (d^2f/dydx), (d^2f/dy^2).I can get these using the D function. now I need to evaluste the hessian matrix for
2012 Jul 12
0
Generate random numbers with nested Archimedean Copula
...theta2 x1 x2 x3 I try to follow McNeil (2006) http://www.ma.hw.ac.uk/~mcneil/ftp/NestedArchimedean.pdf with R as the programming language. My code so far is as follows: n = 10000 #parent tau1 = 0.60 theta1 = (2*tau1)/(1-tau1) #child tau2 = 0.80 theta2 = (2*tau2)/(1-tau2) #parent V1 = rgamma(n, 1/theta1,1) #child V2 = rgamma(n, 1/theta2,1) u1 = runif(n) u2 = runif(n) u3 = runif(n) u = cbind(u2,u3) #Create bivariate child copula u.inner = (1-log(u)/V2)^(-1/theta2) #Child inner generator u.inner2 =exp(V1 - V1*(1 + (-log(u.inner)...
2012 Feb 03
1
A question on Unit Root Test using "urca" toolbox
...?*? 0.05 ?.? 0.1 ? ? 1 Residual standard error: 0.9526 on 109 degrees of freedom Multiple R-squared: 0.2514, Adjusted R-squared: 0.2171 F-statistic: 7.321 on 5 and 109 DF, p-value: 5.989e-06 Value of test-statistic is: -2.4746 3.0877 Critical values for test statistics: 1pct 5pct 10pct tau2 -3.46 -2.88 -2.57 phi1 6.52 4.63 3.81 > CPILD4UR<-ur.df(x1$CPILD4[5:nr1], type ="drift", lags=12, selectlags ="BIC") > summary(CPILD4UR) ############################################### # Augmented Dickey-Fuller Test Unit Root Test # ################################...
2017 Jun 04
0
Hlep in analysis in RWinBugs
...rm the analysis. I wonder whether I can run the following the example data and Winbugs Model in R. Your help will be highly appreciated. Sincerely, SN PANDIT === library(R2WinBUGS) #Model model{ #likelihood for(i in 1:N){ a1[i] ~ dnorm(a11[i],tau) 2[i] ~ dnorm(a21[i],tau1) a3[i] ~ dnorm(a31[i],tau2) a11[i]<-sm[i]*S1*m1 a21[i]<-sm[i]*S1*(1-m1)*S2*m2 a31[i]<-sm[i]*S1*(1-m1)*S2*(1-m2)*S3 sum[i]<-a11[i]+a21[i]+a31[i] } #priors #priors are dbeta(0.5,0.5), uniform is dbeta(1,1) S1~dbeta(1,1)#I(0,0.2) # S2~dbeta(1,1)#I(0.15,0.5) # S3~dbeta(1,1)#I(0.3,1) m1~dbeta(1,1)#I(0.01,1) m2~dbeta...
2017 Jun 04
0
Help in analysis in RWinBugs
...rm the analysis. I wonder whether I can run the following the example data and Winbugs Model in R. Your help will be highly appreciated. Sincerely, SN PANDIT === library(R2WinBUGS) #Model model{ #likelihood for(i in 1:N){ a1[i] ~ dnorm(a11[i],tau) 2[i] ~ dnorm(a21[i],tau1) a3[i] ~ dnorm(a31[i],tau2) a11[i]<-sm[i]*S1*m1 a21[i]<-sm[i]*S1*(1-m1)*S2*m2 a31[i]<-sm[i]*S1*(1-m1)*S2*(1-m2)*S3 sum[i]<-a11[i]+a21[i]+a31[i] } #priors #priors are dbeta(0.5,0.5), uniform is dbeta(1,1) S1~dbeta(1,1)#I(0,0.2) # S2~dbeta(1,1)#I(0.15,0.5) # S3~dbeta(1,1)#I(0.3,1) m1~dbeta(1,1)#I(0.01,1) m2~dbeta...
2010 Nov 30
1
confidence interval for logistic joinpoint regression from package ljr
...niques and see if they are close 2)present the annual percent change (APC) for each of the intervals, ie my present data (1950-2010 in 5 year intervals) is giving me Variables Coef b0 Intercept -131.20404630 g0 t 0.06146463 g1 max(t-tau1,0) -0.51582466 g2 max(t-tau2,0) 0.43429615 Joinpoints: 1 tau1= 1990.5 2 tau2= 1995.5 APC 1950->1990=exp(0.06)=1.06-->6% 1990-1995=exp(0.06-0.51)=exp(-0.45)=0.63--> -37% 1995-2010=exp(0.06-0.51+0.43)-->-2% 3) Preferably a confidence interval for the APC should be given. However, this I havent fi...
2006 Jun 12
0
New version of Subselect package
...("anneal") and a modified local search algorithm ("improve"). Previous versions of subselect had three criteria for optimality ("rm", "rv" and "gcd"), based on exploratory data analysis considerations. This new version adds four new criteria ("tau2", "zeta2", "xi2" and "ccr12"), associated with the multivariate linear hypothesis and the well-known test statistics for that hypothesis (Wilks' lambda, Roy's largest root, Pillai's trace and the Hotelling-Lawley statistic). Subselect 0.9-99 also inclu...
2006 Jun 12
0
New version of Subselect package
...("anneal") and a modified local search algorithm ("improve"). Previous versions of subselect had three criteria for optimality ("rm", "rv" and "gcd"), based on exploratory data analysis considerations. This new version adds four new criteria ("tau2", "zeta2", "xi2" and "ccr12"), associated with the multivariate linear hypothesis and the well-known test statistics for that hypothesis (Wilks' lambda, Roy's largest root, Pillai's trace and the Hotelling-Lawley statistic). Subselect 0.9-99 also inclu...
2010 Apr 14
0
ur.df ADF Unit Root Test: what is the meaning of phi1 and phi2 test statistic?
...t;) { result <- lm(z.diff ~ z.lag.1 + 1) phi1.reg <- lm(z.diff ~ -1) phi1 <- anova(phi1.reg, result)$F[2] tau <- coef(summary(result))[2, 3] teststat <- as.matrix(t(c(tau, phi1))) colnames(teststat) <- c("tau2", "phi1") } if (type == "trend") { result <- lm(z.diff ~ z.lag.1 + 1 + tt) phi2.reg <- lm(z.diff ~ -1) phi3.reg <- lm(z.diff ~ 1) phi2 <- anova(phi2.reg, result)$F[2] phi3 <- anova(ph...
2009 Feb 21
0
density estimation for d>2 for the DPpackage
...110), sigma=sigma) rnormm<-rbind(rnormm,rnormm2) #with the following priors # Prior information s2<-matrix(c(2,0,0,0,2,0,0,0,2),ncol=3) m2<-c(5,10,15) psiinv2<-solve(matrix(c(10000,0,0,0,1,0,0,0,2),ncol=3)) prior<-list(a0=1,b0=1/5,nu1=4,nu2=4,s2=s2, m2=m2,psiinv2=psiinv2,tau1=0.01,tau2=0.01) state <- NULL # MCMC parameters nburn<-1000 nsave<-5000 nskip<-10 ndisplay<-1000 mcmc <- list(nburn=nburn,nsave=nsave,nskip=nskip,ndisplay=ndisplay) # Fit the model fit3<-DPdensity(y=rnormm,mcmc=mcmc, prior=prior, state=state,status=TRUE,na.action=na.omit) All is fin...
2012 Feb 07
0
A question on p-value of Unit Root Tests using “urca” toolbox
...m = FALSE) To my knowledge, “c” means “const” or intercept, “nc” means no const or intercept, and “ct” means time trend with an intercept. What does “ctt” mean? Isn’t punitroot a function of lag period? Why isn’t lag an input of the function? BTW, in the output of the unit root test, does “tau2” means t statistic? Thank you for your attention! [[alternative HTML version deleted]]