Displaying 4 results from an estimated 4 matches for "regdata".
Did you mean:
reg_data
2008 Nov 19
1
mle2 simple question - sigma?
I'm trying to get started with maximum likelihood estimation with a
simple regression equivalent out of Bolker (Ecological Models and Data
in R, p302).
With this code:
#Basic example regression
library(bbmle)
RegData<-data.frame(c(0.3,0.9,0.6),c(1.7,1.1,1.5))
names(RegData)<-c("x", "y")
linregfun = function(a,b,sigma) {
Y.pred = a+b*x
-sum(dnorm(y,mean=Y.pred,sd=sigma,log=TRUE))
}
SigA<-mle2(linregfun, start=list(a=0.5, b=2), data=RegData)
#Or
SigB<-mle2(y~dnorm(mean=a+b*x,s...
2009 Oct 07
0
error using predict() / "fRegression"-package
...ype than the
training set. But inspection of the structure of both dataframes shows,
that the variables are still all of the type "numeric". (See attached
session protocol.)
Does anyone have an idea how to fix this? Any help would greatly be
appreciated!
Kind regards,
Gero
> str(regdata)
'data.frame': 89 obs. of 7 variables:
$ ret1 : num 0.0275 -0.01013 0.00569 -0.01582 0.0226 ...
$ lag(ret1) : num NA 0.0275 -0.01013 0.00569 -0.01582 ...
$ lag(ret2) : num NA 0.04072 -0.00509 0.02055 -0.01548 ...
$ lag(ret3) : num NA...
2009 Jul 14
2
Proper Paste for Data Member
...the following:
tsSource <- ts(paste("sh$",NAMEVARIABLE,sep="") ... )
fails. The paste isn't evaluating properly. What is the proper way to
concatenate a data source with a member name such that they evaluate
properly.
actual code below:
doEnv <- function(SOURCEDATA,REGDATA,HOUR,ENVNAME,REPORTNAME) {
print(SOURCEDATA)
print(REGDATA)
print(HOUR)
print(ENVNAME)
print(REPORTNAME)
# blah blah blah ...
#Raw Data
channel1 <- odbcConnectExcel("Q:/metrics.xls")
sqlTables(channel1)
sh1 <- sqlFetch(channel1, "Actuals$")
close(channel1)
# Something he...
2009 Oct 08
0
predict.lm() out-of-sample predictions - problem with data classes
Hello!
I'm still working on my problem, which also occurs with the predict.lm()
function. - Providing newdata, which is a data.frame with all variables
being "numeric", as str() shows, R tells me the following:
ar1.xpred.test.pred <- predict(ar1.xpred.fitted, regdata.test, se.fit =
FALSE)
Fehler: variable 'lag(ret1)' was fitted with type "numeric" but type
"nmatrix.1" was supplied
Zus?tzlich: Warnmeldung:
'newdata' had 23 rows but variable(s) found have 89 rows
Estimating a model from the test-data and examining, the resul...