Displaying 20 results from an estimated 1000 matches similar to: "comparing two matrices, row by row"
2007 Jan 30
5
how to join two arrays using their column names intersection
Dear all,
I have a problem that may be someone of you can help. I am a newbie and
do not find how to do it in manuals.
I have two arrays, for example:
ar1 <- array(data=c(1:16),dim=c(4,4))
ar2 <- array(data=c(1:16),dim=c(4,4))
colnames(ar1)<-c("A","B","D","E")
colnames(ar2)<-c("C","A","E","B")
> ar1
2007 Apr 26
3
A coding question involving variable assignments in ifelse()
Dear List,
Below is a simple, standard loss model that takes into account the
terms of an insurance policy:
deductible <- 15
coverage.limit <- 75
insurance.threshold <- deductible + coverage.limit
tmpf <- function() {
loss <- rlnorm(rpois(1, 3), 2, 5)
sum(ifelse(loss > insurance.threshold, loss - coverage.limit,
pmin(loss, deductible)))
}
net <- replicate(1000000, tmpf())
2001 Sep 26
1
Table help
Hi,
A quick question:
I have to vectors, say ar1 and ar2
> ar1
[1] "a" "c" "c" "a"
attr(,"levels")
[1] "a" "b" "c"
> ar2
[1] TRUE TRUE FALSE TRUE
> table(ar1, ar2)
ar2
ar1 FALSE TRUE
a 0 2
c 1 1
I would like to obtain:
T F
a 2 0
b 0 0
c 1 1
2009 Nov 02
2
using exists with coef from an arima fit
Dear R People:
I have the output from an arima model fit in an object xxx.
I want to verify that the ma1 coefficient is there, so I did the following:
> xxx$coef
ar1 ar2 ma1 intercept
1.3841297 -0.4985667 -0.9999996 -0.1091657
> str(xxx$coef)
Named num [1:4] 1.384 -0.499 -1 -0.109
- attr(*, "names")= chr [1:4] "ar1" "ar2"
2011 Sep 09
2
Different results with arima in R 2.12.2 and R 2.11.1
Hello , I have estimated the following model, a sarima:
p=9
d=1
q=2
P=0
D=1
Q=1
S=12
In R 2.12.2
Call:
arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D, Q),
period = S),
optim.control = list(reltol = tol))
Coefficients:
ar1 ar2 ar3 ar4 ar5 ar6 ar7 ar8
ar9
0.3152 0.8762 -0.4413 0.0152 0.1500 0.0001 -0.0413 -0.1811
2003 Apr 30
2
Bug in arima?
I'm using the fixed argument in arima. Shouldn't ar4, ar5, and ar6
display as zero in the output?
Call:
arima(x = window(log(hhprice), start = c(1990, 1), end = c(2003, 3)),
order = c(7,
1, 0), xreg = window(ts.union(exa1 = lag(exa, -1), exa12 = lag(exa,
-12), exb1 = lag(exb, -1), exc1 = lag(exc, -1), exc12 = lag(exc,
-12)), start = c(1990, 1), end = c(2003, 3)),
2011 Mar 02
1
Refine ARMA model
Dear users,
I tried to fit an AR(2) model to data. This the result:
> arima(vw,c(3,0,0))
Call:
arima(x = vw, order = c(3, 0, 0))
Coefficients:
ar1 ar2 ar3 intercept
0.1052 -0.0102 -0.1203 0.0099
s.e. 0.0337 0.0339 0.0338 0.0018
sigma^2 estimated as 0.002934: log likelihood = 1293.16, aic = -2576.33
Now, ar2 is not significantly different from
2012 Jul 04
2
[LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?
Evening,
I was writing some code that tried to insert calls to the
llvm.annotation intrinsic function, which has a signature of (i32,
i8*, i8*, i32). The code is below.
void addAnnotation( BasicBlock *block, Function *F)
{
string foo = "foo";
string bar = "barr";
Type *charTy = Type::getInt8Ty(block->getContext());
ArrayType *s1Ty =
2009 Apr 09
1
arima on defined lags
Dear all,
The standard call to ARIMA in the base package such as
arima(y,c(5,0,0),include.mean=FALSE)
gives a full 5th order lag polynomial model with for example coeffs
Coefficients:
ar1 ar2 ar3 ar4 ar5
0.4715 0.067 -0.1772 0.0256 -0.2550
s.e. 0.1421 0.158 0.1569 0.1602 0.1469
Is it possible (I doubt it but am
2004 Jan 14
2
Fixed parameters in an AR (or arima) model
Hello
I want to fit an AR model were two of the coefficients are fixed to zero
(the second and third ar-coefficients).
I used the "arima" function with the "fixed" argument but the ar3
coefficient is not set to zero:
==============================================
> arima(Y, order=c(4,0,0), xreg=1:23, fixed=c(NA,0,0,NA,NA,NA))
Call:
arima(x = Y, order = c(4, 0, 0), xreg =
2012 Jul 04
0
[LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?
Andrew Ruef wrote:
> Evening,
>
> I was writing some code that tried to insert calls to the
> llvm.annotation intrinsic function, which has a signature of (i32,
> i8*, i8*, i32). The code is below.
>
> void addAnnotation( BasicBlock *block, Function *F)
> {
> string foo = "foo";
> string bar = "barr";
>
> Type
2006 Nov 23
1
ARMAX Models in R
Hi,
I want to model different timeseries with ARMAX models in R because I think
that ARMAX models will map best to these data.
Besides I don't want to use the order of the AR or MA part but the lag e.g.
AR Part =ar1, ar2, ar7; MA Part =ma1, ma3 and I want to use exogenous
variables as well.
I coudn't find any solutions in the R help and therefore I want to ask all
of you.
Does anyone
2006 Jun 01
1
why does arima returns "NAN" standard error?
Hi everyone,
-----------------------------
Coefficients:
ar1 ar2 ma1 ma2 sar1 intercept drift
1.5283 -0.7189 -1.9971 0.9999 0.3982 0.0288 -9e-04
s.e. 0.0869 0.0835 0.0627 0.0627 0.1305 NaN NaN
sigma^2 estimated as 0.04383: log likelihood = 4.34, aic = 7.32
Warning message:
NaNs produced in: sqrt(diag(object$var.coef))
2011 Aug 30
2
ARMA show different result between eview and R
When I do ARMA(2,2) using one lag of LCPIH data
This is eview result
>
> *Dependent Variable: DLCPIH
> **Method: Least Squares
> **Date: 08/12/11 Time: 12:44
> **Sample (adjusted): 1970Q2 2010Q2
> **Included observations: 161 after adjustments
> **Convergence achieved after 14 iterations
> **MA Backcast: 1969Q4 1970Q1
> **
> **Variable Coefficient Std.
2017 Jun 20
1
How to write an estimated seasonal ARIMA model from R output?
I'm trying to use the following command.
arima (x, order = c(p,d,q), seasonal =list(order=c(P,D,Q), period=s)
How can I write an estimated seasonal ARIMA model from the outputs. To be specifically, which sign to use? I know R uses a different signs from S plus.
Is it correct that the model is:
(1-ar1*B-ar2*B^2-...)(1-sar1*B^s-sar2*B^2s-....)(1-B)^d(1-B^s)^D
2008 Nov 09
3
Arms Race
hey can anybody help me? i have to simulate the richardson Arms race
model on R.. for my simulation class...
2011 Sep 12
1
Difference in function arima estimation between 2.11.1 and R 2.12.2
Hello , I have estimated the following model, a sarima:
p=9
d=1
q=2
P=0
D=1
Q=1
S=12
In R 2.12.2
Call:
arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D, Q),
period = S),
optim.control = list(reltol = tol))
Coefficients:
ar1 ar2 ar3 ar4 ar5 ar6 ar7 ar8
ar9
0.3152 0.8762 -0.4413 0.0152 0.1500 0.0001 -0.0413 -0.1811
2007 Mar 16
3
ARIMA standard error
Hi,
Can anyone explain how the standard error in arima() is calculated?
Also, how can I extract it from the Arima object? I don't see it in there.
> x <- rnorm(1000)
> a <- arima(x, order = c(4, 0, 0))
> a
Call:
arima(x = x, order = c(4, 0, 0))
Coefficients:
ar1 ar2 ar3 ar4 intercept
-0.0451 0.0448 0.0139 -0.0688 0.0010
s.e.
2009 Jan 23
1
forecasting error?
Hello everybody!
I have an ARIMA model for a time series. This model was obtained through an
auto.arima function. The resulting model is a ARIMA(2,1,4)(2,0,1)[12] with
drift (my time series has monthly data). Then I perform a 12-step ahead
forecast to the cited model... so far so good... but when I look the plot of
my forecast I see that the result is really far from the behavior of my time
2012 Apr 26
1
Using the R predict function to forecast a model fit with auto.arima function
Hello R users,
Hope everyone is doing great.
I have a dataset that is in .csv format and consists of two columns: one
named Period (which contains dates in the format yyyy_mm) and goes from
1995_10 to 2007_09 and the second column named pcumsdry which is a
volumetric measure and has been formatted as numeric without any commas or
decimals.
I imported the dataset as pauldataset and made use of