Re: [R] always about positive definite matrix

2011-02-04 Thread spencerg
1. Martin Maechler's comments should be taken as replacements for anything I wrote where appropriate. Any apparent conflict is a result of his superior knowledge. 2. 'eigen' returns the eigenvalue decomposition assuming the matrix is symmetric, ignoring anything in

Re: [R] Fortune candidate! Re: new to R Project

2010-02-23 Thread spencerg
On 2/23/2010 5:07 AM, Cedrick Johnson wrote: library(rant) I'm sorry: I'm not familiar with the rant package. I couldn't find it on CRAN. I recall just over a year ago (Fall08) when I was new to the R language. I realize there's a steep curve in any language, especially with R and the

Re: [R] new to R Project

2010-02-22 Thread spencerg
Hi, Ivan: Are you trying to read standard text or csv files? If yes, then try ?read.table at a command prompt. Or are you trying to connect directly from R to a database system? If yes, which database system? This can be done from R, but as far as I know, finding the functions and

Re: [R] new to R Project

2010-02-22 Thread spencerg
Hi, Ivan: p.s. If you'd like to generate reports using LaTeX, I suggest you also try (LaTeX - ???LaTeX). ### Are you trying to read standard text or csv files? If yes, then try ?read.table at a command prompt. Or are you trying to connect directly from R to

Re: [R] Fortune candidate! Re: new to R Project

2010-02-22 Thread spencerg
I have a concern with the sentiment expressed: When one is new to a language, it is often not easy to know where to start in the available documentation. It's hard to RTFM when one does not know which FM2R. I currently subscribe to email help for three other open source

Re: [R] write.zip?

2010-02-10 Thread spencerg
2010, spencerg wrote: Can one write a zip file from R? I want to create a file with a name like dat.zip, being a zip file containing dat.csv. I can create dat.csv, then call system('zip -r9 dat.zip dat.csv'). Is there a better way? Not really. One could use compiled code like

[R] write.zip?

2010-02-09 Thread spencerg
Can one write a zip file from R? I want to create a file with a name like dat.zip, being a zip file containing dat.csv. I can create dat.csv, then call system('zip -r9 dat.zip dat.csv'). Is there a better way? I can use gzfile to write a gz file, but I don't know how to

Re: [R] 2 dimensional interpolation from matlab to R

2010-02-04 Thread spencerg
Have you considered the fda package and the companion book, Functional Data Analysis with R and Matlab (Springer, 2009) by Ramsay, Hooker and Graves? This will NOT help you directly with bathymetry = f(long, lat), but will help with b=f(x)+e AND with translations between Matlab and R.

Re: [R] solving cubic/quartic equations non-iteratively

2010-01-05 Thread spencerg
standard square root computation requires an iteration. Spencer Peter Dalgaard wrote: Mads Jeppe Tarp-Johansen wrote: To R-helpers, R offers the polyroot function for solving mentioned equations iteratively. However, Dr Math and Mathworld (and other places) show in detail how to solve

Re: [R] Introducing R to statisticians

2009-11-11 Thread spencerg
To me, R is the language of choice for a rapidly increasing number of people involved in new statistical algorithm development. If they are happy with the tools they currently use, learning R may be a lot of pain for little gain. However, if they want to stay current with the

Re: [R] matrix^(-1/2)

2009-11-01 Thread spencerg
A question, a comment, and an alternative answer to matrix^(-1/2): QUESTION: What's the status of the expm package, mentioned in the email you cited from Martin Maechler, dated Apr 5 19:52:09 CEST 2008? I tried both install.packages('expm') and

Re: [R] matrix^(-1/2)

