Displaying 16 results from an estimated 16 matches for "v_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...
2010 Oct 06
1
dlm package: how to specify state space model?
...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 investment function I would like to use for estimating my endogenous
capacity utilization rate looks like
(3) g_t = x[1] + x[2]*(u_t-un_t) + x[3]*r + v_t
where g_t is the investment rate, r_t is the profit rate, u_t is the
actual utilization rate and un...
2010 Sep 28
0
Time invariant coefficients in a time varying coefficients model using dlm package
Dear R-users,
I am trying to 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...
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 p...
2006 Apr 29
1
SSPIR problem
I am having a problem with the package SSPIR. The code below
illustrates it. I keep getting the message: "Error in y - f :
non-conformable arrays."
I tried to tweak the code below in many different ways, for example,
substituting rbind for cbind, and sometimes I get a different error
message, but I could not find a variation of this code that would
work.
Any help will be greatly
2007 Nov 24
0
Help on State-space modeling
...els.
When I started to read the functions on R, I got to the function ss on the
library sspir. From what I
understood this function is similar to SsfFit from S-PLUS. But for my models
purpose there is something
left to be desired. Its formulation follow these equations:
*Y_t = F_t^T * theta_t + v_t, v_t ~ N(0,V_t)*
*theta_t = G_t * theta_{t-1} + w_t, w_t ~ N(0,W_t)*
Actually I wanted to add these two functions (-logA and a)
Y(t) = -log(A(t))/tau + (B(t)/tau) * X(t) + Error (measurement equation)
X(t) = a(t) + b(t) * X(t-1) + Error (Transition
Equation)
Have anyon...
2009 Feb 15
0
Kalman Filter - dlm package
Dear all,
I am currently trying to use the "dlm" package for Kalman filtering.
My model is very simple:
Y_t = F'_t Theta_t + v_t
Theta_t = G_t Theta_t-1 + w_t
v_t ~ N(0,V_t) = N(0,V)
w_t ~ N(0,W_t) = N(0,W)
Y_ t is a univariate time series (1x1)
F_t is a vector of factor returns (Kx1)
Theta_t is the state vector (Kx1)
G_t is the identity matrix
My first challenge is to get the Maximum Likelihood estimators o...
2005 Dec 14
1
Kalman Filter Forecast using 'SSPIR'
Dear R Users,
I am new to state-space modeling. I am using SSPIR
package for Kalman Filter. I have a data set containing one dependent
variable and 7 independent variables with 250 data points. I want to use
Kalman Filter for forecast the future values of the dependent variable
using a multiple regression framework. I have used ssm function to
produce the state space (SS)
2012 Apr 30
2
The constant part of the log-likelihood in StructTS
...)
> fit <- StructTS(Nile, type = "level")
> fit$loglik
[1] -367.5194
When computing the log-likelihood with other packages such as KFAS and FKF,
the loglikelihood value is around -645.
For the local level model, the likelihood is defined by -0.5*n*log(2*pi) -
0.5*sum(log(F_t) + v_t^2/sqrt(F_t)) (see for example Durbin and Koopman
(2001, page 30). But in StructTS, the likelihood is computed like this:
loglik <- -length(y) * res$value + length(y) * log(2 * pi),
where the first part coincides with the last part of the definition, but
the constant part has wrong sign and it...
2003 May 07
0
assessing goodness of variance prediction
Dear R-Helpers,
I am looking for ways to assess quality of a predictor of variance of a
random variable. Here a two related, but yet distinct, setups.
1. I observe y_t, t=1,...,T which is normally distributed with unknown
variance v_t (note that the variance is time-dependent). I have two
"predictors" for v_t, dubbed v1_t and v2_t, and I want to tell which
predictor is better. Here better is to be defined, but intuitively it is
thought to be analogous to R^2 of an ordinary regression.
I was thinking along the lines of...
2008 May 07
1
dlm with constant terms
Hi,
I am trying to figure how to use dlm with constant terms
(possibly time-dependent) added to both equations
y_t = c_t + F_t\theta_t + v_t
\theta_t = d_t + G_t\theta_{t-1} + w_t,
in the way that S-PLUS Finmetrics does?
Is there any straightforward way to transform the above to
the default setup?
Thanks,
Tsvetan
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. S...
2013 Mar 21
1
missing space in R version specifier makes PACKAGES file unreadable by install.packages()
Hi,
After updating to R-3.0 beta r62328, I get the following:
> install.packages("Biobase", type="source", repos="http://george2/BBS/2.12/bioc")
Error in do.call(op, list(v_c, v_t[[op]])) :
could not find function "R (>=2.15.1)"
The problem can be fixed by adding a space after >= in the offending
package's DESCRIPTION file and re-generating the PACKAGES file with
tools:::write_PACKAGES().
However, this worked OK in r62077. I'm not sure if >=2.1...
2005 Apr 25
6
Proba( Ut+2=1 / ((Ut+1==1) && (Ut==1))) ?
Dear all,
First I apologize if my question is quite simple,
but i'm very newbie with R.
I have vectors of the form v = c(1,1,-1,-1,-1,1,1,1,1,-1,1)
(longer than this one of course).
The elements are only +1 or -1.
I would like to calculate :
- the frequencies of -1 occurences after 2 consecutives -1
- the frequencies of +1 occurences after 2 consecutives +1
It looks probably something like
2016 Jun 30
4
Help required regarding IPRA and Local Function optimization
Hello Mentors,
I am currently finding bug in Local Function related optimization due to
which runtime failures are observed in some test cases, as those test cases
are containing very large function with recursion and object oriented code
so I am not able to find a pattern which is causing failure. So I tried
following simple case to understand expected behavior from this
optimization.
Consider
2010 Nov 24
0
Seeking advice on dynamic linear models with matrix state variable.
Hello, fellow R users,
I recently need to estimate a dynamic linear model in the following form:
For the measurement equation:
Y_t = F_t * a_t + v_t
where Y_t is the observation. It is a 1 by q row vector for each t.
F_t is my forecasting variable. It is a 1 by p row vector.
a_t is my state variable. It is a p by q MATRIX of parameters with each column of the matrix being regression coefficient of a random variable in Y_t. And v is a multivar...
2012 Mar 25
2
avoiding for loops
I have data that looks like this:
> df1
group id
1 red A
2 red B
3 red C
4 blue D
5 blue E
6 blue F
I want a list of the groups containing vectors with the ids. I am
avoiding subset(), as it is
only recommended for interactive use. Here's what I have so far:
df1 <- data.frame(group=c("red", "red", "red", "blue",