instruction
stringlengths
9
38.7k
I have been working on a Classification problem. And I want to see how many features associate with the target variables. Let me share an example. I got this pairplot using target = 'Occupancy' sns.pairplot(df, hue=target) plt.show() A bit of data's background: This data is about predicting room's occupancy (occupied/...
I am trying to understand why large amounts of censoring (ie. many patients are censored) is undesirable in Survival Analysis. As a proof of concept, suppose there are 5 patients - all patients enter the study at the same time: patient1 has event at t1 patient2 has event at t2 patient3 drops out of the study at t3 pat...
I have a publication that provides a linear multiple regression equation from a meta-analysis. LOOCV was used to select the explanatory variables included in a final model from all possible models. A regression equation is provided in the publication. I want to calculate $\hat{y}$ for a new set of values and estimate t...
If I know about an omitted variable in the regression and the data for it is available. But I also know that this omitted variable is endogenous, because the dependent variable and the omitted variable cause each other (simultaneity). Should I include the omitted variable and does that introduce new problems for my var...
It appears to me that I can include all variables in the dataset into a causal forest (whether or not they are confounders), as the model would conduct feature selection to identify important variables to determine the treatment effect. Is the above statement true? If yes, then what would be the point of conducting Cau...
You are working on a binary classification problem with 3 input features and have chosen to apply a bagging algorithm (Algorithm X) on this data. You have set max_features = 2 and n_estimators = 3. Each estimator has an accuracy of 70%. Algorithm X aggregates the results of individual estimators based on maximum voting...
The VAR process is defined as: $$\begin{align} \mathbf{y}_t = A_1\mathbf{y}_{t-1} + \dots + A_d\mathbf{y}_{t-d} + \boldsymbol{\epsilon}_t, \quad t \in \mathbb{Z} \end{align}$$ where $\boldsymbol{\epsilon}_t$ is a whitenoise process, in particular $\mathbb{E}[\boldsymbol{\epsilon}_t] = 0$ and $\mathbb{E}[\boldsymbol{\e...
I have read that centering the values of predictors (subtracting the individual, $i$, value from the group mean, $j$, value or the grand mean) in a multilevel models aids in the interpretability of multilevel modeling output. Oftentimes, a motivator of adopting a multilevel model is the presence of panel data, with rep...
For an exam (results for this exam do not need to be entirely accurate and explain the all variations in our variable) I am doing an analysis of (all countries in the world) of whether parliaments with a higher percentage composition of women, tend to engage in less wars as aggressor. The data model I've created spans ...
I am confused with this logical thinking: The quote is from the book “The art of ML” by Matloff He is working with the dataset https://www.kaggle.com/datasets/joniarroba/noshowappointments I agree with ID columns, but… Why would you not include neighborhood? It seems a good feature, (neighborhoods with bad public tran...
Suppose we have the following heteroskedastic trending regression model: $$y_i=bi+a_i u_i$$ for some sequence of non-zero constants $a_i$ and $u_i$ an i.i.d. sequence of mean 0 and variance 1 random variables. I want to find the asymptotic distributions of the OLS and unfeasible WLS estimators and compare their efficie...
I've been making regression models for quite a while now, I am comfortable with the idea that $$y = \beta_0 +\beta_1x^2 \text{ is linear and } y =\beta_0 +\beta_1^2x \text{ is not}$$ but I've never really understood why that is. In my mind, we're assuming $\beta_1$ is a fixed number, so why can't we just say $\beta_{ne...
For a variety of reasons, many researchers have suggested that, for attempting to make causal inferences with non-linear statistical models, one should generally avoid endowing a causal interpretation to raw model output (Mood 2009, Daniel et al. 2020, Norton et al. 2019, Long and Mustillo 2018). Instead, model predict...
I have these survey results that came from the marketing team in my company. The survey has a few questions that you can choose up to 3 or 5 items from a list. I don't know the name of this kind of question and would be delighted to know more. We plotted the results in a bar chart and it is clear to me that some of the...
Context: I have an ever-growing data set of samples. (It consists of around $500$ samples currently.) Each sample in this set is an $m \times 3$ matrix where the $m$ rows represent $m$ different measurement sites and each row holds a $3$-dimensional vector that is measured at that site. The same measurement sites ar...
I am using a marginal structural modeling approach to adjust for time-dependent confounders, looking at the risk of developing disease. I have used tmerge in R to account for the time-dependent variables, then created weights with ipwtm that are fed into a Cox model to calculate hazard ratios. However, I have noticed t...
I have run fixed in time Cox models (crude and covariate adjusted) for the effect of a binary exposure. Sample size is approx. 200,000 and there are approx. 10,000 events and 4000 "yes" values for the exposure. I am concerned and confused by the very large values of the scaled Schoenfeld residuals, please see plot belo...
I am running a mixed generalized linear model to analyze insect capture in a baited trap. The experiment consisted of 3 separate cages, in each one one treatment (C+, C- or T) and 10 insects were placed. The next day the number of insects captured in each treatment was counted. I have an experimental series in which th...
I'm new to Gaussian process regression (GPR). My recent work is to model some longitudinal data with GPR. I have learnt so far that GPR was highly flexible non-parametric method and the kernel determined the behaviour of GPR model. However, in longitudinal data modelling sometimes with the entry of new observations the...
Quantile regression at quantile $\tau$ minimizes the following "pinball" loss function, $L_{\tau}$, and elicits conditional quantile $\tau$. $$ l_{\tau}(y_i, \hat y_i) = \begin{cases} \tau\vert y_i - \hat y_i\vert, & y_i - \hat y_i \ge 0 \\ (1 - \tau)\vert y_i - \hat y_i\vert, & y_i - \hat y_i < 0 \end{c...
I am working on analyzing a dataset from a diary study (6–14 repeated measures per participant). The sample I have consists of 2 groups (1 with expertise, 1 without) that are thought to differ on many of our key variables. I have more participants in the experise group (200) vs the non-expertise group (150). I had been...
In $lm$ models in R it is possible to use inverse.predict for predicting input value given a output value. But I can't find code making it for $lmer$ models. Do there not exists code for that in R?
I have a large data set of records that reflects specific detections of PIT tagged fish by antennas over many years. Here is a link to the data, though I will try and explain best I can. Each individual fish id is determined by MostRecentTag which has a corresponding location and DateTime associated with the detection....
Suppose $x_1 \cdots x_n$ are iid random variables with normal distribution of mean $\mu$ and variance $1$, and $\overline{X}=\frac{1}{n}\sum_i^n x_i$ What is the conditional distribution of $\begin{pmatrix}x_1\\\vdots\\x_n\end{pmatrix}|\overline{X}$? Lecture slides show that the distribution will be a normal distributi...
I'm trying to get a grasp with Hotelling's $T^2$ test in the case of a one-sample population. This exercise is a part of a training set; it's not an homework, and I'm not looking for a complete solution, but for help to correct some mistakes. The Problem There's a population that can be supposed to follow a bivariate N...
I am having a hard time of digesting this, which is part of EM algorithm that I borrowed Equation 3.2.7 from https://www.informit.com/articles/article.aspx?p=363730&seqNum=2#:~:text=3.2%20Traditional%20Derivation%20of%20EM,and%20establishes%20its%20convergence%20property. My question is related to the "definition of ex...
Does anyone know the process model # for a moderated mediation, where the independent variable (in this diagram A) moderates the effect of the mediator (B) on C? I attached a diagram below. Alternatively, if anyone happens to know of any papers that use this model that would also be super helpful. I am seeing a lot of ...
Say I have a couple of equal-length data series, X1, X2, X3, and Y. I also create a series Xm which is simply the mean for X1 X2 and X3. Can it be that the correlation between Y and all of X1, X2, and X3 is negative, but the correlation between Y and Xm is positive, or vice versa? If so, how, and what does that tell yo...
Suppose: $x \sim \mathcal{N}(x; \mu, \Sigma) \;\;\;$ st. $\;\;\; \mu \sim T_{v}(\mu; k, M)$ Where $T$ is the $t$-distribution with v degrees of freedom, location $k$, and shape $M$. Then, is there a clean posterior predictive for $x$ and/or a clean distribution for $p([x, \mu])$? I have: \begin{equation} \begin{aligned...
I have a linear mixed model in R for predicting the numeric value invested by participants in a Trust Game (it's an experimental paradigm) with the factors "group" (intervention group and control group) and "time" (every participant played the game twice, with a year interval between both times), the interaction factor...
When we are computing the gradient of the loss function, $L$, of a Word2Vec model, for the context word-embedding, $w_i$, and the target word-embedding, $t$. Where the loss function, $L$, looks like: $$L(z(w,t)) = -\log(\frac{e^{z_i}}{\sum_{j=1}^{N} e^{z_j}})$$ Does the chain-rule set-up for $\frac{\partial L}{\partial...
Imagine I have a series $y$ that has a signal and a noise component $y=S+N$. How can I generate $y$ from $S$ and $N$ so that $y$ is 80% signal, 20% noise, and has a given standard deviation? # Set desired parameters signal_length <- 100 sigmaY <- 10 # Generate signal and noise signal <- rnorm(signal_length, mean = 0,...
I have a distribution described by the density function 2x*exp(-x^2). I would like to get the distribution that would by produced by taking the average of n observations drawn from this original distribution. I think eventually this will converge to a normal distribution via the central limit theorem, but want to get a...
I am trying to model behaviour data using the mgcv package. I am using a beta distribution because the data ranges between $[0,1]$. Here is the GAM output: Family: Beta regression(4.134) Link function: logit Formula: FA ~ s(contrastGroupForTable, bs = "cs", by = experimentalGroupForTable, k = 2) + s(animalGroup...
I am trying to understand why large amounts of censoring is unfavorable in survival analysis. Logically, this makes sense (ex : Why is large amounts of censoring bad in survival analysis? , in the answers "The patient died on Dec 12, 2023" tells us a lot more than "the patient will die some time after this study ends."...
Does the product of two t-distribution formulas with same degrees of freedom simplify? $T_v(x; \mu_1, \Sigma_1)T_v(x; \mu_2, \Sigma_2) =\ ?...$ In the normal case it simplifies to: $\mathcal{N}(x; \mu_1, \Sigma_2)\mathcal{N}(x; \mu_1, \Sigma_2) \propto \mathcal{N}(x; \mu_3, \Sigma_3)$ where: $\Sigma_3 = (\Sigma_1^{-1} ...
I've been working on a random forest model to estimate the probability of soil erosion and used SHAP to understand the feature contributions. Typically, I expect to see a mix of positive and negative SHAP values for each feature indicating their respective push on the model's output. However, when I made a SHAP summary...
In the process of deploying a KMeans model for a customer segmentation use case into production. KMeans doesn’t produce the same results every time and after production cluster sizes and arrangements are bound to change. What are some considerations to take into account after deploying a KMeans model into production an...
In my econometrics class regarding multiple linear regression, we learned that one of the Gauss-Markov assumptions is the zero conditional mean, expressed as $ E(y|\boldsymbol{x}) = 0$. My question is: If we transform $\boldsymbol{x}$ into $g(\boldsymbol{x})$, does this zero conditional mean still hold for the new con...
In Jaynes' book Probability Theory: the Logic of Science (page $65$ in the pdf, i.e. page $35$ in the book), the author says that the strong syllogism $$A\implies B$$ $$ A$$ $$\therefore B$$ corresponds to the product rule: $p(B|AC) = \frac{p(AB|C)}{p(A|C)}$ where $C$ is defined as $C\equiv A\implies B$ My question i...
I am learning how to test measurement invariance with different scaling approaches and came across a book chapter that said that modification indices of a fixed-factor approach are more trustworthy than other scaling approaches. It also mentioned that the different scaling approaches are just looking at the same data f...
The varimax criterion maximises high and low value factor loadings and minimises mid-value factor loadings, in order to achieve the maximum value for its objective function. How does doing this ensure that the varimax criterion is a maximum value? In other words, how does having a few extreme values and many middle val...
A typical statistics problem would be to find the minimal sample size for a known binomial process to guarantee that it would not fall below a certain threshold with a given probability. In R, uniroot would normally solve such problems, but because R uses gamma and digamma functions to evaluate the combinatorial probab...
Suppose the application has a click rate of 5%. A new version may improve this. Suppose that frequentists approach is used. To estimate the sample size the click rate of the new version is estimate with 6%. So this means a relative MDE (minimum detectable effect) of 20% (5% -> 6%). Using https://www.evanmiller.org/ab-...
I would like to calculate the Expected Goals (xG) using a Bayesian model. The xG is the probability of a shot resulting in a goal or not. The value is between 0 and 1 meaning 0 is most likely not a goal while 1 means it will probably result in a goal the shot. I have some shootings with a result of goal (1) or no goal ...
I built a neural network and a decision tree using very similar data sets (the only difference was the randomness of selecting the training vs testing set). The variables with the highest shapley values in my neural network are completely different from the top node variables in my decision tree. How could this possibl...
I tried to repeat the analysis from Stewart and Love 1968, to compute the Variance Extracted and redundancy index from CCA. Based on their paper (if I followed it correctly), Variance Extracted per canonical correlation $R_c$ is $\sum_{i=0}^{L}(p_i^2)/L \times R_c ^2$, where $p_i$ is a loading component and L is the l...
I am conducting a one group pre test post test study. If I would like to further analyse the groups (male/female, urban/rural, age categories)-should I do ?independent T test analyses or is there another way to it?
We have the PISA data with a multi-level structure (student - school - level). The schools were selected randomly. In this case it is well known to use multilevel methods. Considering subsamples, we can use multilevel models for level 2 subsamples (for example, schools from a given region). If we want to study the effe...
I have AB testing in place and I have to compare the data but I have no clue which statistical test to use. I'll try to speak in dating app terms because I think it makes it easier to understand. I have a dating app which works based on communities. Each community has its own users which can only interact with users fr...
I have a transition system defined over state space $X$, with a transition function $f: X \to X$. Let us assume my task is to learn a function $G: X\to \mathbb{R}$ such that $G$ is decreasing, i.e. $G(x) > G(f(x))$, on a subset of transitions in $X$. My loss function is something of the following form: $$ L(x) = \text{...
Say that I estimate a marginal structural model with weights obtained by inverse probability weighting. Imagine that my model looks something like: $Y_t = X_t + X_{t-1}$ again, with observations weighted by their inverse probability of receiving treatment and with $Y$ representing a discrete outcome. Following the esti...
I'm attempting to model the time that a person records to do a certain task. Times are recorded in tenths of an hour, so 0.1, 0.4, 1.5, etc. This 'time recorded' seems approximately exponentially distributed. But I've noticed that there seems to be a bias toward whole number times. It makes sense that a person is more ...
I have a relatively large data set with around 12000 samples with 550 variables. Originally, I have around 800 variables, I used a rule that if missing rate in each variable is larger than 80% I will drop it that's why in the end I have 550 variables left. My vaariables are two types-categorcal and continous variales. ...
Suppose I have time series of noisy observations $\hat{Y_t}$, with the true underlying but not observable $Y_t$ ~ $N(\hat{Y_t},\sigma)$. I want to estimate $Y_t$ with the basic model $Y = mean(\hat{Y}_{0}...\hat{Y}_{t-1})$. So far so good, now I want to add the fact, that the underlying $Y$ changes gradually over time,...
I have read similar questions submitted here, and have looked in Wood's 2017 book (Generalized additive models: An introduction with R, 2nd edition) but cannot find an answer to my problem. To set up the question, consider first a simple linear model:fit<-lm(Y~X+Z). Once I get the coefficients from this simple model (...
In the Cox model, violation of proportional hazards suggests that the effect of an exposure is not constant over time. One way this can be handled is by including time varying coefficients in order to produce covariate - time interaction term(s). It seems that there is so much emphasis on checking whether there is the ...
An example of 100 subjects. Let's say I wish to study the impact of literacy levels (0 as limited and 1 as adequate), anxiety levels (0 as no anxiety and 1 as severe anxiety) and sex (0 for female and 1 for male) on the decision that has been made. We have decision A and decision B. the frequency of decision A is 98 an...
I am using the following code to perform a generalized linear regression which produces a satisfying prediction for this highly seasonal time series. i am just not very satisfied with the prediction interval. library(tidyverse) df <- data.frame( Year = c(2010:2022), Jan = c(9.125190, 11.246194, 10.005710, 11.8609...
As far as I know, credible intervals usually involve a single contiguous interval and allow one to make statements such as: "Based on the model, data, and priors, $X$ is within the bounds $(x_1, x_2)$ with probability 89%." But what if I'm interested in making a statement like the following: "Based on the model, data, ...
Apologies if the title makes no sense. At work, I came across something that I don’t think is a good idea and I was hoping someone could help me convince my colleagues of that - or convince me that I’m mistaken. We are trying to predict if an event will happen within a given time horizon. For simplicity, let’s just say...
You want to estimate a logistic regression model in which you want to explain if a person is employed (= variable “employed”, 0 if unemployed and 1 if employed) with with the work experience of the individual in years (= variable “experience”). The coefficients of the model yield the following output ...
I'm analyzing data from a study comparing 5 treatment arms. Women receiving ovarian stimulation for in vitro fertilization at different phases of the ovarian cycle. The treatment efficacy endpoint was the number of oocytes retrieved. The hypothesis of the study is that stimulation can be started at any phase of the stu...
Question How to model the predictive distribution $\mathrm{P}(X'\mid X_1=x_1, \dotsc, X_n=x_n)$ if I know that the sequence $X_1, \dotsc, X_n, X'$ is exchangeable, but I cannot assume it to be $N$-extendible for $N\gg n+1$, so that latent variables from de Finetti's theorem do not have to exist? More context Consider r...
I'm currently going over how to interpret certain terms of a generalized additive mixed model (GAMM). I'm having a hard time differentiating between "shape" and "curvature". Mathematics aside, how does one picture two smooths that, for example, have the same curvature (a.k.a. wiggliness), but different shape, or same s...
This question is motivated by a question I'm facing in vector-valued kernel methods (also known as Gaussian Processes and co-krieging). Suppose I have $N$ data $X := \{x_n\}_{n=1}^N$ , where each $x_n \in \mathbb{R}^D$. My question: Under what conditions or choices of kernel functions will the following hold? $$k(x, X)...
I want to use the R package MICE for Multiple Imputation and I have a question concerning the order of my dataset - regarding the order of my variables on the one hand and the order of my cases on the other hand. Sequence of variables: Is it necessary to define a certain sequence of the variables for a dataset like th...
I'm working with cox proportional hazard (cox-PH) in R. I'm using the smoothed scaled Schoenfeld residual plot to assess the PH assumption. Suppose I have this model in R, disease as outcome and genetics as exposure: #Residual plot for genetics: cox_model <- coxph(Surv(start, end, disease)~1+factor(genetics)+strata(gen...
I am conducting a retrospective case-control study, it is a clinical project. Initially I manually matched cases to controls of the same age and sex. It had been suggested that to have a less biased methid than manual matching, I should use propensity score matching. However, all I can see is how to use PSM as a method...
I am trying to understand how authors of the DDPM paper in appendix A, made the leap from equation 21 to equation 22. Specifically, it is not clear to me how they managed to convert the first term of the first equation, into the kullback-leibler divergence (KLD) as the first term in the second equation, without "using ...
Imagine that you want to estimate whether the slope between y and x changes after a cutoff value. Assume that the cutoff is not at x = 0 but at some arbitrary point c. I could estimate this two different ways: $$ Y = \beta_1 \cdot X + \beta_2 \cdot [(X - c)\times 1[X > c]] $$ or $$ Y = \beta_1 \cdot X + \beta_2 \cdot [...
I was reading this journal article on two way fixed effects by Michelle M. Marcus & Pedro H. C. Sant'Anna The Role of Parallel Trends in Event Study Settings: An Application to Environmental Economics https://www.journals.uchicago.edu/doi/10.1086/711509 It says The canonical DID method presumes the existence of two g...
I'm grappling with a specific question: I have two independent groups and a known function f = x ⋅ y ⋅ a + z, where x, y, and z are variables and a is a constant (the same for every participant in both groups). All variables are numerical and continuous. I've obtained the values of x, y and z for each participant and...
I would like to know how to deal with correlated variables, with this kind of correlation matrix: Is there a way to combine the correlated variables such as all the AV.. variables or FF.. variables? How can I deal with that kind of correlation matrix, knowing that I want to reduce the number of variables to apply a mi...
I have a difficult time series problem that is stumping me. I have registration data for a repeating annual event. The date of the event changes every year as does the open period for registration. I have data for 5 events. Plot of the data look like this: Conference 3 years ago: Conference 2 years ago: Conferenc...
I know this type of question has been asked many times before, so I apologize for re-posting about it. I bring it up again because it's been taught in one of my courses of study and I want to make sure I'm learning the correct methods. I can't share the data, but this is the part of the code that I'm confused by: M1 <-...
I am investigating the effect of two explanatory variables (one continuous and one binary) on my continuous response variable (Mortality rate). This variable is a proportion and resembles a gamma distribution. I first thought a zero inflated gamma glmm would do the trick but R returns an error message stating that a gl...
I am testing relationship between gender and perceived cause of suicide in a group. So I wanted to do a crosstab in SPSS Gender(Male/ Female) vs Family Neglect (Yes/ No). However, the number of males in higher than the females. Am I still able to proceed with Fisher Exact Test/Chi Square? If not, do I adjust the propo...
I have an OLS model with a very bad prediction score - when I decided to test for heteroskedasticity, it turned out my model's predictions include one incredibe outlier - it looks like my fitted values plotted against residuals are all clustered in one cloud of dots, except there is one dot that has a way higher fitted...
I have a dataset of 12627 records (value and sd) and want to get the sum and overall uncertainty of the sum. I ran Monte Carlo analysis with 10000 simulations. I got the statistical result as below. You see the mean and 95%CI are very close to each other. > upper mean lower > 8092.260 7850.384 7608.509 I p...
It crossed my mind that when designing an experiment and you're not interested in NHST but full regression model where coefficients for treatment exposure and relevant covariates are desired, perhaps it's best to discretize all continuous variables by default. Whether a continuous covariate has a linear relationship wi...
I have been investigating the relationship between the occurence of certain weather phenomena and time. To aid me in evaluating the fit of my (simple linear-regression) models, I have been using the DHARMa-package. So far everything has been working just fine, but today I stumbled on a problem that i cant make sense of...
I have generated a linear mixed model with a random intercept with model <- lme(q0 ~ DominancePattern + PC1 + Region + pH + WT + DominancePattern:PC1 + DominancePattern:pH + PC1:pH + pH:WT + Region:WT + pH:Region + PC1:Region + PC1:WT, random = ~1|LocalityShort, data = subplots, method = "REML") If I run summary(model)...
The research question revolves around whether a time-varying intervention at a center enhances the transplantation hazard per person. I have patient-level data and I need to account for the center transplant volume. I believe adjusting for the center transplant volume is inappropriate, as it is in the pathway of the ev...
I have a bivariate sample in the [0,1] square for which I am trying to find the copula that best describes it. (I am new to copulas.) So far, I have tried all classes in the "copula" R package. Using ML, the best fit was the t-Copula. However, this clearly does not do a great job in describing my data; see the image be...
Given $\rho$, is there a way to efficiently construct this matrix (i.e., as a product of matrices, rather than using a for loop)? $$ \Sigma = \begin{pmatrix} 1 & \rho & \rho^2 &\cdots & \rho^k\\ \rho & 1 & \rho & \cdots & \rho^{k-1} \\ \rho^2 & \rho & 1 & \cdots & \rho^{k-2}\\ \vdots & \vdots & \vdots & \ddots & \vdo...
Consider the population $R^2$: \begin{equation} \rho^2 = 1- \frac{\sigma^{2}_u}{\sigma^{2}_y} \end{equation} This equation describes the proportion of the variation in $y$ in the population explained by the independent variables. Suppose I want to find unbiased estimators for $\sigma^{2}_u$ and $\sigma^{2}_y$, respecti...
Please help me understand the reason for this convenience feature of the base R sample function before I submit a request to the R mailing list to modify. set.seed(8675309) sample(x=c(5,6), size=1, replace=T) #[1] 6 sample(x=5, size=1, replace=T) #[1] 3 The first example returns the expected output. However, I ...
The MAPE could be employed in the context of regression problem and is defined by $$ MAPE := \frac{1}{n} \sum_{t=1}^{n} \left| \frac{y_{t} - \hat{y}_{t}}{y_{t}} \right| $$ where $y_{t}$ is target value and $\hat{y}_{t}$ is fitted value. In my intuition, it could be naturally generalized by $$ gMAPE := \frac{1}{n} \sum_...
I am trying to calculate the power for Cox PH analysis using the cpower function in the Hmisc package. The following is sort of "post-hoc power", mainly to understand how the function works. There are 2 groups, with 2500 subjects in each group, follow-up time is 6 months or 0.5 years, I estimated the survival probabili...
I have a simple linear regression model, and I tried validating if the model fit for purposes. One of the tests is Bruesch Pagan test on the residuals but the result of the test shows that the error term is heteroscedastic, if I continue using this model, what would be the implication to my prediction?
I'm trying to fit a bayesian logistic regression model to calculate the expected goals (xG) of certain shootings data in football. My model has some simple features where I first fit a model with default settings. I'm trying to understand how I could improve my model but I'm not sure how. Here is a simple model with sa...
In a hidden Markov model (HMM) we have a process $X_k$ that evolves according to: $$ X_{k+1} = X_k + W_{k+1}, \quad W_{k+1} \sim N(0, \sigma_{W}^2), $$ where $\{W_k \}$ are IID and $X_0 = W_0$. We can only observe noisy measurements $Y_k$ of the process $X_k$, $$ Y_k = X_k + V_k, \quad V_k \sim N(0, \sigma_{V}^2).$$ It...
Consider the dynamic linear model given by: \begin{equation} y_{it} = \rho y_{i,t-1} + \alpha_i + \nu_{it} \end{equation} where $\alpha_i$ represents individual fixed effects. The GMM two-step estimator imposes $0.5(T-1)(T-2)$ moment restrictions, specifically: \begin{equation} E[y_{i,t-s} \Delta \nu_{it}] = 0 \end{equ...
In the referenced paper, it is stated that for ReLU networks, the Reproducing Kernel Hilbert Space (RKHS) of the Neural Tangent Kernels (NTK) remains unchanged regardless of the model's depth. I am curious to know if, when considering the Erf (error function) as an activation function, the RKHS inclusion relationship r...
I understand that homoscedasticity, constant variance of the error terms at each different X value, is a key assumption for linear regression. Assume we collected a single data sample $(X,Y)$. The scatterplot could look like either the figure on the left or the figure on the right. The left figure shows that the error...
Normally in maximum likelihood estimation, we have fixed data $x$, and have a parametric family of models governed by $\theta$. The $\theta$ chosen is the one that maximizes $p(x \mid \theta)$. But my situation is, that there is fixed data $x$ that I have observed. I would ideally like to maximize the likelihood $p(x \...
Say you have a likelihood function $L(X|\theta_1,\theta_2)$ and you marginalise out $\theta_1$ and then take the log of the marginalised likelihood function. Would this be the same as taking the log and then marginalising?
I am working on a time-series forecasting problem with ARIMA. Since long-term predictions were not good, I've started using a "rolling ARIMA" like explained here for t in range(len(test)): model = ARIMA(history, order=(5,1,0)) model_fit = model.fit() output = model_fit.forecast() yhat = output[0] predictions.appen...
I am doing a meta-analyss of case crossover & time series studies. so the problem is some studies have reported the RRs, & I need ORs. The data I have is not enough which is -Total sample size (there is no separate N for cases/controls) -Risk ratio Is there anyway I can calcualte the RR from just these 2 parameters? Th...