Displaying 4 results from an estimated 4 matches for "n_state".
Did you mean:
_state
2017 Aug 28
0
"Improvement with the R code"
Hi,
I think you overthought this one a little bit, I don't know if this is the
kind of code you are expecting but I came up with something like that:
generate_transition_matrix <- function(data, n_states) {
#To be sure I imagine you should check n_states is right at this point
transitions <- matrix(0, n_states, n_states)
#we could improve a little bit here because at step N+1 source is dest
from step N
#but it would not be as readable
for (k in 1:(length(data) - 1)) {...
2017 Aug 28
5
"Improvement with the R code"
Hello,
I am trying to implement a formula
aij= transition from state S_i to S_j/no of transition at state S_i
Code I have written is working with three state {1,2,3 }, but if the number
of states become={1,2,3,4,......n} then the code will not work, so can some
help me with this.
For and some rows of my data frame look like
2017 Aug 28
0
"Improvement with the R code"
...t; wrote:
>>
>>> Hi,
>>>
>>> I think you overthought this one a little bit, I don't know if this is
>>> the kind of code you are expecting but I came up with something like that:
>>>
>>> generate_transition_matrix <- function(data, n_states) {
>>>
>>> #To be sure I imagine you should check n_states is right at this
>>> point
>>>
>>> transitions <- matrix(0, n_states, n_states)
>>>
>>> #we could improve a little bit here because at step N+1 source is
>>...
2017 Aug 28
0
"Improvement with the R code"
...>>>>
>>>>> I think you overthought this one a little bit, I don't know if this is
>>>>> the kind of code you are expecting but I came up with something like that:
>>>>>
>>>>> generate_transition_matrix <- function(data, n_states) {
>>>>>
>>>>> #To be sure I imagine you should check n_states is right at this
>>>>> point
>>>>>
>>>>> transitions <- matrix(0, n_states, n_states)
>>>>>
>>>>> #we could improve...