Re: [R] Free financial data - equities, equity options and ETFs - for quantmod package (or other packages)

2019-04-03 Thread H
On 04/03/2019 03:12 AM, Eric Berger wrote: > You might want to post this to the group R-Sig-Finance > https://stat.ethz.ch/mailman/listinfo/r-sig-finance  > >  and also check their archives > > > On Wed, Apr 3, 2019 at 1:11 AM H > wrote: > > I am relatively new to

Re: [R] function predict

2019-04-03 Thread J C Nash
I was about to reply to the item with a similar msg as Bert, but then realized that the students were pointing out that the function (possibly less than perfectly documented -- I didn't check) only works for complete years. I've encountered that issue myself when teaching forecasting. So I was prep

Re: [R] [FORGED] Re: Potential Issue with lm.influence

2019-04-03 Thread Rolf Turner
On 4/04/19 5:34 AM, Richard M. Heiberger wrote: fortune nomination. The lesson to me here is that if you fit a sufficiently unreasonable model to data, the computations may break down. I second the nomination! cheers, Rolf -- Honorary Research Fellow Department of Statistics University o

Re: [R] function predict

2019-04-03 Thread Bert Gunter
This list has *no homework* policy. I would assume that the purpose of your "project" is for you to learn how to deal with exactly the sorts of issues you describe. (But you might get lucky with a response anyway). Bert Gunter "The trouble with having an open mind is that people keep coming alon

[R] function predict

2019-04-03 Thread Michaela Berndl
Dear Sir or Madam, we are statistic students at the Johannes Kepler University in Linz, Austria. In a project we had to analyse the time series influenza from the package tscount and make a prediction for one year. For the prediction we used the function predict from the package raster. Since

Re: [R] Potential Issue with lm.influence

2019-04-03 Thread Eric Bridgeford
Hey John, Seems fair, and, I agree a more explicit or clear (ie, giving users indications as to why/when the lm.influence is going to misfit the data) warning makes sense in context. Sincerely, Eric On Wed, Apr 3, 2019 at 10:18 AM Fox, John wrote: > Dear Eric, > > I'm afraid that your argument

Re: [R] Potential Issue with lm.influence

2019-04-03 Thread Eric Bridgeford
Hey guys, I appreciate the replies. I agree the issue is easy to catch; wouldn't it make sense to make a warning given that these types of errors (I am sure there are other ways to make the lm.influence have similar NaN performance, simply due to points radically not fitting the data) are relativ

Re: [R] String replace

2019-04-03 Thread Ivan Krylov
On Wed, 3 Apr 2019 15:01:37 +0100 Graham Leask via R-help wrote: Suppose that `BHC$Date` contains a string "M_24". You do: > BHC <-BHC %>% mutate ( Date = stringr :: str_replace ( Date , "M_2" , > "01-04-2017")) before you have a chance to do: > BHC <-BHC %>% mutate ( Date = stringr :: str_re

Re: [R] String replace

2019-04-03 Thread Sarah Goslee
Try reversing the order, or extending the to-replace bit. "M_1" is finding and replacing "M_10", "M_11", etc. "M_2" is finding and replacing "M_20", "M_21", etc. So M_14 becomes "01-03-20174" In the future, a toy dataset would help with the reproducible example aspect, and make your question eas

[R] String replace

2019-04-03 Thread Graham Leask via R-help
I’m attempting to replace a string variable that normally works fine. However when trying to do this with a string in the form of a date the output becomes corrupted. See below: BHC <-BHC %>% mutate ( Date = stringr :: str_replace ( Date , "M_1" , "01-03-2017")) BHC <-BHC %>% mutate ( Date =

Re: [R] Potential Issue with lm.influence

2019-04-03 Thread Bert Gunter
Second! Bert Gunter On Wed, Apr 3, 2019 at 9:35 AM Richard M. Heiberger wrote: > fortune nomination. > > > The lesson to me here is that if you fit a sufficiently unreasonable > model to data, the computations may break down. > > On Wed, Apr 3, 2019 at 10:18 AM Fox, John wrote: > > > > Dear

Re: [R] Potential Issue with lm.influence

2019-04-03 Thread Richard M. Heiberger
fortune nomination. The lesson to me here is that if you fit a sufficiently unreasonable model to data, the computations may break down. On Wed, Apr 3, 2019 at 10:18 AM Fox, John wrote: > > Dear Eric, > > I'm afraid that your argument doesn't make sense to me. As you saw when you > tried > >

Re: [R] Potential Issue with lm.influence

2019-04-03 Thread Fox, John
Dear Eric, I'm afraid that your argument doesn't make sense to me. As you saw when you tried fit3 <- update(fit, subset = !(Name %in% c("Jupiter ", "Saturn "))) glm.nb() effectively wasn't able to estimate the theta parameter of the negative binomial model. So why would it be better to

Re: [R] Potential Issue with lm.influence

2019-04-03 Thread Fox, John
Hi Peter, Yes, that's another reflection of the degree to which Jupiter and Saturn are out of line with the data for the other planet when you fit the very unreasonable negative binomial model with Volume untransformed. Best, John > On Apr 3, 2019, at 5:36 AM, peter dalgaard wrote: > > Yes,

Re: [R] Advice for speeding up optim()

2019-04-03 Thread J C Nash
Really should always look at Task Views There's optimx package. JN On 2019-04-02 10:13 p.m., Pinto, Naiara (334F) via R-help wrote: > Hi all, > > I’m calling optim() and getting correct results, but need help to upscale it. > I need to call it on a matrix that’s 3000x5000. I know the SANN opti

[R] Advice for speeding up optim()

2019-04-03 Thread Pinto, Naiara (334F) via R-help
Hi all, I’m calling optim() and getting correct results, but need help to upscale it. I need to call it on a matrix that’s 3000x5000. I know the SANN option is slow but I get similar results with all other options. Perhaps there’s another package..I also heard about implementing my loss functio

Re: [R] Fwd: Potential Issue with lm.influence

2019-04-03 Thread Eric Bridgeford
Hey John, I am aware they are high leverage points, and that the model is not the best for them. The purpose of this dataset was to explore high leverage points, and diagnostic statistics through which one would identify them. What I am saying is that the current behavior of the function seems a

Re: [R] Fwd: Potential Issue with lm.influence

2019-04-03 Thread Eric Bridgeford
rstudent calls influence, to my knowledge, and all of the results passed by rstudent are dependent on values returned by influence (other than the weights, which I can't imagine are NaN), so I believe that influence is the issue. See the line https://github.com/SurajGupta/r-source/blob/a28e609e72ed

Re: [R] Fwd: Potential Issue with lm.influence

2019-04-03 Thread peter dalgaard
Yes, also notice that > predict(fit3, new=moon_data, type="resp") 123456 1.060694e+00 1.102008e+00 1.109695e+00 1.065515e+00 1.057896e+00 1.892312e+29 789 10 11

Re: [R] Free financial data - equities, equity options and ETFs - for quantmod package (or other packages)

2019-04-03 Thread Eric Berger
You might want to post this to the group R-Sig-Finance https://stat.ethz.ch/mailman/listinfo/r-sig-finance and also check their archives On Wed, Apr 3, 2019 at 1:11 AM H wrote: > I am relatively new to analyzing financial data but have some experience > with R. I understand that the data avai