Displaying 20 results from an estimated 400 matches similar to: "Hidden Markov Models in R"
2011 Aug 05
1
If find x, then y, else do nothing
I want to write code that says "If you find an element equal to 4 in this
vector for each person in the data set tested separately, then put in 1 for
2 and 2 for 4, else leave the variable as is"
u.ppl <- (unique(init.dat1$grid))
l.ppl <- length(u.ppl)
for (i in 1:l.ppl)
{
if (grep("4",init.dat1$Slide1_RESP)) {2 == 1, 4 == 2}; else
2012 Mar 05
2
Running Total
I'm am trying to create a vector that has a running total that adds each
time a 1 occurs. here's the code and data
c(1L, 1L, 0L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 0L, 1L, 1L, 1L, 1L,
1L, 0L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L,
0L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 0L,
1L, 1L, 1L, 1L, 1L,
2011 Nov 16
1
Cubic Gradient Descent Package
R -
Does anyone know of a cubic gradient descent package? I found grad.desc()
but that only allows for a 2d function. I have 3 free parameters and thus
am looking for a 3d function.
Thank you,
--
Edward H. Patzelt
Research Assistant – TRiCAM Lab
University of Minnesota – Psychology/Psychiatry
VA Medical Center
S355 Elliot Hall: 612-626-0072
www.psych.umn.edu/research/tricam
[[alternative
2011 Jun 28
2
Loop through each subject
R help -
I am attempting to write a script that has multiple subjects in 1 data file.
Each subject has multiple rows with columns as variables. Here is my code,
I am having problem executing it on each unique subject id (dat$Subject).
getwd()
setwd("/Users/edwardpatzelt/Desktop/Neuroimaging/MERIT/SRRT/merge")
dat <- read.table("test2.txt", header = TRUE, na.strings
2011 Aug 22
1
Counting Elements Conditionally
R -
I have 3 variables with data below. Variable "Rev" is a vector that changes
from 1 to 2, 2 to 3, etc.... Variable "FF" is a binary variable with 1's
and 0's. Variable "bin" is a different binary variable with 1's and 0's.
I want to calculate the number of elements:
1. Starting with the first element where Rev switches (i.e. 1 to 2)
2. The
2012 Oct 19
2
Axis Breaks with ggplot2
R-help -
I'm trying to create axis breaks similar to this :
http://www.r-bloggers.com/wp-content/uploads/2010/08/bar-chart-natural-axis-split1.png
.
Is there a way to do this in R? Here's my code thus far:
structure(list(condition = structure(c(2L, 1L, 3L), .Label = c("con",
"exp", "unedit"), class = "factor"), trial.avg = c(4.04583333333333,
2011 Aug 15
0
Indexing Permutation Values
R-help -
This code iterates over a function with 2 free parameters to find a list of
values (which are the number of incorrect predictions for a computational
model). I want to find the values of i,e when there is the minimum number
of incorrect predictions. In other words, the value of "i" and "e" when
variable "thesum" is at the lowest possible number. The
2012 Oct 31
2
Aggregate Table Data into Cell Frequencies
R-help -
I have this set of aggregated tables (sample data below via dput()). And I
would like to have delayValue as the column variables with the "temp"
(temp1, temp2, temp3) values as the row variables. However I would like to
have the temp variables *aggregated into single rows* so that I have the
frequency ("Freq" | counts) of each time each "delayValue" occurs
2013 Apr 16
1
HMM Package parameter estimation
Hi,
I am having difficulties estimating the parameters of a HMM using the HMM
package. I have simulated a sequence of observations from a known HMM. When
I estimate the parameters of a HMM using these simulated observations the
parameters are not at all close to the known ones. I realise the estimated
parameters are not going to be exactly the same as the known/true
parameters, but these are
2017 Aug 31
0
The aphid package for analysis with profile hidden Markov models
Hi folks,
I'm pleased to introduce a new package called ?aphid?, for analysis with
profile hidden Markov models in R.
The package contains functions for multiple and pairwise sequence alignment
for both nucleic acids and proteins (preferably in the DNAbin or AAbin
format), model building, parameter optimization (Baum Welch and Viterbi
training), plotting, file import & export,
2017 Aug 31
0
The aphid package for analysis with profile hidden Markov models
Hi folks,
I'm pleased to introduce a new package called ?aphid?, for analysis with
profile hidden Markov models in R.
The package contains functions for multiple and pairwise sequence alignment
for both nucleic acids and proteins (preferably in the DNAbin or AAbin
format), model building, parameter optimization (Baum Welch and Viterbi
training), plotting, file import & export,
2011 Jan 26
0
hmm.discnp hidden markov model
Hi all,
I am using a discrete Hidden Markov Model with discrete observations in
order to detect a sequence of integers. I am using the "hmm.discnp" package.
I am using the following code:
signature <- c(-89, -98, -90, -84, -77, -75, -64, -60, -58, -55, -56, -57,
-57, -63, -77, -81, -82, -91, -85, -89, -93)
quant <- length(-110:-6)
# Initialize and train the hmm with the
2016 Apr 22
1
Unique Ordering
Hi R-Help,
data at bottom
I've been struggling with a problem where I need to order based on 1) the
Frequency "Freq" and 2) keeping each group of 3 of the same type together
"Var2" but I want across all groups it to go "high to low" based on the
earn factor.
Thank you!
structure(list(Var1 = structure(c(1L, 3L, 2L, 1L, 2L, 3L, 1L,
3L, 2L, 3L, 1L, 2L, 3L, 1L,
2008 Nov 11
1
R: R: Hidden Markov Models
Thank you for your prompt answer.
The breathing signal observations are the amplitude values as a function of time and phase.
According to our model the hidden states are the different breathing types.
Subjects, whose respiratiion process is regular, are likely to breathe, keeping the same cycle pattern/type,
for many consecutive cycles. therefore dwelling in the same hidden state.
The more
2010 Nov 15
1
Executing Command on Multiple R Objects
Hello Everyone -
I want to print a number of results from lme function objects out to a txt
file. How could I do this more efficiently than what you see here:
out2 <- capture.output(summary(mod2a))
out3 <- capture.output(summary(mod3))
out4 <- capture.output(summary(mod5))
out5 <- capture.output(summary(mod6))
out6 <- capture.output(summary(mod7))
2010 Sep 06
1
nlme Output
Everyone -
What do the NaN's mean here? Is this analysis a problem?
Linear mixed-effects model fit by maximum likelihood
Data: tmp.dat
AIC BIC logLik
1611.251 1638.363 -797.6253
Random effects:
Formula: ~1 | group_id
(Intercept) Residual
StdDev: 0.0003077668 9.236715
Fixed effects: AvgTrials ~ time + factor(group_id) + time *
factor(group_id)
2012 Apr 20
1
depmixS4+transition
Dear helpers,
is there any possible that transition (in depmixS4) is in scale of two
variable, e.g transition=~scale(x1,x2)?
If it can be, how transition of two variable (covariate time) can be worked
in depmixS4-hidden markov model for time series.
Many thanks,
nglthu
--
View this message in context: http://r.789695.n4.nabble.com/depmixS4-transition-tp4572726p4572726.html
Sent from the R help
2010 Sep 20
0
depmixS4 1.0-0 on CRAN & vignette/paper on jstatsoft.org
depmixS4 has reached some form of maturity and therefore we have bumped its
version number to 1.0-0 which is now on CRAN:
http://cran.r-project.org/web/packages/depmixS4/index.html
depmixS4 fits hidden (latent) Markov models of multivariate, mixed
categorical and continuous data, otherwise known as dependent mixture
models. Responses or observations can be modeled using GLMs, and
additionally
2010 Sep 20
0
depmixS4 1.0-0 on CRAN & vignette/paper on jstatsoft.org
depmixS4 has reached some form of maturity and therefore we have bumped its
version number to 1.0-0 which is now on CRAN:
http://cran.r-project.org/web/packages/depmixS4/index.html
depmixS4 fits hidden (latent) Markov models of multivariate, mixed
categorical and continuous data, otherwise known as dependent mixture
models. Responses or observations can be modeled using GLMs, and
additionally
2012 May 02
1
DepmixS4
Hi I am trying to use depmixS4 package. Based on the documentation, it seems
that depmix allows one to fit an HMM model based on a training data with
time-varying co-variates. However, I did not find any routines which can
help test the accuracy on the fitted HMM model on out-of-sample data.
Can someone confirm if that is indeed the case?
Also are there any alternate packages for the same?
Thanks