search for: p_t

Displaying 6 results from an estimated 6 matches for "p_t".

Did you mean: _t
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 trading strategies, 2001) that the induced price dynamics is: r_t+1 = –a*r_t + a*e_t + theta_t+1 and p_t+1 = p_t +r_t+1 where r_t = p_tp_t-1 , e_t = v_t – v_t-1 and a...
2007 Feb 21
1
loops in R help me please
I am trying to make the following Kalman filter equations work and therefore produce their graphs. v_t=y_t - a_t a_t+1=a_t+K_t*v_t F_t=P_t+sigma.squared.epsilon P_t+1=P_t*(1-K_t)+sigma.squared.eta K_t=P_t/F_t Given: a_1=0,P_1=10^7,sigma.squared.epsilon=15099, sigma.squared.eta=1469.1 I have attached my code,which of course doesnt work.It produces NAs for the Fs,Ks and the a. Can somebody tell me please what am I doing wrong in this...
2004 May 03
0
multinomial regresion, nls
Hi, Does R have any functions implementing such multinomial regression: (S_t^A,S_t^B)~MN(N_t-Y_{t-1},P_t^A,P_t^B) where MN(n,p_1,p_2) is multinomial distribution with parameters n, p_1, p_2. Here P_t^A and P_t^B are nonlinear functions from predictor variables and parameters which need to be estimated. Here A and B are used for notation, they are not parameters. My second question is about nls capa...
2010 Sep 28
0
Time invariant coefficients in a time varying coefficients model using dlm package
...estimate a state space model of the form (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) In particular my estimation in state space form looks like (3) a3_t = 1 * a3_t-1 + w_t w_t ~ N(0,W) (4) g_t = (a1, a2) * (1, P_t)' + u_t * a3_t + v_t v_t ~ N(0,V) where g_t is the investment rate, P_t are profits and u_t is the utilization rate. As you can see, I would like to estimate the coefficient of the utilization rate in time-varying terms and all the other coefficients of the investment function in constant t...
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 use: library(quan...
2010 Apr 21
2
suggestion how to use memcpy in duplicate.c
>From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt; nt = LENGTH(t); ns = LENGTH(s); switch (TYPEOF(s)) { ... case INTSXP: for (i = 0; i < ns; i++) INTEGER(s)[i] = INTEGER(t)[i % nt]; break; ... could that be replaced with : case INTSXP: for (i=0; i<ns/nt; i++) memcpy((char *)DATAPTR(s)+i*nt*sizeof(int),