search for: varstruct

Displaying 18 results from an estimated 18 matches for "varstruct".

Did you mean: rstruct
2006 Jan 09
1
trouble with extraction/interpretation of variance structure para meters from a model built using gnls and varConstPower
...data=data,weights=varConstPower(const=1,power=0,form= ~fitted(.)))); #Examine results model3; #const = .6551298, power = .8913665 summary(model3); #const = .6551298, power = .8913665 coef(model3$modelStruct$varStruct)["power"]; # power = .8913665 coef(model3$modelStruct$varStruct)["const"]; #const = -0.4229219 coef.varFunc(model3$modelStruct$varStruct); #R can't seem to find this function, Splus can Any advice on what I am doing wrong would be appreciated....
2006 Feb 17
0
trouble with extraction/interpretation of variance struct ure para meters from a model built using gnls and varConstPower
...df.com] Sent: Sunday, January 15, 2006 6:41 PM To: Rand, Hugh Cc: 'r-help at lists.R-project.org' Subject: Re: [R] trouble with extraction/interpretation of variance structure para meters from a model built using gnls and varConstPower How about this: > exp(coef(model3$modelStruct$varStruct)["const"]) const 0.6551298 Does that answer the question about not understanding the connection between summary(model3) and coef(model3$modelStruct$varStruct)["const"]? Regarding the question about R not being able to find 'coef.varFunc', I tried the follo...
2003 Mar 31
1
nonpos. def. var-cov matrix
R 1.6.2 for Windows, Win2k: I have fitted a weighted least squares model using the code "wls.out <- gls(y ~ x1 + x2 + x3 + x4 + x5 + x6 - 1, data = foo.frame, weights = varConstPower(form = ~ fitted(.), fixed = list(power = 0.5), const = 1))" The data has 62 rows and the response is zero when the covariates are zero. The purpose of the model was to account for the the fact that
2010 Oct 15
2
How to extract parameter estimates of variance function from lme fit
...ated data, we use varConstPower ( constant plus power variance function). fm<-lme(UPDRS~time,data=data.simula,random=~time,method="ML",weights=varConstPower(fixed=list(power=1))) I extract the results of this function by using the following codes: y<-summary(fm) x<-y$modelStruct$varStruct > x Variance function structure of class varConstPower representing const power 1.184535e-15 1.000000e+00 These are the constants and power that apppear in the summary(fm), and that I want to extract. Hower I got different value of const when extracting from x: > x$const...
2006 Jun 01
2
Help: lme
...essian matrix is not positive definite or something like that (i am not quite sure), the intervals function delivers an error message. Thus, i will like to ask if there is another way to access these values. I tried using the following code: hh$modelStruct$corStruct[1] hh$modelStruct$varStruct[1] Rather the output was: > hh$modelStruct$corStruct[1] [1] -1.308580 > hh$modelStruct$varStruct[1] [1] -0.03124255 I presume there is a way to calculate the correlation and variance function coefficients using these values. Could you tell me how to access those value...
2006 May 30
1
Query: lme output
...essian matrix is not positive definite or something like that (i am not quite sure), the intervals function delivers an error message. Thus, i will like to ask if there is another way to access these values. I tried using the following code: hh$modelStruct$corStruct[1] hh$modelStruct$varStruct[1] Rather the output was: > hh$modelStruct$corStruct[1] [1] -1.308580 > hh$modelStruct$varStruct[1] [1] -0.03124255 I presume there is a way to calculate the correlation and variance function coefficients using these values. Could someone tell me how to access those v...
2010 Mar 09
0
varComb in gls/lme
...alpha0=0.1 alpha1=3 m=200 n=200 c0=-2.413; nu0=-0.2; nu1=0.3 simu.dat=simulate.pilot(m, mn, sigma, alpha0, alpha1, c0, nu0, nu1) fit1=try(gls(Y~W, data=simu.dat, weights=varComb(varExp(form=~W), varExp(form=~I(W^2))))) c0.hat= log(fit1$sigma^2) nu0.hat=2*fit1$modelStruct$varStruct$A[1] nu1.hat=2*fit1$modelStruct$varStruct$B[1] > c0.hat [1] -1.570104 > nu0.hat [1] -0.787264 > nu1.hat [1] 0.4057129 > Thanks Xuesong CONFIDENTIALITY NOTICE: This e-mail message, including a...{{dropped:12}}
2010 Mar 15
0
question regarding variance function in gls
...sigma=sqrt(0.5) alpha0=0.1 alpha1=3 m=200 n=200 c0=-2.413; nu0=-0.2; nu1=0.3 simu.dat=simulate.pilot(m, mn, sigma, alpha0, alpha1, c0, nu0, nu1) fit1=try(gls(Y~W, data=simu.dat, weights=varComb(varExp(form=~W), varExp(form=~I(W^2))))) c0.hat= log(fit1$sigma^2) nu0.hat=2*fit1$modelStruct$varStruct$A[1] nu1.hat=2*fit1$modelStruct$varStruct$B[1] > c0.hat [1] -1.570104 > nu0.hat [1] -0.787264 > nu1.hat [1] 0.4057129 > Thanks Xuesong
2010 Jun 24
1
Question on WLS (gls vs lm)
...hought that maybe optimum weights from gls might be used as weights in lm (as shown below), but apparently this is not the case. See: library(nlme) f1 <- gls(Petal.Width ~ Species / Petal.Length, data = iris, weights = varIdent(form = ~ 1 | Species)) aa <- attributes(summary(f1)$modelStruct$varStruct)$weights f2 <- lm(Petal.Width ~ Species / Petal.Length, data = iris, weights = aa) summary(f1)$tTable; summary(f2) So, the two models with the very same weights do differ (in terms of standard errors). Could you please explain why? Are these different types of weights? Many thanks in advance,...
2007 Oct 17
2
nmle: gnls freezes on difficult case
...version.string R version 2.6.0 (2007-10-03) start=c(-1.5, 9.5, 0.09, 10.25) names(start)<-c("A","B","xmid","scal") gnls(response~SSllogis(conc,A,B,xmid,scal),tdat,start=start,weights=varPower(),verbose=TRUE) **Iteration 1 GLS step: Objective: NULLvarStruct parameters: power 0.3373199 NLS step: RSS = 0 model parameters:-0.799941 8.99983 -0.522623 212.314 iterations: 2 Convergence: params varStruct 1.172208 1.000000 ### After about 10 min hit cntrl C Warning messages: 1: In log(xmid) : NaNs produced 2: In log(xmid) : NaNs pro...
2011 Aug 17
1
contrast package with interactions in gls model
...ts levels) I used function contrast (package contrast) whit following script to probe the hypotesis 1.: con<-contrast(FINAL, list(Lugar= 'Xmatkuil', Tra=1), list(Lugar='Xmatkuil', Tra = 0)) but i found this error message: Error en gendata.default(fit = list(modelStruct = list(varStruct = c(-0.253689933940456, : not enough factors I would be grateful if somebody tell me I'm doing wrong with my contrast function script. Thanks in advance, Marylin Bejarano PHd candidate in Ecology Institute of Mexico's National Autonomous University [[alternative HTML version delete...
2006 Mar 07
1
lme and gls : accessing values from correlation structure and variance functions
...------------------------------------------------------------------------------------------------- Can somebody tell me how to access the values in blue above? Also, when i tried accessing these values i obtained the following bm$modelStruct corStruct parameters: [1] -1.394879 varStruct parameters: [1] 0.5680815 What do these values represent. Thanks in advance.. Pryseley sample data: RowNames Trial subject VISUAL0 TRT VISUAL24 VISUAL52 TREAT outcome endpoint trt 4 1 1003 65 4 65 55 2 0 1 1 8 1...
2004 Oct 28
0
Auxilliary args in gls
...mula. It should not be part of the data frame, as it is a vector of a different length. How can this be done? The gls() code suggests it may be difficult to keep the auxillary arg out of the model.frame but in the evaluation frame of the formula: glsSt <- glsStruct(corStruct = correlation, varStruct = varFunc(weights)) mfArgs <- list(formula = asOneFormula(formula(glsSt), model, groups), data = data, na.action = na.action) if (!missing(subset)) { mfArgs[["subset"]] <- asOneSidedFormula(Call[["subset"]])[[2]] } mfArgs$drop.unused.levels...
2007 Jun 25
3
Bug in getVarCov.gls method (PR#9752)
...to eliminate the >method entirely. Any objections to my doing that? > >The method is currently defined as > >getVarCov.gls <- > function(obj, individual = 1, ...) >{ > S <- corMatrix(obj$modelStruct$corStruct)[[individual]] > if (!is.null( obj$modelStruct$varStruct)) > { > ind <- obj$groups==individual > vw <- 1/varWeights(obj$modelStruct$varStruct)[ind] > } > else vw <- rep(1,nrow(S)) > vars <- (obj$sigma^2)*vw > result <- t(S * sqrt(vars))*sqrt(vars) > class(result) <- c(&...
2007 Nov 27
2
lme object manipulation
Hello: I have an lme object, say lme_res2, which was generated using the varIdent. I'm trying to extract the double 1.532940 from the object, but I can't find it by attributes(lme_res2) or attributes(summary(lme_res2)). How can I pull it out (so that I can save it to another variable)? Thanks. Shin Linear mixed-effects model fit by REML Data: dat Log-restricted-likelihood:
2003 Mar 04
2
How to extract R{i} from lme object?
Hi, lme() users, Can some one tell me how to do this. I model Orthodont with the same G for random variables, but different R{i}'s for boys and girls, so that I can get sigma1_square_hat for boys and sigma2_square_hat for girls. The model is Y{i}=X{i}beta + Z{i}b + e{i} b ~ iid N(0,G) and e{i} ~ iid N(0,R{i}) i=1,2 orth.lme <- lme(distance ~ Sex * age, data=Orthodont, random=~age|Subject,
2004 Apr 05
3
2 lme questions
Greetings, 1) Is there a nice way of extracting the variance estimates from an lme fit? They don't seem to be part of the lme object. 2) In a series of simulations, I am finding that with ML fitting one of my random effect variances is sometimes being estimated as essentially zero with massive CI instead of the finite value it should have, whilst using REML I get the expected value. I guess
2006 Mar 08
0
survival
...-------------------------------------------------------------------- ---------------------------- Can somebody tell me how to access the values in blue above? Also, when i tried accessing these values i obtained the following bm$modelStruct corStruct parameters: [1] -1.394879 varStruct parameters: [1] 0.5680815 What do these values represent. Thanks in advance.. Pryseley sample data: RowNames Trial subject VISUAL0 TRT VISUAL24 VISUAL52 TREAT outcome endpoint trt 4 1 1003 65 4 65 55 2 0 1 1 8 1...