2009-11-01 Thread spencerg
Hi, Chuck: Thanks very much, but why do I get package 'expm' is not available from install.packages(expm,repos=http://R-Forge.R-project.org;)? Best Wishes, Spencer Graves Charles C. Berry wrote: On Sun, 1 Nov 2009, spencerg wrote: A question, a comment

Re: [R] Bayesian regression stepwise function?

2009-10-23 Thread spencerg
Charles C. Berry wrote: On Thu, 22 Oct 2009, Ben Bolker wrote: Allan.Y wrote: Hi everyone, I am wondering if there exists a stepwise regression function for the Bayesian regression model. I tried googling, but I couldn't find anything. I know step function exists for regular stepwise

Re: [R] Functional data analysis - problems with smoothing

2009-10-23 Thread spencerg
Hi, Ben: Which chapter in which of Ramsay's books? For his most recent book (Functional Data Analysis with R and Matlab, with Giles Hooker and your's truly), there is one script file for each chapter with names like fdarm-ch01.R, ... fdarm-ch11.R. These script files reproduce

Re: [R] Spatial Autocorrelation

2009-10-06 Thread spencerg
In addition to the taskview (below), you might consider using the sos package, something like the following: sa - ???'spatial autocorrelation' # 58 matches sc - ???'spatial correlation' # 181 matches s. - sa|sc # union of the to 'findFn' objects summary(s.) # 224 links in 57 packages

Re: [R] Re cursive regression

2009-10-02 Thread spencerg
There is a huge literature on time series analysis with many functions and contributed packages in R, including many different ways to estimate a recursive model. If you are working with asset returns, I suggest you start with Diethelm Würtz, Yohan Chalabi, William Chen, Andrew

Re: [R] re ading and analyzing a word document

2009-10-01 Thread spencerg
library(sos) tm - findFn('text mining') tm This produced 15 matches, which you could also find using RSiteSearch('text mining', 'function'). The difference is that findFn{sos} displays the results in a table sorted to place the package with the most matches first. In this case, there

Re: [R] matrix exponential

2009-09-30 Thread spencerg
RSiteSearch('exponential of a matrix') produced 982 matches. RSiteSearch('{exponential of a matrix}') produced 13. David Winsemius wrote: On Sep 30, 2009, at 9:18 PM, Kon Knafelman wrote: Hi Guys, Im trying to find the exponential of a matrix. Can someone please help

Re: [R] R package for visualizing/analyzing accelerometry data?

2009-09-30 Thread spencerg
library(sos) a - ???accelerometry # no matches d3 - ???'3D' # 411 matches; retrieved 20 pages 400 matches d3 - ???'3D'(99) # retrieved all 411 matches summary(d3) # first 13 of 144 packages findFn2xls(d3) # write d3.xls containing sheets PackageSum2, findFn, call installPackages(d3) # install

Re: [R] implementation of matrix logarithm (inverse of matrix exponential)

2009-09-26 Thread spencerg
Sylvester's formula (http://en.wikipedia.org/wiki/Sylvester%27s_formula) applies to a square matrix A = S L solve(S), where L = a diagonal matrix and S = matrix of eigenvectors. Let f be an analytic function [for which f(A) is well defined]. Then f(A) = S f(L) solve(S). We can

Re: [R] basic cubic spline smoothing

2009-09-25 Thread spencerg
The best reference I know for this is something I wrote with Jim Ramsay and Giles Hooker: Functional Data Analysis with R and Matlab (Springer, 2009). Others may have better material. After install.packages('fda'), I suggest you try system.file('scripts', package='fda'), as

Re: [R] Reg: R-systems in java

2009-09-15 Thread spencerg
RSiteSearch('java', 'fun') produced 144 matches for me just now. The sos package can help organize study of those 144 matches: library(sos) j - ???java # RSiteSearch('java', 'fun') - a data.frame of class ' findFn' summary(j) # 40 packages installPackages(j) # install packages with

[R] [R-pkgs] New package sos for searching help pages of contributed packages

2009-09-12 Thread spencerg
Searching help pages of contributed packages just got easier with the release of the new sos package. This is a replacement for and substantial enhancement of the existing RSiteSearch package. To learn more about it, try vignette(sos). We hope you find this as useful as we

Re: [R] State Space models in R

2009-09-11 Thread spencerg
Hi, Giovanni: 1. I've used primarily sspir and dlm. There is apparently a new release of sspir, which I have not used. When I last tried sspir, it did NOT have a forecast function, while dlm did. The two packages have functions with the same name but incompatible code. It would

