instruction
stringlengths
9
38.7k
for a project I'm doing an interrupted time series analysis using a segmented linear regression. I'm trying to show that the trend (or slope) change after the first intervention (the first dotted line) was counteracted by the trend (or slope) change after the second intervention, i.e. that the trend/slope in the post-2...
Suppose I have the Bernoulli random variables $S_t$ for $t=1,\cdots, T$ and for an issue related to my problem, I want to express $P[S_t=s_t\mid S_{t-1} = s_{t-1}]$, by using the law of total probability \begin{equation} P[S_t=s_t\mid S_{t-1}=s_{t-1}]=\int_{\mathbb{R}}P[S_t=s_t\mid S_{t-1}=s_{t-1},x_{t-1}]f(x_{t-1}\mid...
shapiro.test(U_ER) Shapiro-Wilk normality test data: U_ER W = 0.98093, p-value = 0.002173 agostino.test(U_ER) D'Agostino skewness test data: U_ER skew = 0.0057972, z = 0.0381773, p-value = 0.9695 alternative hypothesis: data have a skewness given the test, indicating the different results, can I consider my var...
I am trying to understand the concept of the design matrix (or matrices) in mixed effect models evaluated using the lme4 package from R. In a standard fixed effect linear model (e.g. glm), there is a single design matrix which must have fewer columns than rows, and none of the columns can be co-linear with any other co...
I'm trying to make sense of the "The Bandit Gradient Algorithm as Stochastic Gradient Ascent" proof in Sutton and Barto's intro to RL textbook. I'm stuck on the line $E[(q_*(A_t)-B_t)\frac{\partial\pi_t(A_t)}{\partial H_t(a)}/\pi_t(A_t)] = E[(R_t-\bar{R}_t)\frac{\partial\pi_t(A_t)}{\partial H_t(a)}/\pi_t(A_t)]$$ They s...
Are there any R functions (or other free software) for calculating power/sample size needed to compare 2 AUCs (area under the curve)? Specifically, suppose you want to fit 2 different models to a dataset to predict a binary outcome, and you want to test whether the AUCs from these 2 models differ. Given that the 2 AUC...
My goal is to predict components that are going to fail the soonest in order to replace them. To date, we've deployed a binary classification model, with the positive class representing a component's failure within the next three months (a relatively arbitrary time period), and the negative class representing the compo...
In an attempt to implement a form of conditional distance correlation for random variables represented as vectors of observations, I came upon this paper that nicely extends the notion of distance correlation/covariance to the conditional case, but am having some trouble figuring out how to implement this in practice/...
Im trying to find a method to normalize the slope value for the historical net profits of many companies. But the problem arises when certain companies are clocking profits in thousands, and some in millions. The slope is higher for the latter. But there are chances where the growth of a lower slope company is higher t...
I have applied PCA to a dataset using two different R packages viz. "stats" and "FactoMineR". For both models, I am getting different loadings. What may be the probable reason behind such a difference? prcomp {stats} Rotation (n x k) = (6 x 6): PC1 PC2 THN 0.5597064 -0.1736148 GRH ...
I've come across an issue while analyzing some data and haven't been able to find a similar question on the site. I'm working with data concerning the impact of certain genes and smoking on the concentration of a particular drug in the blood. My variables are dichotomous (gen1 = 1/0, gen2 = 1/0, smoking = 1/0). The gen...
Given a r.v. $X \sim N(0, 1)$, what is the density of $Z = X I(\lvert x \rvert < \lambda)$. I am confused with the truncated Gaussian $Y = X$ if $\lvert X \rvert < \lambda$ otherwise $Y = 0$. My question is that whether $Z$ and $Y$ has same density and why. My attempt: I think the density of $Z$ is normal say $\phi(x)$...
I want to calculate the length of a signal. By length I don't mean the number of points, but the actual distance from point to point. Imagine that a person would walk along the signal, what would be the distance traveled? The points are evenly spaced on the x-axis. This should probably be done via integration, but I cu...
I want to compare performance between 100 groups. Each group can be described by a value, say group size. In other words, I want to see how performance changes with group size. Each group has multiple members. Each member can be a member of more than group. The unit of analysis is at the member level. OLS fails because...
hope this question fits here, any help would be greatly appreciated. Background: I´m working on a data generator for customer default data. The default rate shall depend on multiple categorical independant characteristics. The marginal distributions shall be adjustable. The issue: The default rates for a specific chara...
I'm looking for to compress an image $X$ into a smaller image $x$. But not only compress, also reduce its view into a simplier view that are linear separable. My question is: Can I use linear autoencoders to turn an image $X$ into a simplier linear image that is linear separable?
My data set is having a column Gender, so I have to apply One Hot Encodingto perform KMeans Clustering. Q1. Should I take care about dummy variable trap here ?, should I remove one of the dummy columns ? Q2. Should I use Label Encoding or One Hot Encoding in case of Clustering Algorithms ?
I want to do moderated mediation using the PROCESS Macro (Version 4.2). Model 17 resembles what I need to do the most, however it only allows 2 moderators. I want to test 4 moderators at once. Even using the syntax, i think there is no way around it, as there are only the zmatrix and wmatrix statements. Hayes (2018, p....
I have this dataset made up of several questions, each with ordinal answers (likert-like) which unfortunately include a "don't know" option. The dataset is split in two: one portion from year 2019, one from year 2023. The samples are independet (no way to know these are the same people that answered the first survey) A...
Hello, I submitted a study with a linear regression model. My sample size is >1000, so I invoked CTL. The statistics reviewer is requesting that we check assumptions of normal distribution (specifically normal distribution of errors), and if not met, he/she recommends that we switch to logistic regression using one of ...
I'm currently working on a research project where I want to explore whether there is a relationship between group membership and scores obtained on a questionnaire. I have three distinct groups, and the questionnaire scores follow a continuous distribution without being normally distributed. After some research, I deci...
I have a question about the output of my glm model WITHOUT an intercept. I am comparing the number of infected leaves on plants in different months. In the case of a model WITH an intercept (using the default log link of the Poisson model), the (Intercept) should represent the log of the mean number of infected leaves ...
I am currently working with a dataset of Facebook posts that have variables such as total engagement and views. I am trying to group these two variables into discrete levels according to how big the value is (for example, divide views in 10 clusters, 0 for lowest and 10 for highest). These discrete groups are then used...
I have a question which may seem stupid. This is for a retrospective cohort study. I have a table like this for my outcome: Among the 20,000 patients in group A, 4671 are dead (23.55%). Among 50,000 patients in group B, 5755 are dead (11.5%). I need to calculate the risk ratio for death (group A vs group B) If I calcu...
I am not familiar with statistics and thus nor am I familiar with the methodological reasoning behind it so can someone please explain the reasoning behind the following results: I have an outcome (lets say hypertention) and another outcome (lets say blood pleasure) which both are related to the cardiovascular health. ...
I am training two different binary classification models (LGBM, Catboost) on the same CV splits of a moderately imbalanced dataset. I would like to compare their performance. Obviously, if we are to compare them globally we can compare their corresponding metrics (e.g. AUC). However, I am interested to compare their er...
I am trying to understand how lme4's mixed modeling works, specifically its random effects design matrix "Z". I have the following R code: library(lme4) A = as.factor(c(1,1,1,1,2,2,2,2)) B = as.factor(c(1,1,2,2,1,1,2,2)) R = c(1,2,3,4,6,7,9,11) + runif(8) remdl = lmer(R ~ (1|A/B) + (1|B)) summary(remdl) getME(remdl, "Z...
I am attempting to use ALS for matrix factorization, using a loss function that includes user and item biases $c_i$, $d_j$, $$ L = \sum_{(i,j) \in S} (r_{ij} - x_i\cdot y_j^\top - c_i - d_j)^2 + \lambda(\Vert x_i \Vert^2 + \Vert y_j \Vert^2 + c_i^2 + d_j^2) $$ where $r_{ij}$ is the rating given by user $i$ on item $j$,...
I have calculated a linear mixed model in R. My outcome variable is called VPA and is a continuous variable. For simplicity, let's say I have two categorical variables as fixed effects - group (with 2 categories) and stimulus (with 4 categories). IF I do it like this, then the result shows that group is nonsignificant ...
What is the Observed graph? Is it for train data? What is the Level graph? Is it for test data? In Simple exponential smoothing, just by looking at the graph below, how can we know whether it is a good model or not? Regards David
If for a given problem the fisher information matrix is diagonal or block diagonal, from the estimation point of view, what does it mean? Does it mean, for 2 parameters in different blocks, the estimation can be done independently? Searching for one and then for the other? To be concrete, assume a model with 2 paramete...
I have data that reaches a peak then declines. While I might do this as segmented or spline regression, there is a complication. The position of the knot appears to differ depending on the level of a factor in the data. If the factor is "A", then the peak appears to exist at position 5, but if the factor is "B", the pe...
I was attempting to replicate the results of a paper and ran PACF plots through R Studio, Stata, and EVIEWS for the UK debt-to-GDP ratio. I received quite different plots in return. Can anyone shed some light on why this is the case? My understanding is that the regressions that make up the PACF should return the same ...
I have two outcomes given a population of people. report a headache report a migraine And all those people are broken into two sets of groups. by sex (male and female) by deprivations score (1, 2, 3, 4, 5) - this is a measure of several factors, but think of it as a measure of poverty. Each individual can only repo...
I'm trying to learn SVM by myself, and I'm stuck after getting the dual of SVM. I understand getting the dual after the primal. But, I am stuck here. Please help. We assume that the hard margin case here (the data of two classes are perfectly linearly separable). $$ MAX ∑_−1/2∑∑____(_)^_ \\ or \\ MIN 1/2∑∑____(_)^_ - ∑...
I have a linear regression problem but am not very familiar with statistics so wanted to make sure I am on the right track. I am trying to answer the question: does the addition of additional "independent" variables improve my prediction, or does the data only depend on one variable? Here is some example data I have to...
I have 8000 items. They've each been rated on a scale from 1-7. I have ~40 non-mutually exclusive dichotomous properties for each item. I build a regression model with those 40 as predictors of the ratings. My goal is to find the predictors that are most predictive of ratings, and then based on those, choose the 10 ite...
My purpose is to compare my data with the general population data derived from a published report. I can only extract mean, median, 5th, 95th and 97.5th percentiles from it. Also, My data is non-normally distributed. Can I use one-sample Wilcoxon signed rank test? But this test only compares the median and I am doubt w...
Suppose I have an i.i.d. random sample of size $n$ s.t. $X_i \sim \mathcal{N}(\mu, \sigma^2)$ for all $i$. But suppose my observed sample is left censored, such that any $x_i$ observation is replaced with some constant value $U$ for all $x_i \leq U$. So $X_i$ is left-censored at $U$. I am interesting in estimating $\ba...
Especially with chatGPT now, there is a lot of interest in generative models for healthcare for creating synthetic patient data to amplify patient counts, e.g. for rare diseases. These are then supposed to be used for purposes of statistical inference, e.g. to compare patient outcomes, estimate risk ratios etc. My ques...
Is it possible to calculate a spatial regression with variables at different spatial levels WITHOUT any aggregation/disaggregation? Or is it necessary to consider the multilevel regression? dependent variable (var): metric var at point level (x,y) independent vars: nominal, ordinal, metric vars at different spatial lev...
I have some data that is causing a bit of a pickle. We ran a dietary experiment on 500 invertebrates for 4 weeks; 250 invertebrates were given a Phosphorus-enriched diet and the other 250 were given a Phosphorus-limited diet. Half of these invertebrates were housed in a 16C room and the other half were housed in a 24C ...
I am training a cGAN on the problem of reconstructing a density matrix. My inputs to the network are matrices and expectation values. That is, I have a set $(A,x)$ where A are measurement operators, essentially a set of 256x256 matrices, and x are numbers which corresponds to expectation values for each A. Well, I have...
The Maximum Rank Correlation estimator is the vector that maximizes the Mann Whitney statistic: given vectors $x_1,\ldots,x_m$ and $y_1,\ldots,y_n$, the estimator is the $\beta$ maximizing $\sum_i\sum_j 1(\beta^t x < \beta^t y)$. According to this old post, the fastest estimators run in $n^2\log(n)$ time. I still need ...
I have historical data for 100 stocks (call them A). I would like to train a model jointly on all stocks which will learn from the cross sectional historical activity, to predict another set of stocks (B), where the the intersection is only partial (some stocks get delisted, some are added etc.) Is there a way to do th...
solution: you have a single node tree and you have this explanation. "Because of the inability to split the dataset on any variable, the average of the entire data set is applied as the estimate for all predictions." For a single node tree, I know that you cannot make a split. You have a training set. let's say you h...
I ran a simple ordinary least squares (OLS) model of the form y = b_0 + b_1 * T + b_2 * D + b_3 * P + e where y is the number of murders in a given month, T is the number of months passed from the start of the study, D is a dummy variable indicating whether the observation was before or after an intervention (in this c...
I am curious about how the random effects design matrix works, within a mixed model. I know that the columns of a random effects design matrix are allowed to be collinear with each other, but I am curious as to why this is the case. My question is: Does a random effects design matrix allow collinear columns because (1)...
I am attempting to identify the appropriate code for calculating clustered standard errors following the execution of a regression using the multinom() function. I attempted the following code, but consistently encountered an error: Calculate the cluster-robust variance-covariance matrix vcov_clustered <- vcovCL(reg1,...
I study the composition of the labor force, which consists of two groups of workers in a particular industry, full-time and part-time employees. I have data for two years, and each year I observe a negative impact of alternative employment opportunities (that is, the number of jobs in other industries) on the ratio of ...
I recognize that if the population variances are not equal, it's not really a pooled variance to start with, but I wanted to keep the question succinct. The scenario here is that I begin with a sample that has a certain mean and variance due to two "features", A and B. I can then take a second sample that varies only d...
I'm doing a question about a sequence of i.i.d. random variables that all have CDF $F(x) = 2^\alpha(2 - x)^{-\alpha}$ for $x < 0$ and $F(x) = 1$ otherwise. Without asking the whole question, basically, it asks about the CDF of the minimum of these random variables. I thought about identifying a common distribution. To ...
I have read that many bell curves we see in nature is just a consequence of the CLT, because those things are just the result of many small additive causes (e.g. human height). Then my question is: Are all gaussians like that? Or can we find an example of some phenomenon that follows 'pure' normal distribution, and not...
I am currently working on a multiclass classification problem where I have categorical variables that I've encoded using binary representations as follows: 0 -> 00 1 -> 01 2 -> 10 3 -> 11 My approach involves using a neural network with two output neurons, each having a sigmoid activation function. I use Mean Squared ...
I have applied Chi square test between Gender and Practice of specific norm (4 levels; Daily, Weekly, Monthly, Quarterly) to check the association. Tabulated statistics: Gender, Practice Rows: Gender Columns: Practice 1 2 3 4 All 1 14 69 25 7 115 2 7 25 60 23 115 All 21 94 ...
I made a function that implements the clustering algorithm in the research article "Clustering compositional data using Dirichlet mixture model" (2022). I am now trying to figure out which model to choose for my data (Dirichlet distributed, sample size of 250, and I do not have the true cluster assignments). I thought ...
Is there a better way to do so than simply by taking posterior parameter estimates and calculating the Spearman or Pearson correlation between them? Anything specific to having posterior samples from RStan?
A lot of machine learning models aim to approximate probability distributions. Let’s say P is the distribution of the data and Q is the distribution learned by our model. How do you measure how close Q is to P? Please include sources/references if possible. This question is from Chip Huyens ML interviews book
What kinds of colormaps are best for displaying continuous values in scatter plots (notably due to the background color of the scatter plot)? So far, I've been using perceptually uniform sequential colormaps for such data. However, if I display this scatter data on a white background, then the lighter end of the colorm...
I have age distributions for more than $m>100$ different populations, each of varying sizes $(n_1, n_2, \dots, n_m)$. I'd like to create a regression model where these age distributions are used as exogenous variables to predict outcomes $(y_1, y_2, ..., y_m)$. Assuming that the Gamma distribution provides a fairly acc...
I am working on a scientific paper comparing physicochemical data from the river and two well rows (3 groups of data) - see example picture: In my study, I want to see if there are statistically significant differences in the content of selected parameters (chlorides, sulphates etc...) between the a) river and row A, ...
I got a normal mixed model with his general type being: y=Xα+Zβ+e. I am confused about the distribution of y, β, e following. I know their elements following normal distribution but if I want to focus on their vectors, they are also following normal distributions or they following multivariate normal distribution?
I have a standard split-plot design, having the three predictors: A :: [ Categorical, Unordered, 2 Levels ] --> (1, 2) B :: [ Categorical, Unordered, 4 Levels ] --> (1, 2, 3, 4) C :: [ Categorical, Unordered, 2 Levels ] --> (1, 2) Predictor B indicates the main plots, Predictor A indicates the treatment applied to en...
Suppose we have a dataset $X$, where each piece data of $X$ is a row vector, and the data generation process satisfies Gaussian-Markov assumption. If we do ridge regression on $Y\sim 2X$, how does the regression coefficients and their standard errors change comparing with the regression result when $Y\sim X$? (This is ...
I am reading the book Information Theory and Statistics of S. Kullback. In page 8 ((4.3) it is shown that the KL divergence between the joint bivariate normal and the product of the corresponding marginals can be expressed as (notation is from the book) I(1:2)=-0.5log(1-rho²) where rho is the correlation coefficient. T...
I am analyzing some data with attributes about how long it takes to commute, and it is an overlapping ordinal variable like the following: Time Number of People 1-5 minutes 10 6-10 minutes 24 less than 10 minutes 15 11-20 minutes 32 Between 10-15 minutes 3 More than 15 minutes 30 21-30 minutes 4 ...
I am using R. I have a data set with a binary (0,1) response and both continuous and categorical predictors. I would like to test the overall importance of these predictors one by one, and I am looking for suggestions on how to do this. I am not trying to select an overall model yet. I am just trying to see which varia...
There's a relevant question here that doesn't quite answer my question, but I'm unable to comment. Define softmax to be $$a_i = \text{softmax}(u_i)= \frac{e^{u_i}}{\sum_j{e^{u_j}}}$$ As the linked post shows, if $u_i$ increases, it will always cause $a_i$ to increase and will push all other $a_j$ down because $\frac{\p...
I'm looking for a modern machine learning book with graduate-level treatment of more recent topics such as diffusion and generative models, transformers etc. I have a hard copy of Deep Learning by Goodfellow and Bengio; while I liked the book and read it extensively when it was published, it is a bit dated now. I'm con...
I'm still a novice when it comes to statistics, but I've noticed that, while many stats textbooks mention that the various statistical tests (t-tests, ANOVA, etc.) rest on certain assumptions about the sample distribution and/or the underlying population distribution, few (that I've seen, at least) seem to compile thes...
Suppose that the random variables in a sample $Y_1, Y_2, \ldots, Y_n$ are iid with values in $[0,1]$, and that an investigator knows that the underlying probability density $f_Y(y)$ has the form $f_Y(y)=f_Y(y, a, b) \equiv\left\{\begin{array}{rll}a & \text { for } & 0 \leq y<1 \\ b & \text { for } & 1 \leq y<2 \\ 1-a-b...
This paper says: *2. For any p-values that are significant after FDR correction, construct a CI for the corresponding test with coverage $1-\alpha^{'}$, where $\alpha^{'}$ is: $\alpha^{'}=\frac{k}{m}\alpha$. It also says FCR adjusted BH-selected CIs guarantee the expected FCR is less than or equal to $\alpha$ if the...
I'm trying to verify that I'm using rlnorm correctly. I made the following script set.seed(123) draw2 <- rlnorm(1000, meanlog = 0, sdlog = 1) draw2 <- tidyr::tibble(draw2) log(mean(draw2$draw2)) I was expecting the log of the mean of the draws to be close to zero. Not 0.5138 Any help would be appreciated.
I have a procedure for generating the design matrix of an experiment that uses only fixed effect predictors. The procedure depends on knowing the relationship between all pairs of predictors in the experiment: crossed or nested. Then, based on these pairwise crossed/nested relationships, the design matrix is constructe...
The very basic framework for mediation analysis (as I understand it) is below (DV = dependent variable, IV = independent variable): Step 1: DV ~ IV Step 2: Mediator ~ IV Step 3: DV ~ IV + Mediator – check if the effect of the IV is reduced or lost after controlling for the mediator However, if the mediator has to be lo...
I had read an interesting paper a few years back on Buffons 'noodle' (https://doi.org/10.2307/2317945) and when attempting a problem recently I thought I could use it as a tool. I have provided a short summary of the background information in the first header which can be skipped if you are already aware of the problem...
Suppose you are trying to fit a continuous variable y depending on some input x ( es y= ax+b) and you are using a multivariate distribution as likelihood for the fitting. Does using a multinormal distribution with a non diagonal covariance matrix as likelihood means necessarily that the target variable y is not norm...
I have a question regarding the correlation between dummy-coded predictors in mediation analysis with psych::mediate in R. I have 3 categorical conditions for my predictor. The results showed me a standardized correlation of -0.5 between the dummy-coded predictors, which makes sense if you calculate correlations betwee...
I'm running a mixed logistic regression on a dichotomous variable in R with glmer, with two fixed effects in interaction: one is a factor with two levels, and the other is a factor with three levels. I wonder if there is any theoretical reason why to use "summary(model)" or "car::Anova(model)" to interpret the output,...
I am asking because I am lost and I failed my first submission because of wrong analysis. The goal of my experiment is to examine the moderating role of product involvement in the relationship between maximizing tendency and intentions to switch a product. Maximizing tendency (the independent variable) is measured as a...
I have a very large dataset (2.4 million vertices and 123 million edges) and I'd like to visualize running multisource Breadth-First Search (BFS) on it. In particular, each starting node is given a different color, and when a colored node's unvisited neighbor is popped from the queue, that neighbor gets the same color ...
I am currently attempting to understand "Question 2" at this link but having many difficulties. The problem is as follows: A coin has a chance of landing heads with an unknown probability chosen from a [0, 1] uniform random distribution. I then flip this coin and see $h$ heads and $t$ tails in a total of $h + t$ flips...
I am running an experiment to find out if the pattern of expected and actual guilt people feel when making and not making a purchase is dependent on proximity to their payday (e.g. do people expect/actually feel more guilt about making than not making a purchase toward the end of the month than at the start or middle, ...
Apologies if this is a very simple question--I am very new to Shapley values! I am reading through an article on Shapley values written by some of the original authors of the SHAP paper. While their exposition is generally very clear, the technical details in section 1.6 are somewhat confusing (see picture below) In th...
This is something which has always confused me. Suppose we take a standard statistical regression model: \begin{equation} Y_i = \beta_0 + \beta_1 X_i + \epsilon_i \end{equation} where: $Y_i$ is the response variable $X_i$ is the predictor variable $\beta_0$ and $\beta_1$ are the coefficients $\epsilon_i$ is the error ...
I am trying to model CO2 fluxes (fco2) using a number of environmental parameters using a GAM in mgcv. Specifically, I have leaf temperature (tl), vapour pressure deficit (vpd), and soil water content (swc). vpd is a function of tl, air pressure and relative humidity (both not measured). I getting the best model respon...
I have a question regarding my regression analysis. I want to regress y ( output in construction) on z (temperature deviation from baseline). The temperature deviation is going to lead to x (less hours worked) which is going to influence y (construction output). So basically I am stating that $y(x(z)).$ Can I then dire...
On Wikipedia, there is a page for the inverse Gaussian distribution and the normal-inverse Gaussian distribution. And I observed some confusion in other websites: they say normal-inverse Gaussian instead of inverse Gaussian. So I'm wondering whether there are other names. The name Wald distribution is proposed at some ...
I have the following question about Conditional Probability Distributions vs Marginal Distributions. To provide some context, I will post my current understanding of this issue in two parts - followed by my question. Part 1: Suppose we take a standard statistical regression model: \begin{equation} Y_i = \beta_0 + \beta...
Given the following regression equation $mpg_i=\beta_0 + \beta_1 weight_i+ \beta_2 ln(hp_i)+ \beta_3 diesel_i + \beta_4 ln(torque_i) + \beta_5 ln(torque_i) + \beta_6 year_i+\epsilon_i$ with the following R output: How to calculate the standard error of the dummy variable diesel (which is 1 when the car has a diesel en...
So I'm currently training a model where the dependent variable is continuous and 9/11 of the independent variables are categorical, some of these categorical variables have upwards of 10,000 classes so I've grouped any of the classes that have a frequency of less than 1 into a class called "other". Note that these clas...
I have a graph of 100 nodes. I know that there are 2 clusters of nodes of equal size 50. I created (kind of like a training set) the following instance of the problem (see below, I have some values to compare nodes interactions). I could create more matrix like that and learn on them if needed but I'm not sure it's the...
I have a hard time wrapping my head around this. I know that in case of measurement errors, the OLS estimate is biased downwards zero. Omitted variables can bias the explanatory variable of interest upwards or downwards, therefore in theory could it be the case that the 2SLS estimate is smaller than OLS?
I am doing an impulse response analysis involving 3 time series A, B, and C in R. Following Lutkepohl approach, I used the log and diff functions to make them stationary. After creating the VAR model, I did a Cholesky decomposition of the covariance matrix, and I getting this output: A B C A 0.04173162 0.00000...
I'm doing a random exercise of comparing statsmodels and sklearn regression tools, specifically Poisson Regression (unregularised GLM). I am trying different libraries on the Insurance dataset from statsmodels import statsmodels.api as sm data = sm.datasets.get_rdataset('Insurance', package='MASS').data It has categor...
I calculated mutual information with the PyInform function with local = True MI = mutual_info(xs, ys, local=True) In blue you see MI between the yellow and green line. Can anyone tell me why MI goes into the negative? Should I set the negative values to zero or do you think made an error somewhere else?
This might be a silly question, but I've been asked about interpretation of a paper and have a query on how much one can ascertain without access to the raw data used, illustrated by example here. In this paper, the authors report finding that artificial sweetener use is associated with increased risk of cancer. They u...
Consider you have some distributions $Z_1$ and $Z_2$ of which you select $n_1$ samples from $Z_1$ and $n_2$ samples from $Z_2$. We now add up these samples and take the mean. The question becomes, what is the distribution of $\mu$? Can this distribution be approximated via the CLT for sufficiently large values if $n$? ...
I get that the definition of the first quartile is the value of the data set in which it is greater than 25% of the data set; below I have defined a vector in R (which is already ordered) datold = c(12, 32, 32, 32, 32, 32, 35, 35, 35, 35, 35, 35, 35, 38, 38, 38, 38, 38, 38, 38, 38, 42, 42, 42, 42, 42) Notice that th...
Let $X$ ~ Uniform$[a,b]$ and $Y$ ~ Uniform$[c,d],$ where $a\le b\le c\le d.$ Find the probability density of $Z = X + Y.$ I know I have to use the convolution formula $$f_Z(z) = \int_{-\infty}^\infty f_X(z-y)f_Y(y)\,\mathrm dy.$$ However, I am struggling to find the region I must integrate over. I know for $z \le a...