instruction
stringlengths
9
38.7k
I have 5 features in my data. The R squared value when I use features 1,2, and 3 is $x$ and the R squared value when I use features 1,3, and 4 is $x + 0.1.$ Does this mean my second model is better than first model?
Say we have an OLS residual $\hat{ϵ}$ from regressing $y$ on $X$. If we were to regress $\hat{ϵ}$ on the same $X$, what would the OLS coefficient be? If we rearrange the first regression equation for $\hat{ϵ}$, we get $$ \hat{ϵ} =y−X\hat{β} $$ but would the OLS coefficient simply be $\hat{β}$? I suspect I am missing so...
I am working with different types of data and comparing a variety of estimating equation approaches which share a multi-dimensional parameter $\beta$. Given a set of data $\boldsymbol{X}$, is there an easy way to solve for $\beta$ numerically using R code for an estimating equation of the form: $$U(\boldsymbol{X}, \bet...
Suppose I have two confidence intervals that measure accuracy of two different classifiers on the same data. In the first, I have $0.9087 \pm 0.0073$ for one, and $0.9123 \pm 0.0075$ for the other. These intervals overlap by more than their margin of error. Is there a nice measure or graphical representation that can e...
Recently I am working with interaction in regression. And I learn a lot from this The package emmeans perform well in various kinds of regression. However, I found it doesn't work with Complex Survey Design data. So my question is I would like to conduct multiple comparisons of a multilevel categorical variable in the...
Is it true that if models A and B are such that the covariates of B are a subset of A, the AIC of model A is always smaller than that of model B? Why?
We recently trained our dataset which consists of 18 classes (basic and compound facial emotions). Each class has a minimum of 100 and a maximum of 300 images. The images are also grayscale and the size is 100x100. The kernel that we used is RBF and the value for C and Gamma are 10 and 0.001 respectively. The model ach...
The Dickey Fuller test tests whether a unit root is present in an AR model. Specifically, we have $$ X_t = \phi X_{t-1} + \varepsilon_t $$ where $\varepsilon_t$ is a Gaussian noise term. Now the Dickey Fuller test tests the Null Hypothesis H0: $\phi=1$, or equivalently H0:$\gamma=0$ in the differenced equation. This is...
I am reading Tutz & Schmid "Modeling Discrete Time-to-Event Data" (2016) chapter 4 Evaluation and Model Choice section 4.3.2 Prediction Error Curves. Integrated prediction error curve is defined as $$ \widehat{\text{PE}}_{\text{int}} = \hat{\mathbb{E}}_T[\widehat{\text{PE}}(T)]=\sum_t \widehat{\text{PE}}(t)\cdot\hat P(...
I have data on the trajectory of a particle and am interested in the displacement of the particle in a given time period. In particular, I have information on how much a particle has moved in each second, i.e. in the first second it moved by 1 m and the second second it moved by 2 m. To obtain observations of the total...
The aim is to determine at which level to group data (i. e. at individual, plot or regional level) by comparing the variance components in a random effects model. mod <- lmer(val ~ (1|individual) + (1|plot) + (1|region)) confint(mod) 2.5 % 97.5 % .sig01 0.2514234 0.2826764 .sig02 0.2443112 ...
In a retrospective observational study, I'd like to compare the efficacy of drug A vs drug B, and was considering propensity score matching on age, gender, history of diabetes mellitus, and history of hypertension, of which I considered as covariates. Before PSM, I found there was already no significant difference betw...
TLDR: What motivates the definition of $R^2$ in the Python function sklearn.metrics.r2_score? DETAILS The Python machine learning package sklearn implements an $R^2$ using the following formula. $$ R^2=1-\left(\dfrac{ \overset{N}{\underset{i=1}{\sum}}\left( y_i-\hat y_i \right)^2 }{ \overset{N}{\underset{i=1}{\sum}}\le...
The stick-breaking construction used for Dirichlet Processes can create an infinite sequence of probabilities $ \boldsymbol{\pi} $ (stick lengths) that sum to 1 via the following formulae: $\nu_i \sim Beta(1, \alpha) \quad \pi_i = \nu_i \prod_{j<i} (1 - \nu_j) \quad \text{for } i = 1, 2, 3, \dots $ The resulting stick ...
I have a task for Document object detection. From bank reasons I need to extract several things. One of these things are invoice numbers. The issue with invoice numbers is that one reason can contain more than one number and they may have various lengths. To make the task more interesting, since the reasons are written...
Why do we bother about devising new Deep Learning methods, which is to be applied on graphical representation of data? Why not use the traditional Deep Learning methods in the adjacency matrix representation of graphs?
I have a dataset with a set of features regarding: Age Country TypeA1 TypeB1 TypeC1 Where Country is a feature that can have 195 different potential values, TypeA1 can have 50 different potential values, TypeB1 can have 32 potential values and TypeC1 can have 42 potential values. I would like to compute clusters by ...
I want to show the "mirror" to the survival probability calculated with the Kaplan-Meier estimator, that is the cumulative incidence (or probability). I would like to add the pointwise confidence interval. In my software it is provided for the Kaplan-Meier, but not for the CIF=1-KM. I guess it's as easy as just swappin...
I'm still somewhat new to R, so please bear with me. I'm trying to summarize the results of the variable riskT0. However, because I have some missing values in the variable riskT2 I would like to only include participant values if they have also a value for the riskT2 variable. reproducible example: ID <- c(1:300) #pa...
I want to predict soccer games and want to calculate the statistical significance of my features for selection. One of my features is the amount of points both teams have before the game. Does this mean some of my samples are dependent? As the amount of points for one game is dependent on the win/draw/loss of a prior g...
I only found that it eliminates the estimator of survival from the variance formula, but could anyone show some references or write a few formulas to show how exactly the Greenwood becomes more stable here? I'm trying to find a book or article, but they are all paid or don't show this.
I am aware that there are some useful threads already on free software for calculating sample sizes (see here). However I couldn't find anything specific to cross-classified MLM and repeated measures. I do psychophysiological research, that is, I look at over-time changes in physiological variables to infer psychologic...
I am using the f1-score (f1 = 2 * (precision * recall) / (precision + recall) to compute the similarity between two vectors (let's call them actual and pred). There are nevertheless some missing values in these vectors: actual = [-1,1,'NA',1,1,1,1,0,1,-1] pred = ['NA',1,1,1,1,-1,0,1,'NA',-1] As simple as it can get,...
https://arxiv.org/pdf/1503.03585.pdf I believe this is one of the first papers using diffusion models for deep neural networks. On page 15, the forward Gaussian diffusion kernel is defined as: $q(x^{(t)} \mid x^{(t-1)}) = \mathcal{N}(x^{(t)} ; x^{(t-1)} \sqrt{1 - \beta_t}, \mathbf{I} \beta_t )$ I see this on all other ...
I have data from a RCT analyzing the effect of an intervention on students. The experimental group had 3 measurements: before the intervention, directly after the intervention and six months after the intervention. Although, the control group only had 2 measurements: before the inetervention and after 6 months. Since t...
I have a discussion at work on this topic and want to leverage the wisdom of the stats crowd :-) Suppose $X\sim Normal(\mu, \sigma)$ is observed and that $y_i = f(x_i)$ where $Y\sim Binomial(p)$. Note that $f()$ is some function translating X to zeros and ones. Let y be the vector containing the observed $y_i$ for $i=1...
I'm currently working on a meta analysis and half of the included papers only reported the beta coefficient. I wanna pool the odds ratios and am now wondering if there is a way to convert beta coefficient in Odds Ratios or any other way how I would get the odds ratios from these papers (the raw data is not complete to ...
In my econometrics notes (not a proper textbook) I find that given a partitioning of the sample matrix X into $$ X =(X_1 1),$$ where 1 is the (nx1) vector of all unity elements, then $$M_{[1]}=I - 1(1'1)^{-1}1'$$ transforms all variables in deviations from their sample means, where M is the "annihilator matrix" or also...
Say we build the following table: nnn <- 100 tib <- tibble::tibble(Completers = rep(c(1, 0), each = nnn), Gender = rep(c(1, 0), length.out = length(Completers))) expss::val_lab(tib$Completers) = expss::num_lab("0 Non Completers 1 Completers") exps...
I took a lot time doing research in neural network recently. Last time I asked questions about interpret neural network result from a similar picture and it really activated my interest. For now, my new question is can we build an equation between W21 and W11,W12,Wx21,Wx22 from the plot? From my perspective, W21 W22 a...
Does an ARIMA model appended with interaction terms $X_t=\alpha_1X_{t-1}+\alpha_2X_{t-2}+\alpha_3X_{t-1}X_{t-2} + \epsilon_t$ makes sense? And if so, how to code that? I know ARIMA is limited by the power of rational-numbers, but would adding interaction terms make it more generalizable or powerful?
I have noticed different software use different method of calculating the acceleration parameter, $a$, for computing the bias-corrected and accelerated (BCa) bootstrap confidence interval (CI). In general, the formula for $a$ is $$ a = \frac{1}{6}\frac{\sum_i{I_i^3}}{(\sum_i{I_i^2})^{3/2}} $$ where $i$ index units in t...
In wikipedia, the law of large numbers is defined as follows : "The average of the results obtained from a large number of trials should be close to the expected value and tends to become closer to the expected value as more trials are performed." Meanwhile, because of the convergence in probability(or the weak law of ...
In regression models, I just want to know why the sample error terms have such relationship as: $$\hat e_i=y_i-\hat\beta_0-\hat\beta_1 x_i=(y_i-\bar y)-\hat\beta_1(x_i-\bar x).$$ where $(\bar x, \bar y)$ is the sample mean of $x$ and $y$. The first equality is about the definition of the sample error term but do not un...
If AUC (Area under Curve) is 1, do we expect FNR (False Negative Rate) be 0? For example, can FNR be 0.03?
In probability and statistics, density estimation is the construction of an estimate, based on observed data, of an unobservable underlying probability density function. The unobservable density function is thought of as the density according to which a large population is distributed; the data are usually thought of a...
I am trying to estimate the bandwidth parameter of a multivariate KDE in R and then use the estimate to evaluate the KDE in Python. The reason for this somewhat convoluted approach is that my project is in Python, but, as far as I know, there is no multivariate implementation of a plug-in selector for the bandwidth in ...
I need find the translation and/or rotation of an image and himself translated and/or rotated (x0, y0) px and/or J degrees. Given the two images I need to find N.
I am performing a one-way ANOVA in R with the following data: Cu Day CC Cu1 49 30934500 Cu1 49 26860125 Cu1 49 46524750 Cu10 49 15272561 Cu10 49 31601659 Cu10 49 17627634 Cu100 49 3718127 Cu100 49 4941416 Cu100 49 6230801 The ANOVA aims to determine if CC changes (on average) depending on Cu...
I am working on implementing ridge regression for market mix modeling where I wish to use my own create base(UCM) instead of intercept, I had been using linear regression for this purpose but now my IVs are showing high VIF and as per my business logic, I can't drop these so want to go for ridge regression instead. Als...
Linear models are models like $\mathbb E\left[Y\vert X\right]=X\beta$. Linear quantile regression models replace $\mathbb E\left[Y\vert X\right]$ with $Q_{\tau}\left(Y\vert X\right)$ for conditional quantile $\tau$, giving $Q_{\tau}\left(Y\vert X\right)=X\beta$. Generalized linear models include a link function to tran...
Wikipedia gives the following expression in "degrees of freedom" section, calling it the "Satterthwaite" approximation: \begin{equation*} \text{df}\approx \frac{\operatorname{Tr}(H'H)^2}{\operatorname{Tr}(H'HH'H)} \tag{1}\label{1} \end{equation*} where $H=X(X'X)^{-1}X'$ and $X$ is the data matrix. How/where is this for...
I was wondering if there is a theorem or a result that relates the size of the population to the probability of the occurrence of outliers of various degrees, relating the z-score to the size of the population and whether the relation is linear or not. Thanks.
A coin tossed repeatedly with P(H)=p and P(T)=1-p, What is the probability TT shows up before TH?
I received an answer to a question about learning, and I noticed the writer gave loss functions as $l(p,y)$, where $p$ is a predicted distribution, and $y$ is a class index. https://stats.stackexchange.com/a/589070/96019 Does anyone have a reference where loss functions for classification of any other problem are given...
I was reading this question about the algorithm that R uses to sample from the Exponential($\lambda$) distribution. It looks like R uses the Ahrens-Dieter algorithm to sample from the exponential distribution. The reference for it is a paper from 1972 that makes a surprising claim that this algorithm is a little faster...
I have this linear model $$=_0+_1+$$ where the error terms are iid from a student t-distribution with constant degrees of freedom k. I want to construct a 95% confidence interval for $\hat{\beta_1}$. The general formula is ($\hat{\beta_1}-\alpha * se(\hat{\beta_1}), \hat{\beta_1}+\alpha * se(\hat{\beta_1})$). Normally...
I have a really small study sample of 70, in which they are being medicated with 3 different drugs (A,B,C). The study aimed to determine the efficacy of each drug in treating the disease and the outcome of treatment is either success or failure. I have tried analysing the data using the chi-square test and fisher's exa...
As part of my PhD research, I am simulating a system that comprises multiple sensors, and I want to perform sensor fusion. My sensors give me sets of measurements (values between 0 and 1 mm) that I want to combine using Bayes Theorem to get a posterior distribution, hence I can make inferences about the whole system pe...
I am trying to predict anomalies using an isolation forest model with daily time series data. Do I need to make sure my data is stationary as I have observed weekly seasonality? I read that you need stationary time series data for forecasting and predicting future events, however, an isolation forest model is not techn...
Is some form of random sampling required for observations to meet the "independence" assumption of various types of regression analysis and hypothesis testing? My data (fish counts, without replacement - i.e., didn't throw it back) was collected like this: Sites for observation were selected based on a particular inter...
Suppose we run ridge or lasso regression over a bunch of features. And now suppose we add one more feature into the regressions. What will happen to the coefficients of the "old" features? I think generally that depends on how correlated the new feature is with the existing feature. But by simply looking at the ridge o...
I have X individuals and 2 category of interest (category A and category B) per individual. The problem is that is have a variability in the number of measures I have between individuals and between categories. I thus decided to compute a mean, so I get something like that: Individual 1: category A: 2.34 (mean of 4 mea...
What is the advantage and disadvantages of Wilcoxon rank sum test compared to permutation test? I want to know at least one each based on the shape of distribution of raw data.
Inspired by AnoE's answer to the problem Can a neural network with only 1 hidden layer solve any problem?, I want to rigorously prove that the sine function over the real line cannot be well approximated by a shallow neural network. So we want to show that $$ \sup_{x\in \mathbb{R}} |f(x) - \sin(x)| \geq 1$$ for any, sa...
Say we have an OLS regression of $y$ on $x_1$ and $x_2$, where both $x_1$ and $x_2$ are independent from each other, and create the following regression: $$ y= \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_1 x_2 $$ How would one go about showing that the coefficient on interaction term, $\beta_3$, should be zero? Reg...
There are several empirical evidences that show that in transfer learning settings, fine tuning produces better performances than feature extraction. In this context is there any advantage of using feature extraction?
I've just spent the last 3 hours reading every post, question, Medium article, and textbook entry on conditional independence, and I still don't really understand it. Can somebody explain what it means in layman's terms? I think I'm getting tripped up on the semantics. One example I frequently come upon is: a person's ...
Say for example you have an item that has a negative factor loading, like this: Item 1: I feel emotionally connected with my XBox (-.80) Assume item 1 ranges from 1. Strongly Agree to 7. Strongly Disagree. If I decide to reverse code it to range from 1. Strongly Disagree to 7. Strongly Agree, should I also reverse the ...
In many Kaggle competitions where linear regression has been applied, I see people plot the y distribution and then take the log of (or other transformation of) the dependent variable to make y normal distributed. What would happen if we don't do this step: transform the dependent variable into a normal distribution? I...
Edited: I have been researching about density function estimation from a sample of data, and I noticed that there are a lot of researches the estimate the density with the normalizing factor and others that don't. What are the real world applications of knowing the normalizing constant of the density? I noticed that if...
I was testing a DL model (GNN with two GCN layers and one linear layer) on a small dataset for a regression purpose, the resulted MAE and the scatter plot showed some really good results. However, when I applied the same model for a 10x dataset, the results (especially the scatter plot) showed random with low range out...
I am going through 15 Steps to Implement a Neural Net and I'm stuck on Step 12 where I should implement my own backpropagation function. The neural network in question has only the input and the output layer and the weight matrix between them. I will go equation by equation and tell you where I get lost: First, select...
I am going through 15 Steps to Implement a Neural Net and I'm stuck on Step 12 where I should implement my own backpropagation function. The neural network in question has only the input and the output layer and the weight matrix between them. I was able to get this to work, but I had to modify one equation (line of co...
I am performing binary classification on a data set with around 90k records and 28 features. I'd like to evaluate various models such logistics, SVM, Xgboost etc. via grid-search method to see which works best. I want to understand the best feature selection algorithms I can use to reduce the number of variables. I und...
my project is authorship attribution which is a multiclass classification, the number of classes is 150, and the number of documents is 2798; it is also an unbalanced issue some classes have more instances than others, for SVM I used linear kernel and c=2, and for KNN I used k=4. the result was as follows: SVM: 1-gram:...
Let $p_i$ be a vector, such that $p_i\geq 0$ and $\sum_i p_i=1$. Similarly $\pi_\alpha$ is a vector satisfying $\pi_\alpha\geq 0$ and $\sum_\alpha \pi_\alpha = 1$. The two are related via $\pi_\alpha = \sum_i W_{\alpha i}p_i$, where $W_{\alpha i}\geq 0$. Can we make a mathematically rigorous statement that $\sum_\alpha...
Is it practical to derive the optimal prior distribution by dividing the posterior by the likelihood and multiplying by the "evidence"? Suppose you assume a probability distribution. You know what the posterior is because you assume you know what the asymptotic convergences are. Now you can derive the prior by multipli...
Given a binary classification task, during 10-fold cross-validation I'm able to get the probability that each test set sample is of one class or the other. When I compute the AUC ROC score during cross validation, the score is quite consistently 0.7 for each of the ten folds when using the straightforward approach of j...
I need to run the Lavene's test to check equal variances of a linear model in R, but I get an error message that R cannot find the function laveneTest. I already checked older posts from people with the same problem, but I could not solve it. I already installed the "car" package, and I also installed the "hms" and "re...
I am analysing the probability of an employee leaving a company from multiple different reasons. Say that the probability they leave because of a event a is p(a) and the probability they leave because of a event b is p(b) ... p(c) ... p(d) How do we calculate the overall probability that they leave? is we know that som...
I am looking for a way to create a normal distribution by removing rows from a variable in a data frame. I only want to REMOVE data, not transform data with multiplication. The normal distribution should have it's mean at 3 and range from 1 to 5. Below you can find a histogrm. I would also want to know which of the row...
I am reading a technical paper and I don't quite understand some statistical terms such as: ..."Although the asymptotic mean of $z(\phi)$ is zero, it is possible for the score statistic derived by this theory to have means of order $O(n_{ij}^{-1/2})$"... what does $O(n_{ij}^{-1/2})$ means here? ...$E[z(\phi)]=O(n_{0}...
I have a 5 Likert Scale rating for 30 stories and for 30 altered versions of those stories. I want to compare these, so I want to do a paired Wilcoxon test. My problem: I now have a different number of ratings for each story, ie. Story 1 - > 3 ratings // Modified Story 1 - > 2 ratings Story 2 - > 7 Ratings // Modified ...
I am trying to implement the FWL theorem for some sample data in Stata. This theorem tells us that given a multivariate regression of the form $y = \beta_{1}x_{1} + \beta_{2}x_{2} + \varepsilon$, the OLS estimator obtained by regressing $y$ on $\gamma_1$ where $\gamma_{1}$ are the residuals from the regression of $x_{1...
Imagine I run a marketing campaign in two cities with very different number of citizens (like A: 1000 and B: 1000 000). Purchases_A and Purchases_B define the number of products sold in each city: month Purchases_A Purchases_B Campaign January 100 100 000 0 February 120 150 000 0...
I have the following dataset, comprising of two variables - condition (either recession or normal) and unemployment (a number). I need to test if the unemployment rate is higher during a recession. What is the right statistical test for me to use please? I think it is ANOVA but wanted to check.
Consider the following toy example dataset (in R), including 5 factors: set.seed(2022) dat <- data.frame( V1 = factor(sample(0:1, 20, replace = TRUE)), V2 = factor(sample(c("a", "b", "c", "d"), 20, replace = TRUE)), V3 = factor(sample(0:1, 20, replace = TRUE)), V4 = factor(sample(0:1, 20, replace = TRUE...
In a review problem for a class, we were asked to perform a Chi-Square Test Statistic for a 2x2 Table without a continuity correction. In the answer key, my professor included the following: I totally follow all of the math up until the p-value portion. Where did she get the 0.25 p-value? Any suggestions you have woul...
based on what I know in k-mean clustering, if i use single linkage distance it can capture clusters of thread shapes but it is not suitable for capturing circular clusters. Also If we use complete linkage for example it is suitable for capturing circular clusters but not "thread-like" clusters. Is there any other metho...
I have a dataset with pupils (1000+) that are nested within school classes (100+). Pupils were either in group1 or group2 (different treatments) and had two measurement time points (time0, time2). The outcome variable is a summary score based on the sum of 5 items that were answered (yes=1, no=0). ID group school_cl...
I want to use R to estimate a fixed effects model using different estimation approaches. Note that I am using an unbalanced panel. The easiest way to do this is using the function lm. Example: # load packages and create data library(dplyr) set.seed(123) x <- rnorm(4000) x2 <- rnorm(length(x)) id <- factor(sample(500,le...
Suppose you create a classifier for a dataset where there is a big disparity between the two classes, e.g., in fraud detection most of your data will be non-fraudulent. It's known that the standard accuracy metric can be very misleading in such cases. Question: Is there an accuracy metric that is adjusted to the imbala...
A car driver is selected at random to be a subject in the survey. The subject is given a six side dice with 4 green sides and 2 red sides and is given the following instructions Roll the dice If the outcome is green, say yes if the driver had a car accident last year and say no if no accidents If the outcome is red, s...
I was learning the concept of heritability, and come to the Falconer's formula: $h^2=2(r_{MZ}-r_{DZ})$                               (1) Where $r_{MZ}$ and $r_{DZ}$ are correlation coefficients of the phenotypes between monozygous twins and heterozygous twins, respectively. However, I tried to get this formula by myse...
I am doing a single arm meta-analysis of incidence rate using Poisson regression and doing subgroup analysis using meta and metafor packages in R. Upon reviewing subgroup analysis results, I noticed it is different if I conducted each subgroup separately. If there is any possible explanation for that, it will be greatl...
I would like to calculate the residuals from a regression of log body mass and log brain mass, controlling for phylogeny. I originally used phylolm in R to run this regression, under a Brownian Motion assumption. I then saw that there is a function (phyl.resid) in phytools that is designed to calculate this, so I used ...
I am approaching an exercise about data analysis, but I have some doubts about interpreting my results. I have $p$ predictors, some categorical, others continuous (let's call them $X_1$, $X_2$, $\dots$ ,$X_p$) and one response variable $Y$, which is dichotomous. I applied logistic regression and found that among $p$ pr...
Suppose, I classify something as 1 when predicted probability of that event is greater than 0.5 (referred as threshold, henceforth) and 0 when predicted probability of that event is less than 0.5. What happens when I change the threshold value to say 0.7? I can think of is that now my model is more likely to classify s...
I have two variables that I intend to use for creating prediction models for which I'm unsure how to handle missing values. The reason is that both are separated into multiple columns. All participants in my data have the same genetic disease, which can be caused by one of two distinct genetic mutations. So I have a bi...
I'm reading an article where the authors use an extended Cox-Weibull hazard model with time-varying covariates to model survival time of an individual. This individual is allowed to start at week $m$, and covariates are available at weekly granularity. Assuming the hazard is represented as $\lambda\left(t ; Z(t)\right)...
I want to know what can be the best approach to handle multicollinearity. I am building a regression model with just 4 independent but all important variables and am not able to control the VIF. Should I ignore the high VIF because all variables do have an important contribution in my sales as per the business logic? o...
Is the process $\Delta Y$ an MA(1)? $Y_{t} = X_{t} + w_{t}$ with $X_{t} = X_{t-1} + e_{t}$ and $e_t$, $w_t$ both independent white noise a MA(1) process? What I did is the following: $(1-L)X_{t} = e_{t}$ and $(1-L)Y_{t} = \Delta Y = e_{t} + w_t + w_{t-1}$ Apparently this isn't necessarily an MA(1) but I don't know why
I'm trying to work out what test to use to see whether a factor (presence vs absence) affects a frequency distribution with distance as a predictor. Just wondering if anyone knows what the best test would be for this My hypothesis is that the presence of a factor - as an example lets say the presence of a tree canopy w...
For class, I am tasked to generate synthetic stock data using the copula R package. The step-by-step process is picking 2 stocks (i.e., Amazon & Apple), fit their marginal distributions (I am using skewed student's T for both), then fit a Copula (I am using Frank copula). Then I can generate Synthetic data from the fit...
I am analyzing factors that influence program retention in a medical program. Our dependent variable, retention time, is split into 4 categories (<1 month, 1-3 months, 3.1-6 months and >6 months). Independent variables are categorical (race, gender, disease status, housing status, etc.). Some independent variables have...
Suppose you fit a hierarchical model with varying intercepts $\alpha_i$: $$y_{it} \sim N(\alpha_i + \beta x_{it}, \sigma_{it})\\ \alpha_i \sim N(0,\sigma_i)$$ You're then interested in including the intercepts as a predictor in another model, perhaps with all of this being done in single joint model: $$z_{i} \sim N(\nu...
I'm reading a pdf document about simple linear regression, and it gave an expression of the least square estimator $\hat{\beta}_1 = \beta_1 + \frac{\sum^n_{i=0} \epsilon_i (x_i - \bar{x})}{\sum^n_{i=0} (x_i - \bar{x})^2}$, but I'm confused on how they get to this answer. I only know that $\hat{\beta}_1 = \frac{\sum^n_{...
Basically, my problem is, I have a dataset where I know about 12% of the rows should be classified as something, and I have some reasonable predictors. The problem is, my predictors aren't too good, because when I run a K-means with two clusters, they classify 85% of the rows as target instead of 12%. But otherwise the...
I want to build a machine learning model to choose a location for the next vending machine in Boston. I want to divide the map into small neighborhood, and I came up with features that are related to the geospatial locations and user information. One paradox that concerns me is that: we'll use past vending machines' fe...