Displaying 20 results from an estimated 800 matches similar to: "Breaking up a vector"
2011 Dec 01
2
Writing a function, want a string argument to define the name of the excel sheet to be called
My question is this: is there a way I can make one of the arguments of the
function be a string the user can enter, and then have that be the excel
filename? ie,
foo <- function(x,y,NAME){
#make a matrix with x rows and y cols
M <- matrix(nrow=x,ncol=y)
#write the matrix
write.table(M, file = "result.csv",append=TRUE, sep = ",")
}
I've had a look but I
2003 Nov 26
3
Correlation test in time series
I would like to know if there is a way to test no correlaction
in time series ?
cov(r_t, r_t-1)=0
And r_t are homoscedastik and independent.
Thanks
[[alternative HTML version deleted]]
2011 Mar 19
1
I want to create an object to use for the plot command
I'm using the TSA package (along with all prerequisites) to do some GARCH
work and for some reason, something which used to work for me has decided to
up and stop. The code is as follows, after loading the package:
"
gs <- garch.sim(alpha=c(1.9,0.1), beta=c(0.700001, -0.0800003, -0.016),rnd =
rnorm, n = 400, ntrans=500)
gs1 <- garch.sim(alpha=c(1.9,0.1), beta=c(0.7, -0.08,
2013 Jan 03
2
simulation
Dear R users,
suppose we have a random walk such as:
v_t+1 = v_t + e_t+1
where e_t is a normal IID noise pocess with mean = m and standard deviation = sd and v_t is the fundamental value of a stock.
Now suppose I want a trading strategy to be:
x_t+1 = c(v_t – p_t)
where c is a costant.
I know, from the paper where this equations come from (Farmer and Joshi, The price dynamics of common
2010 Aug 23
1
Fitting a GARCH model in R
Hi,
I want to fit a mean and variance model jointly.
For example I might want to fit an AR(2)-GARCH(1,1) model i.e.
r_t = constant_term1 + b*r_t-1 + c*r_t-2 + a_t
where a_t = sigma_t*epsilon_t
where sigma^2_t = constant_term2 + p*sigma^2_t-1 + q*a^2_t-1
i.e. R estimates a constant_term1, b, c, constant_term2, p, q
TIA
Aditya
2010 Oct 06
1
dlm package: how to specify state space model?
Dear r-users!
I have another question regarding the dlm package and I would be very
happy if someone could give me a hint!
I am using the dlm package to get estimates for an endogenous rate of
capacity utilization over time. The general form of a state space model
is
(1) b_t = G * b_t-1 + w_t w_t ~ N(0,W)
(2) y_t= A' * x_t + H' * b_t + v_t v_t ~ N(0,V)
(Hamilton 1984: 372)
The
2016 May 11
2
How do I share folders ?
Hello dovecot,
First poster here.
What I want : give a.chaouche at algerian-radio.dz list and read permissions on a.chaouche at backup.algerian-radio.dz. Let's just discuss sharing the inbox then I can do the same for subfolders, in any. a.chaouche at algerian-radio.dz and a.chaouche at backup.algerian-radio.dz are two different users. Details about the domains aren't relevant here I
2011 Feb 04
1
Quadratic regression: estimating the maximizing value
A bioligist colleague sent me the following data.
x Y
3 1
7 5
14 8
24 0
(Yes, only four data points.) I don't know much about the
application, but apparently there are good empirical
reasons to use a quadratic model.
The goal is to find the X value which maximizes the
response Y, and to find a confidence interval for this X
value.
Finding the maximizing X value is pretty
2008 Feb 28
3
Collapse an array
Suppose I have a 4-D array X with dimensions (dx, dy, dz, dp). I want
to collapse the first 3 dimensions of X to make a 2-D array Y with
dimensions (dx*dy*dz, dp). Instead of awkward looping, what is a good
way to do this? Is there a similar function like reshape in Matlab?
Thanks,
Gang
2016 Dec 06
1
segfault with POSIXlt zone=NULL zone=""
>>>>> Joshua Ulrich <josh.m.ulrich at gmail.com>
>>>>> on Tue, 6 Dec 2016 09:51:16 -0600 writes:
> On Tue, Dec 6, 2016 at 6:37 AM, <frederik at ofb.net> wrote:
>> Hi all,
>>
>> I ran into a segfault while playing with dates.
>>
>> $ R --no-init-file
>> ...
>> >
2001 Apr 05
1
PR#896
Sorry to all that are angry about the form of my previous mail. I
didn't realise what would happen :((.
Here it is in (hopefully) plain text (if my mailer doesn't spoil it again):
##############
Dear developers,
I have a problem with some discrepancy between R 1.2.1 for
Windows and R 1.2.2 (and less) for Linux. While trying to correct
the wilcox.test (see my previous bug report) I
2007 Dec 10
2
[PATCH][LINUX] Decode mouse dz event
Decodes mouse event packet dz value and passes it as a wheel event into
the input stream.
Please apply to linux-2.6.18-xen
Signed- off- by: Pat Campbell <plc@novell.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
2013 Feb 05
1
dsync: Invalid server handshake
Hi list,
I recently tried to backup mailboxes from an older server machine to
a new one in order to move the service to the new machine.
Both machines are in the same LAN, I used this command:
dsync -R -u username backup ssh -i .ssh/id_rsa username at 192.168.1.11 /opt/local/bin/dsync
and I get this error:
dsync-local(dz): Error: Invalid server handshake: dsync-server 2
dsync-remote(dz):
2004 Sep 22
3
loops: pasting indexes in variables names
I cannot figure out how, using R, I can paste indexes or characters to the
variable
names which are used within loops. I will explain this with a simple
example:
Immagine I have a huge series of variables, each one taken two times, say
x1 x2 y1 y2 z1 z2.....
Now, immagine that I want to compute a variable from the difference of
each couple, say dx=x1-x2, dy=y1-y2, dz=z1-z2...
In Stata, for
2002 Jan 30
1
Hi,
Hi,
Sorry for the confusion.
I would like to estimate a model wherein
the marginals of z with respect to w1 and w2
are smooth functions of x and y. I have data
on z, x, y, w1 and w2.
so E[dz/dw1] = f(x,y) and E[dz/dw2] = g(x,y)
and I would like to estimate f(x,y) and g(x,y)
I suppose I could try to fit something more general
using projection pursuit, but the nature of the problem
suggests
2011 Nov 20
2
Continuasly Compunded Returns with quantmod-data
Hey guys,
i want to calculate the continuasly compounded returns for stock prices.
Formula for CCR:
R_t = ln(P_t/P_{t-1})*100
With R:
First i have to modify the vectors, so that they have the same length
and we start at the second observation.
log(GOOG1[-1]/GOOG1[1:length(GOOG1)-1])*100
That does work with normal vectors.
My Questions:
1) I want to use this for stock prices.
so i
2013 Mar 12
1
rugarch: GARCH with Johnson Su innovations
Hey,
I'm trying to implement a GARCH model with Johnson-Su innovations in order to simulate returns of financial asset. The model should look like this:
r_t = alpha + lambda*sqrt(h_t) + sqrt(h_t)*epsilon_t
h_t = alpha0 + alpha1*epsilon_(t-1)^2 + beta1 * h_(t-1).
Alpha refers to a risk-free return, lambda to the risk-premium.
I've implemented it like this:
#specification of the model
2004 Aug 17
2
table and getting rownames
hi there
say that i have this table
>x<-table(adoc, oarb)
>x
oarb
0 1
adoc
ab 1 0
am 5 1
ba 14 1
cc 271 3
ch 87 2
dz 362 6
fl 7 0
fs 84 2
is there an easy way to get the row names or row
2004 Jul 21
2
RE: Comparison of correlation coefficients - Details
Dear all
I apologize for cross-posting, but first it is accepted custom to
thank the repliers and give a summary, and second I have still
the feeling that this problem might be a general statistical problem
and not necessarily related to microarrays only, but I might be wrong.
First, I want to thank Robert Gentleman, Mark Kimpel and Mark Reiners
for their kind replies. Robert Gentleman kindly
2002 Feb 19
2
cdf of the standard normal distribution
Dear Experts,
I need to calculate the cdf of the standard normal distribution, i.e.
H(x) = 1/sqrt(2*pi) integral(exp(-z^2/2) dz), where z is b/w -infi to
infi.
I know there should be a way to do it in R, but did not know to do it.
I'd appreciate any help you could offer.
Charlie Liu
Graduate student intern at EPA/ECO