Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def hpdplot2d(x_samples, y_samples, bins, perc=0.95, extent=None): | |
| if extent is None: | |
| xmin, xmax = np.min(x_samples), np.max(x_samples) | |
| ymin, ymax = np.min(y_samples), np.max(y_samples) | |
| else: | |
| xmin, xmax, ymin, ymax = extent | |
| x_flat = np.linspace(xmin, xmax, bins) | |
| y_flat = np.linspace(ymin, ymax, bins) | |
| x,y = np.meshgrid(x_flat, y_flat) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| retrodesign <- function(A, s, alpha=.05, df=Inf, n.sims=10000){ | |
| z <- qt(1-alpha/2, df) | |
| p.hi <- 1 - pt(z-A/s, df) | |
| p.lo <- pt(-z-A/s, df) | |
| power <- p.hi + p.lo | |
| typeS <- p.lo/power | |
| estimate <- A + s*rt(n.sims,df) | |
| significant <- abs(estimate) > s*z | |
| exaggeration <- mean(abs(estimate)[significant])/A | |
| return(list(power=power, typeS=typeS, exaggeration=exaggeration)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This file is part of Patsy | |
| # Copyright (C) 2012-2013 Nathaniel Smith <[email protected]> | |
| # See file LICENSE.txt for license information. | |
| # R-compatible spline basis functions | |
| # These are made available in the patsy.* namespace | |
| __all__ = ["bs"] | |
| import numpy as np |
NewerOlder