Displaying 20 results from an estimated 1000 matches similar to: "Question on ARIMA Prediction"
2012 Mar 29
1
how to increase speed for function?/time efficiency of below function
i am using sarima() function as below
___________________________________________________________________________________________
sarima=function(data,p,d,q,P=0,D=0,Q=0,S=-1,tol=.001){
n=length(data)
constant=1:n
xmean=matrix(1,n,1)
if (d>0 & D>0)
fitit=arima(data, order=c(p,d,q), seasonal=list(order=c(P,D,Q),
period=S),
2006 May 10
2
problems with optimize (again)
Can someone please explain what the $minimum result of the optimize
function actually is?
I'm trying to optimize the function:
fitIT<-function(ampFac,ts_wave1,ts_template){
template<-stretchWaveTime(ts_template,ampFac)
fit<-calcFit(ts_wave1,template)
return(fit)
}
with
>optimize(f=fitIT,interval=c(0.5,4),ts_wave1=test.data[,1],ts_template=test.data[,1])
$minimum
[1]
2005 Feb 24
4
r: functions
hi all
i have a function that uses two inputs, say xdata and ydata. An example
is the following,
simple1<-function(xdata,ydata)
{
ofit<-lm(ydata~xdata)
list(ofit)
}
say i use arbitray number for xdata and ydata such that
D =
x1 x2 y
1 1 10
2 6 6
3 10 7
x<-D[,1:2]
and
y<-D[,3]
if one uses these inputs and rund the program we get the following:
>simple(xdata=x,ydata=y)
2008 Dec 18
1
using jackknife in linear models
Hi R-experts,
I want to use the jackknife function from the bootstrap package onto a
linear model.
I can't figure out how to do that. The manual says the following:
# To jackknife functions of more complex data structures,
# write theta so that its argument x
# is the set of observation numbers
# and simply pass as data to jackknife the vector 1,2,..n.
# For example, to jackknife
#
2012 Dec 27
2
Bootstrap
Hola, buenas tardes
estoy intentando hacer un bootstrap de un modelo, pero me da el siguiente
error:
"Error in FUN(newX[, i], ...) :
unused argument(s) (list(age = c(33, 47, 49, 56, 60, 64, 64, 66, 68, 69,
71, 71, 72, 73, 74, 75, 75, 76, 78, 81, 83, 83, 36, 43, 46, 47, 49, 49, 51,
51, 52, 52, 53, 54, 54, 54, 55, 56, 56, 57, 57, 58, 58, 58, 58, 59, 59, 60,
61, 62, 63, 64, 65, 65, 66, 66,
2008 Sep 10
3
writing simple function through script
Hi all,
I try to write a simple function in a script. The script is as follows
yo<-function(Xdata)
{
n<-length(Xdata[,1])
Lgm<-nls(formula=LgmFormula,
data=Xdata,
start=list(a=1500,b=0.1),weights=Xdata$Qe)
return(Lgm)
}
After the execution of the script, when I call the function yo on data
called NC60.DATA I get an error.
#yo(NC60.DATA)
Erreur dans eval(expr, envir, enclos)
2012 Sep 13
1
[LLVMdev] Parsing C++ template parameters using cindex.py
Hi,
I am parsing a C++ file using cindex.py and want to get the template
parameters to a specific node. However, the tree seems to be different
depending on if the template parameter is a struct/class or a simple
type such as int or float. In the first case the template type is
appended as a child to the VAR_DECL node (the TYPE_REF node seen in
the example below), but this is not the case with
2008 Jun 24
2
persp plot
I have a set of data in the form
x1, y1, z1
x1, y2, z2
...
x1, yN, zN
x2, y1, z(N+1)
x2, y2, z(N+2)
...
x2, yN, z(2N)
...and so on...
xM, yN, val(M*N)
I have been trying to figure out how to get R to use this data in a
persp plot. So far the only thing that I can figure out to do is to
break the data file into three different files. The first file
contains the x-coordinate data:
x1
x2
2009 Jun 25
2
Error: system is computationally singular: reciprocal condition number
I get this error while computing partial correlation.
*Error in solve.default(Szz) :
system is computationally singular: reciprocal condition number =
4.90109e-18*
Why is it?Can anyone give me some idea ,how do i get rid it it?
This is the function i use for calculating partial correlation.
pcor.mat <- function(x,y,z,method="p",na.rm=T){
x <- c(x)
y <- c(y)
2012 Feb 11
1
object not found - Can not figure out why I get this error: Error in NROW(yCoordinatesOfLines) : object 'low' not found
Hi,
I have been using R for over a year now. I am a very happy user. Thank you
for making this happen.
This is my first question to this list.
I trying to add some functions to quantmod that would enable me to draw
arbitrary lines and text and make sure they are redrawn. I have created
following function:
require(quantmod)
# Add horizontal line to graph produced by quantmod::chart_Series()
2009 May 05
2
Stepwise logistic Regression with significance testing - stepAIC
Hello R-Users,
I have one binary dependent variable and a set of independent variables (glm(formula,…,family=”binomial”) ) and I am using the function stepAIC (“MASS”) for choosing an optimal model. However I am not sure if stepAIC considers significance properties like Likelihood ratio test and Wald test (see example below).
> y <- rbinom(30,1,0.4)
> x1 <- rnorm(30)
> x2
2012 Aug 28
3
date in plot, can't add regression line
Hello all,
I have been using R for about 3 weeks and I am frustrated by a problem. I have read R in a nutshell, scoured the internet for help but I either am not understanding examples or am missing something completely basic. Here is the problem:
I want to plot data that contains dates on the x axis. Then I want to fit a line to the data. I have been unable to do it.
This is an example of
2006 Nov 14
1
??: Re: Need help in waveslim package: imodwt and universal.thresh.modwt
Airon,
I used R2.4.0 on a Windows XP (SP2) (not Chinese :-))
and it still works:
> data = read.csv("u:/airon.csv")
> xdata = data$Adj..Close
> modwt.la8 = modwt(xdata, "la8", n.level=6)
> summary(modwt.la8)
Length Class Mode
d1 1467 -none- numeric
d2 1467 -none- numeric
d3 1467 -none- numeric
d4 1467 -none- numeric
d5 1467 -none- numeric
d6 1467
2010 Apr 24
3
S4 Inheritance of environments
I looked through the documentation and the mailing lists and could not
find an answer to this. My apologies if it has already been answered.
If it has, a pointer to the relevant discussion would be greatly
appreciated.
Creating S4 classes containing environments exhibits unexpected
behavior/features.? These have a different in two ways:
1) slotName for the data: ".xData" instead of
2010 Nov 16
1
Force evaluation of variable when calling partialPlot
Greg,
Two thoughts:
1. It might be possible that 'vars' is a reserved word of sorts and if you change the name of your vector RF might be happier
2. A way that works for me is to call importance as follows:
sel.imp <- importance(sel.rf, class=NULL, scale=TRUE, type=NULL)
and then use the 'names' of the imp data frame to be absolutely clear to RF you are talking about the
2012 Feb 21
1
Private Variables in R5-Classes possible?
Hi list,
is there a way to define some kind of private Variable?
I would like to prevent the user from manipulating fields on his own, in
order to not destroy data structures.
The problem is, that as soon as the variable exists in the environment
it is accessible via t$secret_value.
test <- setRefClass("test", fields=list(
secret = function(value){
cat("the function was
2003 Oct 24
5
how to remove NaN columns ?
How can I remove columns with NaN entries ?
Here is my simple example:
> data <- read.csv("test.csv")
> xdata <- data[3:length(data)]
> xs <- lapply(xdata, function(x){(x - mean(x))/sqrt(var(x))})
> x <- data.frame(xs)
> x
C D E F
1 -0.7071068 NaN -0.7071068 -0.7071068
2 0.7071068 NaN 0.7071068 0.7071068
2009 Jun 28
1
ERROR: system is computationally singular: reciprocal condition number = 4.90109e-18
Hi All,
This is my R-version information:---
> version
_
platform i486-pc-linux-gnu
arch i486
os linux-gnu
system i486, linux-gnu
status
major 2
minor 7.1
year 2008
month 06
day 23
svn rev 45970
language R
version.string R version 2.7.1 (2008-06-23)
While calculating partial
2010 Oct 04
2
Recursion error after upgrade to R_2.11.1 [Sec=Unclassified]
Hi all,
After an upgrade from R_2.10.1 to R_2.11.1 I am now getting the following error:
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
This occurs in the initialize method of S4 classes where I was initialising attributes eg:
.Object[['realtimeState']] <- list()
I can avoid this new error by altering the code to do:
.Object$realtimeState <-
2006 Nov 12
2
Need help in waveslim package: imodwt and universal.thresh.modwt
Hi:
I have encountered problems with imodwt and universal.thresh.modwt and cannot find any reference in R Search. Hope someone can give me some ideas:
Starting with
modwt.la8 <- modwt(xdata, "la8", n.level=6) <-- this seems to work fine
(1) ydata <- imodwt(modwt.la8)
will always give ydata as numeric(0) (no values) instead of being a time series data with