I am using the markovchain package in R. The is.accessible function tells me that I can get from state A to state B with the transition matrix. I would like to be able to exhaustively list out the trajectories that can achieve this (not including cycles). Is there a way to do that with the package? Or do I need to build a simulation?
Related
I'd like to know how to apply frequency filters to a time series in R and get the result back in the time domain (e.g. fourier transform -> get rid of certain frequencies -> inverse fourier transform) or a similar approach (there does not seem to be a suitable inverse function to fft). From what I have seen people recommend the signal package, but I don't seem to be able to get sensible results with this package. So to put an example. Let's say I have a simple monthy time series:
plot(log(AirPassengers))
Let's say I want to extract these seasonal fluctuations here using a band-pass filter (i.e. get rid of the trend and the small higher frequency movements). If someone could produce an R code do do this by fourier methods, preferably using a package function, and explain it that would be of great help to get me started.
I'm trying to make a hierarchical clustering tree from the clustering produced by Seurat's clustering function. Their functions, BuildClusterTree and PlotClusterTree, produce a frankly ugly tree based on SNN (shared nearest neighbor) algorithm that you can't manipulate with ggplot2. I'm trying to figure out how to use other functions to plot the clustering already produced by Seurat, but I can't figure out how or what R package would work best. Does anyone have any advice for me?
I would suggest the clustree package for this purpose
I would like to analyze data which is sampled at different frequencies. There is a concept developed by Ghysels called Mixed-data sampling (MIDAS). I tried to find some functions or packages in R applying this method, but could't find anything. Does anybody know any function or package in R for this concept?
I am using the bnlearn package in r, which generates Bayesian networks using data. I am trying to get more connections between the data nodes, and hence, I am trying to decrease the weight threshold necessary to generate arcs between the nodes. I am using the gs function in the bnlearn package, which uses a grow-shrink algorithm. So far, I have tried modifying the alpha threshold, but that appears to change the threshold of error.
Ultimately, my goal is to have the algorithm create more arcs between the points.
Thanks
You might need to first find the weight of all arcs, and selectively filter them yourself. I don't think bnlearn has that built in.
When working with phylogenetic tree data in R (specifically when working with "phylo" or "phylo4" objects) it would be useful to normalize branch lengths so that certain taxa (the ones that evolve faster) do not contribute a disproportionate amount of branch length to the tree. This seems to be common in computing UniFrac values, as can be found in the discussion here: http://bmf2.colorado.edu/unifrac/help.psp. (I need more than just UniFrac values, however).
However, I cannot find a function that performs this normalization step. I have looked in ape, picante, adephylo, and phylobase. Could someone direct me to a package that includes this function, or a package that makes writing this kind of function straightforward?
Are you looking for a function to just scale the branch lengths of a tree? If so, compute.brlen() in ape will do it. There are built in options for Grafen's rho and all = 1. You can also supply your own function.
I don't know if UniFrac does some other kind of branch length scaling. But if so, you could write your function and pass it.