Re: [R] Derivative of nonparametric curve

2009-09-09 Thread spencerg
This may be overkill for your application, but you might be interested in the fda package, for which a new book appeared a couple of months ago: Functional Data Analysis with R and Matlab (Springer Use R! series, by Ramsay, Hooker and Graves; I'm the third author). The package includes

Re: [R] Video Analysis?

2009-09-06 Thread spencerg
Thanks to Kevin Middleton, Barry Bowlingson, M. Austenfeld: The Hedrick reference is very interesting, digitizing a video of the flight of a moth. This shows the state of the art AND describes freely available MATLAB code. I've used Matlab before, but it would strain my budget right

[R] Video Analysis?

2009-09-05 Thread spencerg
What software exists for digitizing video to quantify the motion of specific features in the image? I might be willing to use something that's NOT in R, though I'd prefer something in R (or at least with an R intereface). Thanks, Spencer Graves

Re: [R] Google's R Style Guide (has become S3 vs S4, in part)

2009-09-01 Thread spencerg
Bryan Hanson wrote: Looks like the discussion is no longer about R Style, but S3 vs S4? To that end, I asked more or less the same question a few weeks ago, arising from the much the same motivations. The discussion was helpful, here's the link:

Re: [R] Google's R Style Guide

2009-08-29 Thread spencerg
S3 is very easy to change; S4 is very difficult. This provides advantages and disadvantages for both. Some people swear by one and curse the other -- from both sides. S4 is newer, and I have had problems in the past finding out what S4 methods are available and finding

Re: [R] specify a model in differential equations (nlme)

2009-08-26 Thread spencerg
You might also try library(RSiteSearch) de - RSiteSearch.function(differential equation) # This is different from des - RSiteSearch.function(differential equations) # Combine as de. - de | des # display: HTML(de.) Hope this helps. Spencer Graves Bert Gunter wrote: For nlme,

Re: [R] trouble with Vista reading files

2009-08-24 Thread spencerg
Dear Mike: I don't know. 1. What specific error message do you get? 2. Your example is too long for me to parse, especially with the color being stripped before I saw it. 3. Have you tried using debug(cro.etest.grab), then walking through

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-11 Thread spencerg
Hi, Terry: Thanks for the comments. I too vastly prefer S3 to S4. Your comparison is based on much greater experience than mine. Could you please check the link you sent? I couldn't get it to work. Thanks again. Spencer Terry Therneau wrote: For 90 percent of

Re: [R] R Excel

2009-08-05 Thread spencerg
Have you looked at Heiberger and Neuwirth (2009) R Through Excel: A Spreadsheet Interface for Statistics, Data Analysis, and Graphics (Springer)? Both Amazon and the Springer web site say it's not yet available. However, the Springer booth at the Joint Statistical Meetings was

Re: [R] RE xcel Macro Mode

2009-08-05 Thread spencerg
Have you looked at RExcel and the RExcelInstaller package? There is now a companion book: Heiberger and Neuwirth (2009) R Through Excel: A Spreadsheet Interface for Statistics, Data Analysis, and Graphics (Springer)? Both Amazon and the Springer web site say it's not yet

Re: [R] Which CRAN mirror is the fastest ?

2009-07-30 Thread spencerg
There may also be a difference in reliability, which would not so easily be measured by an individual user. I've selected the closest geographically until it seemed to be down, then tried the second closest, etc. This could be automated centrally, but then you'd have to deal with the

Re: [R] problem with as.POSIXct and daylight savings time

2009-07-19 Thread spencerg
Have you considered the timeDate package? Spencer Denis Chabot wrote: Thank you very much Duncan. I'll follow your suggestion. Why do I want to do what the designer did not think anyone would want to do? I have data acquisition equipment taking measurements every 15 min or so for

Re: [R] Calculating the trading days

2009-07-18 Thread spencerg
You also need to know which days are trading vs. non-trading days. To find functions to provide this additional information, I first tried the following: library(RSiteSearch) td - RSiteSearch.function('trading days') HTML(td) This produced nothing. Therefore, I divided the task

Re: [R] Nonlinear Least Squares nls() programming help

2009-07-14 Thread spencerg
1. What does i in your formula represent? Have you worked the examples in the nls help page, and do you understand how it works? nls tries to do vector computations. 2. Unfortunately, nls often quits with errors like singular convergence. A standard way around that problem is

Re: [R] getting a timeseries element into a string

2009-07-14 Thread spencerg
Hello: 1. I tried the example. The first thing I noticed was that library(fSeries) loaded with the following comment: # The new version of 'fSeries' has been renamed to 'timeSeries' 2. With this, I tried library(timeSeries). Then your first example worked without error.

Re: [R] dse model setup help

2009-07-14 Thread spencerg
I can't identify the problem. The package author and maintainer, Paul Gilbert, might be able to help. Have you tried debug(SS)? This will allow you to walk through the function line by line looking at things, etc. This often produces enlightenment. Alternatively, have

Re: [R] Is there any Gauss-newton library/function in R?

2009-07-13 Thread spencerg
There are many more things available than just 'nls'. An overview is available at www.r-project.org - CRAN (select your favorite mirror) - Task Views (on the left, third line under CRAN) - Optimization Optimization and Mathematical Programming. For a possibly more direct

Re: [R] error: optim(rho, n2ll.rho, method = method, control = control, beta = parm$beta, : initial value in 'vmmin' is not finite

2009-07-12 Thread spencerg
I have not used 'sna'. Have you tried using debug to walk through the code line by line, examining and even changing things at will? For example, how big is rho, passed as starting values to optim? If that matches the size of your adjacency matrix, it could expose a

Re: [R] plm Issues

2009-07-11 Thread spencerg
Your script ran for me without error under the following configuration: sessionInfo() R version 2.9.1 (2009-06-26) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United

Re: [R] nls, reach limit bounds

2009-07-11 Thread spencerg
Have you plotted the data? There are two standard sources of non-convergence problems like this: First, there may not be enough information in your data to estimate all four parameters. Second, if that's not the case, then your starting values are not appropriate. I routinely

Re: [R] splint

2009-07-10 Thread spencerg
Hello: For any package on CRAN, you can download the *.tar.gz source file. When this is unzipped, the result will typically include a subdirectory src, containing the source code for routines written in Fortran or C or C++. You didn't say where one could find the function

Re: [R] Quantitative Risk Management by McNeil

2009-07-07 Thread spencerg
Dear Andriy: 1. The help file for fit.NH says the first argument should be a vector of data. Consider the following modification of the example on that help page: rs - matrix(rseries, 10, 202, dimnames=list(letters[1:10], 1:202)) rs. - fit.NH(rs) Error: cannot allocate vector

Re: [R] gnls : Rho

2009-07-02 Thread spencerg
Your example is not self-contained, which makes it more difficult to answer your question. However, I believe you should be able to answer the question by studying the examples on the help pages for gnls and possibly corCompSymm, using the following additional commands: # To

Re: [R] using garchFit() to fit ARMA+GARCH model with exogeneous variables

2009-07-01 Thread spencerg
Hello, Yuhan: If I wanted to get something sensible today, I'd do ordinary least squares using lm(y~x), the garchFit on the residuals. This will give you a reasonable answer except that the confidence intervals from lm will not be accurate. I'd want to do normal probability plots of

Re: [R] GARCH:: False Convergence

2009-06-28 Thread spencerg
I have not seen a reply to this post, so I will offer a couple of comments: To look for other garch capabilities in R, I tried the following: library(RSiteSearch) gch - RSiteSearch.function('garch') summary(gch) HTML(gch) This found 111 help pages in 18 packages

Re: [R] how to interpret coefficients for a natural spline smooth function in a GLM

2009-06-27 Thread spencerg
I have not seen a reply to this question, so I will offer a comment; someone who knows more than I may correct or add to my comments. There are many different kinds of splines. Perhaps the most common are B-splines, which sum to 1 inside their range of definition and are 0

Re: [R] R and Sound

2009-06-26 Thread spencerg
I just tried the following: library(RSiteSearch) sound - RSiteSearch.function('sound') HTML(sound) This identified 117 help pages in 40 packages containing the word sound. This included 30 help pages in a package called sound, which is A Sound Interface for R. It also included 11

Re: [R] a proposal regarding documentation

2009-06-14 Thread spencerg
The documentation for the nlme package was improved a few years ago by an informal process of this nature. When I first started following r-help, I answered many questions suggesting in part the the person read some portion of Pinheiro and Bates (2000). At that time, none of the help

Re: [R] a proposal regarding documentation

2009-06-14 Thread spencerg
I agree that the documentation is a primary source, made now more accessible with the availability of the RSiteSearch package that allows more structures searches of the help pages in contributed packages than previously available. On the other hand, it can sometimes be difficult to get

Re: [R] FBI Homicide data?

2009-06-14 Thread spencerg
Hi, Mario: The following suggest to me that these data may not be available in any contributed R package: library(RSiteSearch) fbi - RSiteSearch.function('FBI Homicide') hits(fbi) # 0 hom - RSiteSearch.function('Homicide') hits(hom) # 4 HTML(hom) The 4 items exposed via the

Re: [R] coupled ODE population model

2009-06-13 Thread spencerg
Hi, Justin: In addition to the example below, Thomas Petzoldt also has two vignettes included with his simecol package. These might help you more easily use his package. Have you looked for what you want using the RSiteSearch.function in the RSiteSearch package? Consider,

Re: [R] Optimization Question

2009-06-12 Thread spencerg
The 1L, etc., forces the number to be integer: is.integer(1) [1] FALSE is.integer(1L) [1] TRUE Hope this helps. Spencer Paul Smith wrote: On Thu, Jun 11, 2009 at 9:56 PM, Brecknock, Peterpeter.breckn...@bp.com wrote: Apologies if this is not the correct list for this

Re: [R] deSolve question

2009-06-11 Thread spencerg
Dear In-Sun: I have not seen a reply, so I will offer some suggestions, hoping I can help without understanding all the details. 1. Have you run that code with options(warn=2)? It produced over 50 warnings for me, and options(warn=2) will convert the warnings to errors,

Re: [R] Good Programming Practice Question - Functions in Different Files

2009-06-09 Thread spencerg
Sundar Dorai-Raj taught me to do the following: Rdir - c:\appropriatepath\R Rfiles - dir(Rdir, pattern='\\.R$', full.names=TRUE) invisible(lapply(aTR, source)) The invisible suppresses the garbage while still displaying error messages. Hope

Re: [R] Using constrOptim() function

2009-06-04 Thread spencerg
It looks to me like you need to add x to the arguments in your call to constrOptim, something like the following: constrOptim(beta_i, myFunction, NULL, ui, ci, mu = 1e-04, control = list(), method = Nelder-Mead,outer.iterations = 100, outer.eps = 1e-05, x=x) The first x in x=x

Re: [R] A problem about nlminb

2009-05-30 Thread spencerg
You example is NOT self contained, which means that any potential respondent must guess what you mean by a function with a variable of almost 200,000. The following clarifies this: start0 - rep(1, 20) msLE2 - function(x)sum(x^2) nlminb(start=start0, msLE2, control = list(x.tol =

Re: [R] save plm coefficients

2009-05-29 Thread spencerg
I'm not sure what you are asking, especially since I do not have access to regaccdis. However, will something like the following do what you want? caeLvls - c(1, 5, 10) for(i in 1:3) coef[i,2:4] -

Re: [R] SEM/path question

2009-05-29 Thread spencerg
Dear Erin: I do not have a direct answer to your question, but the following quickly identified for me just now 244 help pages in contributed packages that mentioned either path analysis or SEM, sorted to put first the package with the most such hits: pa -

Re: [R] Working with daily data

2009-05-25 Thread spencerg
Hi, Gabor, et al.: What's the best way to search the R-SIG-Finance archives? Are R-SIG-* included in any of the main R search engines (at http://www.r-project.org/search.html;)? Gmane has an option for gmane.comp.lang.r.finance, but when I tried it just now, I got, No such group.

Re: [R] sciplot question

2009-05-25 Thread spencerg
Frank E Harrell Jr wrote: spencerg wrote: Dear Frank, et al.: Frank E Harrell Jr wrote: snip Yes; I do see a normal distribution about once every 10 years. To what do you attribute the nonnormality you see in most cases? (1) Unmodeled components of variance that can generate

Re: [R] Working with daily data

2009-05-25 Thread spencerg
Grothendieck wrote: Your google search or daily data site:https://stat.ethz.ch/pipermail/r-sig-finance/ both seem to give reasonable results. On Mon, May 25, 2009 at 9:45 AM, spencerg spencer.gra...@prodsyse.com wrote: Hi, Gabor, et al.: What's the best way to search the R-SIG-Finance

Re: [R] sciplot question

2009-05-24 Thread spencerg
Dear Frank, et al.: Frank E Harrell Jr wrote: snip Yes; I do see a normal distribution about once every 10 years. To what do you attribute the nonnormality you see in most cases? (1) Unmodeled components of variance that can generate errors in interpretation if ignored,

Re: [R] rank reduction method in time series analysis?

2009-05-23 Thread spencerg
Hello: Have you looked at Pfaff (2008) Analysis of Integrated and Cointegrated Time Series with R, 2nd ed. (Springer)? I have not read this book, but the title and table of contents sounds like it contains many alternative answers to your question, with the best among those

Re: [R] good numerical optimization to use in R?

2009-05-22 Thread spencerg
Have you tried the maxLik package? If that is not adequate, you can check CRAN Task View: Optimization and Mathematical Programming (http://cran.fhcrc.org/web/views/Optimization.html). Or try the new RSiteSearch.function in the RSiteSearch package. If none of these adequate, please

Re: [R] Naming a random effect in lmer

2009-05-22 Thread spencerg
The first exaample on the lmer help page uses a formula Reaction ~ Days + (Days|Subject). Here, Subject is the name of a column in the data.frame sleepstudy, with levels 308, 309, ... . Does this answer your question? If no, please provide commented, minimal, self-contained,

Re: [R] Naming a random effect in lmer

2009-05-22 Thread spencerg
, 1218L, 1226L, 1240L, 1267L, 1275L, 1294L, 1304L, 1318L, 1326L, 1340L, 1367L, 1375L, 1394L, 1404L, 1418L, 1426L, 1440L, 1467L, 1475L, 1494L), class = data.frame) At 11:17 AM 5/22/2009 -0700, spencerg wrote: The first exaample on the lmer help page uses a formula Reaction ~ Days + (Days|Subject

Re: [R] stationarity tests

2009-05-21 Thread spencerg
The following searches for help pages in contributed packages including terms stationarity or unit root: library(RSiteSearch) st - RSiteSearch.function('stationarity') ur - RSiteSearch.function('unit root') ur. - st|ur nrow(st) # 68 nrow(ur) # 122 nrow(ur.)# 180 HTML(stur) # Shows the

Re: [R] Non-linear regression with latent variable

2009-05-21 Thread spencerg
If you have the RSiteSearch package installed, you can do the following: library(RSiteSearch) nrow(nll - RSiteSearch.function(nonlinear regression with latent)) HTML(nll) This just produced 8 hits for me. If this doesn't solve your problem, you might try other search terms. If

Re: [R] How to google for R stuff?

2009-05-20 Thread spencerg
There is also the relatively new RSiteSearch package. It's RSiteSearch.function searches only help pages of contributed packages but returns the result in a data.frame (of class RSiteSearch) sorted to put the most interesting package first with help pages sorted within packages. If this

Re: [R] How to google for R stuff?

2009-05-20 Thread spencerg
Dear Dieter: Thanks for the correction. I failed to test the code as written before I posted it. Spencer Graves Dieter Menne wrote: spencerg spencer.graves at prodsyse.com writes: de - RSiteSearch.function(differential equation) des - RSiteSearch.function(differential

Re: [R] binom package (was: no subject)

2009-05-19 Thread spencerg
There are 17 different help pages in 5 different packages citing Agresti and Coull. This is quickly displayed using the RSiteSearch package as follows: library(RSiteSearch) HTML(RSiteSearch.function(Agresti and Coull)) I have not checked all these 17, but they doubtless help

Re: [R] S data sets in R?

2009-05-19 Thread spencerg
My favorite tool for finding things like this is RSiteSearch.function in the RSiteSearch package. For the objects you mention, I get the following: library(RSiteSearch) hits(a.s - RSiteSearch.function(auto.stats)) # 0 hits(sx - RSiteSearch.function(saving.x)) # 0 hits(rn -

Re: [R] MEXVAL

2009-05-18 Thread spencerg
I do not understand the term mexval statistics. I think you want to look for anova.glm, fitting several models leaving each term out one at a time in succession and then using anova.glm to compare your general model with each submodel in succession. If that does NOT give you what

Re: [R] Newton's method for finding roots

2009-05-17 Thread spencerg
Search on the left under www.r-project.org provide 5 different search engines devoted to R. The R-help archives for 4/20/2009 (+/-1 depending on your local time zone and mine) contains an interesting discussion of this issue, Subj: Re: [R] Two or more dimensional root (Zero) finding.

Re: [R] maxLik pakage

2009-05-16 Thread spencerg
1. Have you worked through the examples in the maxLik help page? Your example is sufficiently complicated that I hesitate to try it myself, especially since I see characters in your email that are not simple ASCII. If you can get the examples in the maxLik help page to work, identify the

Re: [R] fitdistr for t distribution

2009-05-16 Thread spencerg
In addition to seeing the code by typing the name of the function (and copying it from there into a file), you can also enter debug(fitdistr), for example. Then the next time you use fitdistr, either directly or indirectly, it puts you in the environment of that function, and you can

Re: [R] Help with kalman-filterd betas using the dlm package

2009-05-15 Thread spencerg
betas in the transition taken into account. But how do I estimate that matrix, is that done with a MLE,SUR or some other statistical teqnique. Im also assuming in this example that a[t] are time invariant, which gives W[a] = 0 Appriciate any guidence. Regards Tom spencerg wrote: Have you

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread spencerg
Dear Avraham: For problems with many parameters to estimate, I highly recommend Pinheiro and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer). This book includes numerous examples showing how to use the nlme package. The value of this book is greatly enhanced by the

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread spencerg
Dear Doug, et al.: What would you recommend for analyzing a longitudinal abundance survey of 22 species, when the species were not selected at random? A prominent scientist tried to tell me that mixed-effects modeling is inappropriate in that case because the species were selected

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread spencerg
I suggest you try to translate your constraints into an unconstrained constrained problem using logarithms, then do nonlinear mixed effects modeling as described in chapters 6-8 of Pinheiro and Bates (2000). To do this, I would first start with the simpler linear estimation problem to

Re: [R] About the efficiency of R optimization function

2009-05-15 Thread spencerg
You might get some information about what is available in R using the new RSiteSearch package. For example: library(RSiteSearch) ipm - RSiteSearch.function('interior point method') hits(ipm) # 39 SQP - RSiteSearch.function('SQP') hits(SQP) # 2 sqp - RSiteSearch.function('sequential

Re: [R] Checking a (new) package - examples require other package functions

2009-05-14 Thread spencerg
Another way of making functions visible to examples is to list the package name as Depends in the package DESCRIPTION file. Alternatively, if you precede use in \examples with library(packageName), you should also list it as Suggests in DESCRIPTION. Hope this helps. Spencer

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-14 Thread spencerg
Have you considered the following: solve(qr(A), B) I have not tried this with a small toy example, and the qr documentation in the Matrix package seems to suggest it. This solves the optimization problem you mentioned, as noted in

Re: [R] ode first step

2009-05-14 Thread spencerg
Have you looked at the vignette in the deSolve package? (deS - vignette('compiledCode')) # opens a pdf file Stangle(deS$file) # writes an R script file to getwd() In spite of the name, this vignette includes an example entirely in R. By comparing it with

Re: [R] AFT-model with time-dependent covariates

2009-05-13 Thread spencerg
To see what's available in other packages, try the following: library(RSiteSearch) AFT - RSiteSearch.function('AFT model') summary(AFT) # 24 help files found in 8 different packages HTML(AFT) # opens a table with 24 rows in a web browser. There may be nothing here that will help you,

Re: [R] Partial Derivatives in R

2009-05-12 Thread spencerg
] -0.005995477 $d [1] 1e-04 $method [1] Richardson $method.args $method.args$eps [1] 1e-04 $method.args$d [1] 1e-04 $method.args$zero.tol [1] 1.781029e-05 $method.args$r [1] 4 $method.args$v [1] 2 attr(,class) [1] Darray spencerg wrote: Have you considered genD{numDeriv

Re: [R] Help with kalman-filterd betas using the dlm package

2009-05-12 Thread spencerg
Have you worked through vignette('dlm')? Vignettes are nice because they provide an Adobe Acrobat Portable Document Format (pdf) file with a companion R script file, which you can get as follows: (dlm. - vignette('dlm')) Stangle(dlm.$file) The first of these two lines opens

Re: [R] Citing R/Packages Question

2009-05-12 Thread spencerg
Hi, Stephen: Have you discussed this with any of your professors? With a little luck, you might find the right prof to work with who could help you select an ecology journal and write an article for that journal giving an overview of your package. I suggest you think in terms of a

Re: [R] maxLik package

2009-05-12 Thread spencerg
I don't understand. The help page for maxLik says that if the grad argument is 'NULL', numeric gradient will be used. If this does not answer your question, please read the posting guide www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] Partial Derivatives in R

2009-05-10 Thread spencerg
Have you considered genD{numDeriv}? If this does not answer your question, I suggest you try the RSiteSearch package. The following will open a list of options in a web browser, sorted by package most often found with your search term: library(RSiteSearch) pd -

Re: [R] Function recommendation for this study...

2009-05-10 Thread spencerg
To look up observer agreement, you might consider the RSiteSearch package. The RSiteSearch.function looks only for matches in help pages of contributed packages. library(RSiteSearch) oa - RSiteSearch.function(observer agreement) attr(oa, hits) # 4 functions matching this term HTML(oa)

Re: [R] Beyond double-precision?

2009-05-09 Thread spencerg
, not a mathematician, so any recommendations are welcome! Thanks! -Jamie spencerg wrote: Are all your numbers positive? If yes, have you considered using logarithms? I would guess it is quite rare for people to compute likelihoods. Instead I think most people use log(likelihoods). Most

Re: [R] Beyond double-precision?

2009-05-09 Thread spencerg
Dear Berwin: Thanks for the elegant correction. Spencer Berwin A Turlach wrote: G'day all, On Sat, 09 May 2009 08:01:40 -0700 spencerg spencer.gra...@prodsyse.com wrote: The harmonic mean is exp(mean(logs)). Therefore, log(harmonic mean) = mean(logs). Does this make sense

Re: [R] ADAPTIVE QUADRATURE WEIGHTS AND NODES

2009-05-08 Thread spencerg
Beyond what Doug said, if you have a specific R function that does adaptive quadrature, you could read the code for that function. You can get that without comments by typing the function name at a commands prompt. To get the source code with comments, you can download the appropriate

Re: [R] Beyond double-precision?

2009-05-08 Thread spencerg
Are all your numbers positive? If yes, have you considered using logarithms? I would guess it is quite rare for people to compute likelihoods. Instead I think most people use log(likelihoods). Most of the probability functions in R have an option of returning the logarithms.

Re: [R] How to do Naive Bayes in R?

2009-05-06 Thread spencerg
help.search('bayes') only searches installed packages. To go beyond that, you might try the following: library(RSiteSearch) bayes - RSiteSearch.function('bayes', 999) summary(bayes) # This produces a Parato analysis of packages in terms of references # to the search term in their

  1   2   >