similar to: "hubers" function in R MASS library : problem and solution

Displaying 20 results from an estimated 900 matches similar to: ""hubers" function in R MASS library : problem and solution"

2007 Jan 19
1
Suggestion on how to improve efficiency when using MASS:::hubers on high-dimensional arrays
Hi Everyone, Given the scenario I have, I was wondering if anyone would be able to give me a hind on how to get the results from hubers() in a more efficient way. I have an outcome on an array [N x S x D]. I also have a factor (levels 1,2,3) stored on a matrix N x S. My objective is to get "mu" and "sigma" for each of the N rows (outcome) stratified by the factor
2008 Dec 31
2
function of mixture normal with covariates
Hello, My name is Julia and I'm doing my phd on roc analysis. I'm trying to write a maximization function for the likelihood attached in the document. For some reason it's not working I keep getting \this error: Error: unexpected symbol in: " +log(v_pred)) return" > } Error: unexpected '}' in "}" > >
2010 Jul 18
2
loop troubles
Hi all, I appreciate the help this list has given me before. I have a question which has been perplexing me. I have been working on doing a Bayesian calculating inserting studies sequentially after using a non-informative prior to get a meta-analysis type result. I created a function using three iterations of this, my code is below. I insert prior mean and precision (I add precision manually
2009 May 03
3
Optim function in the loop
Hi all, I wrote the following lines of codes try to do some iterations to find the global optimal values, but the function does not execute properly. Every time codes stop after one iteration right after executing the optim() function. Does anyone could have me to take a look? Thanks. if (count>0){ k=k+0.05; mu0=c(83+k,0,0) Sigma0= diag(0.4,3) initpar=c(.1+10*k,10*k,10*k,10*k) # initial
2009 Aug 20
1
Understanding R code
What is 1. par.ests <- optimfit$par 2. fisher <- hessb(negloglik, par.ests, maxvalue=maxima); 3. varcov <- solve(fisher); 4. par.ses <- sqrt(diag(varcov)); Thanks a lot, fit.GEV <- function(maxima) { sigma0 <- sqrt((6. * var(maxima))/pi) mu0 <- mean(maxima) - 0.57722 * sigma0 xi0 <- 0.1 theta <- c(xi0, mu0, sigma0) #10/5/2007: removed assign() for maxima.nl
2010 Nov 30
1
StructTS with 2 seasons
Dear All, I am trying to fit a structural time series model using the StructTS function (package stats) with only 2 seasons (summer and winter). More than 2 seasons work fine but with 2 seasons I get this error: > fit <- StructTS(y.ts, type="BSM") Error in T[cbind(ind + 1L, ind)] <- 1 : subscript out of bounds I have looked at Prof. Ripley's 2002 RNews article but cannot
2007 Mar 09
1
MCMC logit
Hi, I have a dataset with the binary outcome Y(0,1) and 4 covariates (X1,X@,X#,X$). I am trying to use MCMClogit to model logistic regression using MCMC. I am getting an error where it doesnt identify the covariates ,although its reading in correctly. The dataset is a sample of actual dataset. Below is my code: > ####################### > > > #retreive data > # considering four
2003 Apr 03
1
Tukey's one degree of freedom for nonadditivity?
Is there code available to decompose interactions involving at least one nominal factor with more than 2 levels as described, e.g., by Tukey or by Mandel (1971, Technometrics, 13: 1-18)? Tukey's model: E(y[i,j]) = mu0 + a[i] + b[j] + c*a[i]*b[j], estimating a, b, and c so sum(a) = sum(b)= 0. Mandel essentially describes a singular value decomposition of the interaction. Thanks,
2007 Dec 28
1
unit attribute to list elements
Hi, I've started my own (first) package, part of which consists in listing common physical constants (Planck's constant, the speed of light in vacuum, etc). I'm wondering what would be a good way of dealing with pairs of value/unit. > constants <- list( cel = 2.99792458e8 , #m/s > Z0 = 376.730313461, #ohm > eps0 = 8.854187817e-12,#F/m > mu0 = 4*pi*1e-7,#N/A^2
2007 Oct 14
1
Adjusting for heaping in data
Hi R users. I am new to the community and have got myself into a little problem. I have a dataset of birth weights recorded by nurses at a delivery clinic in an developing country. The weights are entered in KiloGrams with one decimal. However there is substantial heaping at each 500g when looking at the sample in a histogram. Do anyone of you know a easy way to adjust for this and if it exists
2013 Apr 09
3
Remove data 3 standard deviatons from the mean using R?
Hi Everyone, I have a very long list of data-points (+2300) and i know from my histogram that there are outliers which are affecting my mean. I was wondering if anyone on here knows a way i can quickly get R to calculate and remove data which is 3 standard deviations from the mean? I am hoping this will tidy my data and give me a repeatable method of tidying for future data collection.
2004 Nov 25
0
help with error message
Before I receive a barrage of 'try looking in the help file' messages, I have and to no avail. For a new user of R I would like to point out that in order to be able to use the help files/manuals effectively one must know the correct question and that only comes with using R! Could someone please direct me to why I keep getting the following error message "Error: subscript out of
2004 Nov 25
0
help with error message - problem solved
Apologies to the listing, the problem was with the data set and not the code Thanks Michael Griffiths, Ph.D. Chemometrician Training, Quality and Statistics Group LGC Limited Queens Road Teddington Middlesex, TW11 0LY, UK Tel: +44 (0)20 8943 7352 Fax: +44 (0)20 8943 2767 e-mail: michael.griffiths at lgc.co.uk >>> "Michael Griffiths" <Michael.Griffiths at lgc.co.uk>
2012 Nov 22
1
help in M-estimator by R
hi guys and gals ... How are you all ... i have to do something in robust regression by R programm , and i have some problems as following: *the first :* suppose w(r) =1/(1 r^2) and r <- c(7.01,2.07,7.061,5.607,8.502,54.909,12.222) and i want to exclude some values from r so that (abs(r)>4.9 )... after ,i want to used (w) to get on coefficients beta0 and beta1 (B1 <-
2004 Dec 02
3
R and Fortran in Windows
I just joined the list and appologize if this has been answered before but I am trying to interface between R and the Compaq Visual Fortran compiler version 6.6 for Windows. I found the following instructions on the web -- and an example. When I follow these directions exactly. R 2.0.0 crashes. Has anyone had any experience with this? Below are the instructions that I located: Thanks Dan
2010 Sep 21
2
Trouble with Optimization in "Alabama" Package
Hello, This is my first post to the help request list, so I'm going to err on the side of giving too much information. I'm working on writing a simulation in which agents will make repeated production and exchange decisions with randomly chosen partners. The idea is, all agents can produce two goods which they want to consume, they choose a value t in [0,10] which sets their production
2005 Dec 22
1
Huber location estimate
We have a choice when calculating the Huber location estimate: > set.seed(221205) > y <- 7 + 3*rt(30,1) > library(MASS) > huber(y)$mu [1] 5.9117 > coefficients(rlm(y~1)) (Intercept) 5.9204 I was surprised to get two different results. The function huber() works directly with the definition whereas rlm() uses iteratively reweighted least squares. My surprise is
2008 Nov 19
1
How to get robust M-estimator of multivariate scatter using Huber's psi?
How to get robust M-estimators of multivariate scatter using Huber's psi? Which package/function should I look into? Ideally, I hope I can self-define thresholds of Huber's psi function. Thanks a lot!!! -- View this message in context: http://www.nabble.com/How-to-get-robust-M-estimator-of-multivariate-scatter-using-Huber%27s-psi--tp20585755p20585755.html Sent from the R help mailing
2000 Aug 22
0
Using RNG from MS [forwarded message from Xiaoqiang Li]
This had a VERY WRONG `To:' address and went straight into my "spam box" into which I don't look too often .. Martin ------- start of forwarded message ------- Message-ID: <Pine.A41.4.05.10008212237300.18590-100000 at fisher.stats.uwo.ca> MIME-Version: 1.0 From: Xiaoqiang Li <lxq at stats.uwo.ca> To: Majordomo-Owner at stat.math.ethz.ch Subject: r-help Date: Mon,
2001 Aug 23
1
location.m in R?
Hi. I'm looking for the robust M estimates comparable to "location.m" in S-PLUS? Alternatively, I guess I could use > lqs(x~1) But ... is "location.m" in a package? Thanks, M. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info",