search for: probup

Displaying 4 results from an estimated 4 matches for "probup".

2017 Nov 02
2
repeat a function
...ecause the probabilities will depend on my node and is not always the same per row (e.g. if N> jmax, jmax being defined in another function) I found a workaround. Please see below. Thereafter I want to optimize this function. Hopefully it works. Many thanks, Eric HWMProb <- function(N) { ProbUP<- function( a, j, dt) 1 / 6 + ((j ^ 2 * Mfactor(a, dt) ^ 2 + j * Mfactor(a, dt)) / 2) ######### Probability X going up ProbMID<- function(a, j, dt) 2 / 3 - (j ^ 2 * Mfactor(a, dt) ^ 2) ######## Probability X going middle ProbDWN<-function( a...
2017 Nov 03
0
repeat a function
Hi Well, I am not an expert in this field so I cannot comment your approach. I wanted only to point out that building matrix your way is like scratching your left ear with right hand, especially in R. What if you want increase size of your matrix? E.g. you use function ProbUP once for row "0" and than for rows different from jmax (if I correctly understand your code). Use of any function depends on two parameters (row and column, let them call u and v) > ProbUP<- function( a, j, dt) 1 / 6 + ((j ^ 2 * Mfactor(a, dt) ^ 2 + j * Mfactor(a, > dt)) / 2)...
2017 Nov 01
3
repeat a function
...ulates different functions (please see code below), using j= 0:2 for each j. It only populates prb if I specify each function independently in the global environment and then run the loop with the iF statement, as per below. for (j in 0:2) { if (j==0) { prb["0","1"] <- ProbUP(a,j,dt) prb["0","0"] <- ProbMID(a,j,dt) prb["0","-1"] <- ProbDWN(a,j,dt) } else { if (j==jmax) { prb[paste(j,sep = ""),"1"] <- TOPProbUP(a,j,dt) prb[paste(j,sep = ""),"0"] <- TOPP...
2017 Nov 02
0
repeat a function
...see code below), using j= > 0:2 for each j. > > It only populates prb if I specify each function independently in the global > environment and then run the loop with the iF statement, as per below. > for (j in 0:2) { > if (j==0) { > prb["0","1"] <- ProbUP(a,j,dt) > prb["0","0"] <- ProbMID(a,j,dt) > prb["0","-1"] <- ProbDWN(a,j,dt) > } > else { > if (j==jmax) { > prb[paste(j,sep = ""),"1"] <- TOPProbUP(a,j,dt) > prb[paste(j,sep = &quo...