timescales
Set of functions for analyzing the MD trajectory.¶
This submodule contains methods for estimating various timescales based on a Markov model.
implied_timescales(trajs, lagtimes, ntimescales=None, reversible=False)
¶
Calculate the implied timescales.
Calculate the implied timescales, which are defined by
the \(i\)-th eigenvalue \(\lambda_i\).
Note
It is not checked if for higher lagtimes the dimensionality changes.
Parameters:
-
trajs
(StateTraj or list or ndarray or list of ndarray
) –State trajectory/trajectories. The states should start from zero and need to be integers.
-
lagtimes
(list or ndarray int
) –Lagtimes for estimating the markov model given in [frames]. This is not implemented yet!
-
ntimescales
(int
, default:None
) –Number of returned lagtimes.
-
reversible
(bool
, default:False
) –If reversibility should be enforced for the markov state model.
Returns:
-
ts
(ndarray
) –Matrix containing the implied Timescales.
Source code in src/msmhelper/msm/timescales.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
estimate_waiting_times(*, trajs, lagtime, start, final, steps, return_list=False)
¶
Estimates waiting times between stated states.
The stated states (from/to) will be treated as a basin. The function calculates all transitions from first entering the start-basin until first reaching the final-basin.
Parameters:
-
trajs
(statetraj or list or ndarray or list of ndarray
) –State trajectory/trajectories. The states should start from zero and need to be integers.
-
lagtime
(int
) –Lag time for estimating the markov model given in [frames].
-
start
(int or list of
) –States to start counting.
-
final
(int or list of
) –States to start counting.
-
steps
(int
) –Number of MCMC propagation steps of MCMC run.
-
return_list
(bool
, default:False
) –If true a list of all events is returned, else the probability density together with the edges is returned.
Returns:
-
ts
(ndarray
) –Density probability of the time distribution. If
return_list=True
, return a sorted (!) list containing all times. -
edges
(ndarray
) –Array containing the edges corresponding to the probability, given in frames. Only for
return_list=False
.
Source code in src/msmhelper/msm/timescales.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|
estimate_transition_times(*, trajs, lagtime, start, final, steps, return_list=False)
¶
Estimates transition times between stated states.
The stated states (from/to) will be treated as a basin. The function calculates all transitions from leaving the start-basin until first reaching the final-basin.
Parameters:
-
trajs
(statetraj or list or ndarray or list of ndarray
) –State trajectory/trajectories. The states should start from zero and need to be integers.
-
lagtime
(int
) –Lag time for estimating the markov model given in [frames].
-
start
(int or list of
) –States to start counting.
-
final
(int or list of
) –States to start counting.
-
steps
(int
) –Number of MCMC propagation steps of MCMC run.
-
return_list
(bool
, default:False
) –If true a list of all events is returned, else the probability density together with the edges is returned.
Returns:
-
ts
(ndarray
) –Density probability of the time distribution. If
return_list=True
, return a sorted (!) list containing all times. -
edges
(ndarray
) –Array containing the edges corresponding to the probability, given in frames. Only for
return_list=False
.
Source code in src/msmhelper/msm/timescales.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
|
estimate_paths(*, trajs, lagtime, start, final, steps)
¶
Estimates paths and waiting times between stated states.
The stated states (from/to) will be treated as a basin. The function estimates transitions from first entering the start-basin until first reaching the final-basin. The results will be listed by the corresponding pathways, where loops are removed occuring first.
Note
This function is a simple wrapper and in contrast to estimate_wt it stores the whole MCMC trajectory in memory. Hence, it memory-hungry.
Parameters:
-
trajs
(statetraj or list or ndarray or list of ndarray
) –State trajectory/trajectories. The states should start from zero and need to be integers.
-
lagtime
(int
) –Lag time for estimating the markov model given in [frames].
-
start
(int or list of
) –States to start counting.
-
final
(int or list of
) –States to start counting.
-
steps
(int
) –Number of MCMC propagation steps of MCMC run.
Returns:
-
paths
(dict
) –Dictionary containing the the paths as keys and and an array holding the times of all paths as value.
Source code in src/msmhelper/msm/timescales.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
|
propagate_MCMC(trajs, lagtime, steps, start=-1)
¶
Propagate Monte Carlo Markov chain.
Parameters:
-
trajs
(statetraj or list or ndarray or list of ndarray
) –State trajectory/trajectories. The states should start from zero and need to be integers.
-
lagtime
(int
) –Lag time for estimating the markov model given in [frames].
-
steps
(int
) –Number of MCMC propagation steps.
-
start
(int or list of
, default:-1
) –State to start propagating. Default (-1) is random state.
Returns:
-
mcmc
(ndarray
) –Monte Carlo Markov chain state trajectory.
Source code in src/msmhelper/msm/timescales.py
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 |
|
estimate_waiting_time_dist(trajs, max_lagtime, start, final, steps, n_lagtimes=50)
¶
Estimate waiting time distribution.
Parameters:
-
trajs
(statetraj or list or ndarray or list of ndarray
) –State trajectory/trajectories. The states should start from zero and need to be integers.
-
max_lagtime
(int
) –Maximal lag time for estimating the markov model given in [frames].
-
start
(int or list of
) –States to start counting.
-
final
(int or list of
) –States to start counting.
-
steps
(int
) –Number of MCMC propagation steps of MCMC run.
Returns:
-
wtd
(dict
) –Dictionary containing waiting time distribution.
Source code in src/msmhelper/msm/timescales.py
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 |
|