instruction stringlengths 9 38.7k |
|---|
I am trying to learn cox Ph for gam. I found an example code in mgcv package to generate data for cox ph gam. However I can not understand a point there.
eta is the summation of the basis functions. But to produce eta, I found a different equation there. Following are the code from mgcv:
## Simple simulated known truth... |
Suppose I'm attempting to use linear regression but instead of
$$y_i = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_3 + \beta_4 x_4 + \varepsilon_i,$$
for scientific reasons, I know that $β_2=\alpha\beta_1$ and $β_4=\alpha\beta_3$. So my formula is actually:
$$y_i = \beta_0 + \beta_1 x_1 + \alpha\beta_1 x_2 + \beta_... |
Unfortunately for privacy reasons I cannot disclose the original data <Edited: snippets of the original data below>, but I'm running a regression model like this on R.
Call:
lm(formula = Score ~ Agent * Target, data = .)
Residuals:
Min 1Q Median 3Q Max
-3.1997 -0.4643 0.2133 0.6034 2.5762
Coef... |
Suppose I have two lists with columns rank, app_name, weight that look like this:
list1:
[(1, "app1", 0.6), (2, "app3", 0.2), (3, "app4", 0.1), (4, "app2", 0.1)]
list2:
[(1, "app3", 0.4), (2, "app5", 0.3), (3, "app2", 0.2), (4, "app6", 0.1)]
and I want to compare how similar the app rankings are between two lists are... |
Here is some data used for a chi square test:
High Low
B 62 10
Non-B 1366 97
chisq.test(VolumeData)
Pearson's Chi-squared test with Yates' continuity correction
data: VolumeData
X-squared = 4.5124, df = 1, p-value = 0.03365
This may be trivial, but I got a statistically significant output.... |
State and prove the necessary and sufficient condition for an incomplete block design to be balanced
A balanced incomplete block design (BIBD) is an incomplete block design in which
b blocks have the same number k of plots each and
every treatment is replicated r times in the design.
Each treatment occurs at most on... |
I've been diving deep into random forests and had a question about terminal nodes.
I know in general when you reach the terminal node, or leaf, of a random forest, the assigned value for that leaf is the mode of the responses that end up there. For example, if you have 5 training examples end up in a terminal (based on... |
I aim to determine the relation between Y (a dichotomous variable, Y/N) and multiple Xs (Continuous variables). In the following charts, X axis represents the binned value of an X, while Y axis represents the frequency of positive cases. The average frequency of positives is ~11%.
enter image description here
You may ... |
I have two categorical variables X and Y that each are multi-label e.g. each x and y is a set of labels say $x \subseteq lbls_1$ and $y \subseteq lbls_2$.
I want to get a measure of the correlation between the two variables.
I know that Cramér's V can be used to compute the correlation between two categorical variables... |
I have ran a series of experiments on a theoretical system. For a relatively small number of runs (~30) the data is normally distributed, but for longer runs (~200), a tail develops on the right... trying to think what other type of distribution this might be and whether there is a test in MATLAB?
|
I have been trying to reconcile R coefficients with actual coefficients for simulated data which follows the equation:
$$
y = \alpha + \beta \cdot f(x) + \epsilon
$$
where $\alpha$ is intercept and $\beta$ is the slope value.
When I fit the GAM model in R using gam(y~s(x), data = data, method = "REML") from mgcv packag... |
According to Eagle and Granger (1987), if I have 2 time series y1 and y2, we can test their cointegration with the p-value of an ADF stationarity test performed on the OLS residual.
Though, when running statmodels coint function and doing the ADF on OLS residual, I end up with 2 different p-values.
Here is an example :... |
We have a series of binomial distributions, each with separate and distinct chance of success k. For some small subset of these distributions we have an absolute measure of k from the full population.
We also have a process which can look at individual trials of the binomial distributions and estimate whether they succ... |
Good morning,
I have two groups of patients (treated / untreated) and I want to compute (in R) the hazard ratio of using the treatment on the occurence of an event.
The event is an eye pathology relapse that can occur in one or both eyes of the patient.
The treatment is systemic (not eye-specific).
Is it correct to us... |
I've searched for an answer to this, and read a number of scientific articles on the subject, but I can't find a practical explanation of how Dropout actually drops nodes in an algorithm.
I've read that Dropout zeros out the activation function for particular nodes, that makes sense in the forward pass. But how does th... |
I am modeling a process where events happen every X days with X following a gamma distribution. I already have a model for that which works relatively well.
The issue now, is that the day of the week also has an effect on X, and so, in order to improve the model, I would like to use a probability distribution like p(x)... |
I am struggling to derive the following identities:
$$
\mathbb{E}[\log Z]=2\log(\mathbb{E}[Z])-\frac12\log(\mathbb{E}[Z^2])
$$
$$
\mathrm{Var}[\log Z]=\log(\mathbb{E}[Z^2])-2\log(\mathbb{E}[Z])
$$
where $Z$ is a random variable. These are equations (B6) and (B7) in this paper.
|
I am working on modeling the joint distribution of given multivariate data. I can fit some parametric distributions on the data and evaluate the fitted models by LogLiklihood and AIC values. However, I am not sure how to evaluate the KDE-based fitting of the data compared to the parametric fit. How can I evaluate the A... |
I'm trying to understand the Dropout algorithm. In this paper, the authors say that the nodes are randomly switched off with probability $p$ for each "Training Example".
Does this literally mean that every row in your dataset has a different dropout layout? Or, can "Training Example" mean a training batch?
|
I'm working for the first time on my own with a convolutional neural network, and I'm kind of stuck with the same results since the very beginning.
My model is built with Pytorch and it has the following structure:
Convolutional layer 1 -> Convolutional layer 2 -> Convolutional layer 3 -> MLP (input-hidden-output)
I'm ... |
I try to understand the differences between the MP Neuron and the Perceptron. Is my understanding right that the MP Neuron mathematically only differences in the activation function. I.e. the MP Neuron only has the Threshold function as activation function and the Perceptron can have all kinds of activation function li... |
I have a large dataframe data with following columns:
date time orig new
2001-01-01 00:30:00 345 856
2001-01-01 00:32:43 4575 9261
2001-01-01 00:51:07 6453 2352
...
2001-01-01 23:57:51 421 168
2001-01-02 00:06:14 5612 3462
...
2001-01-31 23:49:11 144... |
I want to calculate the posterior distribution of Pareto distribution with known parameter $X_m$ and unknown parameter $\theta$, with conjugate prior on $\theta$ the Gamma distribution:
My effort is the following :
$$f(y;\theta,X_m)=\theta X_m^{\theta} \frac{1}{y^{\theta+1}}$$
\begin{align*}
f(y_1,y_2,\dots,y_n;\th... |
I have a panel dataset and build a negative binomial regression model for it.
Here I would like to test a total of three interactions. So, if I include all three moderations (thus also the independent variables) and the control variables in my model, I get significant P-values for the moderations. But if I have each m... |
I am seeking some assistance in how to take into account difference in trials periods when calculating average rainfall. I am investigating the effect of rain on plant disease severity. My trials have been conducted in different years, and the length of the trial varied in different year. I have been asked to use avera... |
Using a difference-in-differences design, what are the consequences of violating the Stable Unit Treatment Value Assumptions (SUTVA)? I ask this because, in my specific field of research (conflict and conflict management), succesful treatments are strongly recognized as geographically "contagious". As a result, it seem... |
I have conducted a confirmatory factor analysis in lavaan (in the context of a group comparison). Moving on to structural equation modelling I realised that my hypothesized structural model is identical to the measurement model, i.e. it has the same (good) fit indices and apart from the structural aspects (see output b... |
We have a study setup for testing a new learning treatment, which basically looks like this:
We have 4 tracks (same university course taught by different lecturers). In two of these tracks, the lecturers follow a new procedure (use of a digital learning enviroment), while in the other two, the lecturers teach as usual... |
I have an R lecture script infront of me, where we are using logistic regression to try to predict the probability that an observation belongs to the target class (e.g. y_i = 1) or not (e.g. y_i = 0). Hence Y is given as a vector of 0's and 1's.
Before running the regression our Prof. turns Y into a factor, but I don't... |
I got a fomula
$$N(y;cx,R)N(x;\bar{x},\Sigma)=N(y;c\bar{x},S)N(x;g,F)$$
where:
\begin{align}S&=c\Sigma c^T+R\\g &=\bar{x}+\Sigma c^Ts^{-1}(y-c\bar{x})\\F &= \Sigma - \Sigma c^T s^{-1} c \Sigma\end{align}
I want to know how to derive these fomula.
--update--
I am sorry for ambiguous question.
$N(y;cx,R)N(x;\bar{x},\Si... |
I have two independent dataframes:
Observation of animal frequencies in a site:
Each row represents a site, where the animal frequencies (response variables?) sum up to 100 and the other variables (predictors?) are factors.
Animal 1
Animal 2
Animal_n
Altitude
Region
Geography_Type
Chronology
Site_Type
10
40
20
... |
Let's consider the family of transformations given by
$$g_a(Y)=\begin{cases}
\frac{e^{aY}-1}{a} & \text{ for } a\neq 0 \\
Y & \text{ for } a=0
\end{cases}$$
for $Y\in\mathbb{R}$. Analogous to the estimation of the Box-Cox parameter $\lambda$, the parameter $a\in\mathbb{R}$ can be estimated using a profile likelihood a... |
I am attempting to classify text sequences into two sets of labels - class_1 = [A, B, C, D], class_2 = [X, Y, Z]. The model will be an instance of BertForSequenceClassification from Huggingface's Transformers. For each input sequence, the single model should predict one class from class_1 and one class from class_2, as... |
I've trained a simple xgboost model, I didn't even do hyperparameters tuning:
y=2-as.numeric(as.factor(Train_set[,1]))
dtrain <- xgb.DMatrix(data = data.matrix(Train_set[,-1]), label= y)
xgb_params <- list(
booster = 'gbtree',
eta = 0.5,
max_depth = 5,
gamma = 10,
subsample = 0.75,
colsample_bytree = 0.8,
... |
I need to calculate $\operatorname{Cov}(X_0, w_0)$ where $X_t$ is an ARMA(1,1) process given by
$$X_t = a_1X_{t-1} + w_t + b_1w_{t-1}, \quad w_t\sim\mathcal{N}(0, \sigma^2) \text{ independently}.$$
So far I have calculated $\operatorname{Cov}(X_0, w_0)=\sigma^2$ which gives unexpected behavior so I suspect is wrong.
|
im struggling with a potential easy to solve Problem. I have a dataset with 100k series of coin throws with varying k (throws). For each series I want to compute the the probability for each discrete n-state of getting head (sic!). E.g. 4 throws with the probabilities of c(.25,.5,.25,.75) to throw head. No I would like... |
I have a daily set of observations (Jacard similarity matrix) that I want to embed in a much lower dimensional space.
Thus I run PCA or SVD for each day and plot the projection on the top 2 dimensions (they usually explain ~90% of variance, but this is beyond the point).
My problem is that when I animate the embedding,... |
In doing a subset test of $H_0: \frac{d_1}{a_1} = ... = \frac{d_{10}}{a_{10}}$ vs $H_1: $ no restriction,
where $d_i$'s are parameters and $a_i$'s are known constants
Suppose a generalized likelihood ratio test is to be done, I have computed the statistic $-2\log\Lambda$ as some function of $X=(X_1, ..., X_n)$ denoted ... |
Suppose I have a time series. Let's say it is of the number of sales in a shop. Suppose I am looking to make two models - model 1 which predicts future values by weekly time steps (total sales per week, i.e. 1-7 days from now, then 8-14 days from now, then 15-21, etc.) and model 2 which predicts future values by monthl... |
I would like to see if there is an influence of the age variable on different medical indicators.
To find out I have extracted 60 individuals from a large dataset, each of them have a different progressive age from 20 to 80 years.
So for example these are my data:
subject
age
1
20
2
21
3
22
..
..
59
79
... |
I have a process that is currently being effectively modelled by a Poisson Binomial distribution (wiki link). We have access to all of the constituent probability values of the independent trials; however, the number of trials can be large (500-1000+). There are also many processes modelled in this way, so imagine maki... |
I'm attempting to create a machine learning model that predicts some real-valued data points.
If I was using a straight regression approach (that is, one where the output is a real-valued number), I would know how to visualize it. For example, I could use a scatter plot of predictions versus known. Or I could take the ... |
I stumbled across this example on scikit-learn (1.2.0), where the silhouette score alongside some other metrics is computed for DBSCAN cluster assignments. These assignments include some Noise assignments.
from sklearn.cluster import DBSCAN
from sklearn.datasets import make_blobs
from sklearn.metrics import silhouette_... |
I am working on a paper on smoking and depression in a sample of approximately n=2.000 subjects, and for that, I use longitudinal data (5 waves, 2 years between each wave). For a part of the paper, I want to analyse determinants of smoking in those with depression (both depression and smoking are time-varying variables... |
I have a large set of aerial images with herds of elephants in it. The number of elephants in a single image can range from ~ 20 elephants to 1.
I have created a dataset of ~ 2,000 png image files which lists the image_filename and the number of elephants in it (objects). Here's an example of the first few rows
> df <-... |
For my dissertation, I have a small and imbalanced dataset. It is made up of 190 cases, and the minority class (which I am most interested in detecting) is only 40 cases.
Since this is an inferential/exploratory analysis, and will not be deployed in production, is it okay to do k-fold CV, and then take the mean F1 scor... |
I am trying to wrap my head around linear mixed models for repeated measures with random effects. I'm choosing to conduct this type of model due to missing values in my dataset.
I am interested in analyzing how differing amounts of antibiotics affect the growth of caterpillars. Approximately 24 larvae were organized in... |
Let $X_t$ be a time series with $X_t = Y_t + Z_t$. At time $T$, $X_T$ "spikes"; that is to say, $X_{T-1}-X_T$ is over some critical threshold. I would like to assign some "contribution" to the spike to both $Y_T$ and $Z_T$, so that I can say something like "the spike is 90% driven by a corresponding spike in $Y_T$". Is... |
I have two rates (# of incidences per # of visits):
older - 2.33
newer - 1.33
Would it be appropriate to say that the rate was reduced by 43 percent ((1.33/2.33)-1)?
|
When we have the following two models:
$$A: y=\tilde\beta_0+\tilde\beta_1x_1+u$$
$$B: y=\hat\beta_0+\hat \beta_1x_1+\hat\beta_2x_2+v$$
We know $$\tilde \beta_1=\hat\beta_1+\hat\beta_2\tilde \delta_1$$ where $\delta_1$ is the slope coefficient of regressing $x_2$ on $x_1$.
Similarly, I was wondering if there is a way to... |
I have the following data:
predictions = [8;8;8;5;4;3;2;1];
true_target = [1;1;1;0;0;0;0;0];
When I compute the area under the precision recall curve using Matlab ([X,Y,T,AUPR] = perfcurve(true_target,prediction,1,'XCrit','tpr','YCrit','ppv')), I get a value of 0.
The precision at different thresholds are [NaN;1;0.75;... |
For sample size large enough, we know that the Maximum likelihood estimator (MLE) is asymptotic efficient. So when we have two classical methods (MLE and method of moment estimators) for inference of Normal distribution (or Uniform distribution on $[0,\theta]$ with unknown $\theta$), we prefer to use the MLE but not me... |
I want to use 20 years of estimated precipitation data (maybe from CHELSA or CHIRPS datasets) to look at what the expected amount of precipitation is for different 30-day periods. The main purpose of this would be to identify month-long periods that are dryer than usual. If the rainfall data were normally distributed, ... |
I wrote a simple code that creates a neural network with two dense layers and then trains it. In this code, the initial coefficients of each layer are fixed. Why do the answers change every time? (In situations where layers such as dropout are not used and the initial coefficients are also fixed)
```
import numpy as np... |
I am working on a meta-analysis of travel impact measures where I have the total measurements and the specific amount of increase or decrease. In each study, I have multiple scenarios for the measurement. How do I perform a meta-analysis in this situation? For reference I will provide a sample dataset here:
Study
T... |
Suppose that we have a log-likelihood function of five parameters and an observed data sample $y=[y_1,\ldots,y_N]$:
$$\mathcal{l}(\beta_1, \beta_2, \beta_3, \beta_4, \beta_5;\;y) =\log f_Y(y;\;\beta_1, \beta_2, \beta_3, \beta_4, \beta_5)$$
where $f_Y$ is a proper density function.
In my setup, $\beta_1\beta_2-\beta_3\b... |
I want to find a metric that can quantify target value homogeneity across feature distributions.
Without any background knowledge, it is hard to describe exactly what I want.
Therefore, I provide an example for intuition.
In the following scatter plots,
x-axis and y-axis are two reduced dimensions of the original feat... |
Questions : Say I have 1000 points, that are distributed in a $[0,1]\times[0,1]$ square. It is not uniformly distributed. For example I might have "clusters" of points within the square, and conversely, there may be some empty patches of space within the square. I want to get a measure of uniformness in the distributio... |
I am working with twin data with my exposure variable being inflammatory marker level (continuous) and outcome being disease status (binary). In order to account for twin relatedness, I was trying to use a mixed effects logistic regression similar to: glmer(disease ~ x+(1|Family_No) in the lme4 package. But I have run ... |
I'm looking for an information criterion metric that effectively penalizes the number of parameters ($k$) in cases where we have huge sample sizes. In my particular case my sample size is $\approx80,000.$ I happen to know that the ground truth model has $k=2$ parameters. But if I use Bayesian information Criterion it w... |
I have two triangular 2D matrices and want to determine if their contents are statistically different.
Let's say I have a collection of 5 different species and two proteins from the 5 species. Let's call the first protein 'A' and second 'B'. I'm interested in testing if protein A is more or less similar across these sp... |
I am reading the ISLR textbook (pg. 518-519, 12.4) and having trouble understanding why K-means clustering never increases. I can understand it conceptually but I don't understand the mathematical justification for it. For example, the objective function for K-means clustering is:
$$
\operatorname{minimize}_{C_{1},...,... |
I have the following GLMM model (using R with the lme4 package):
resp ~ condition * level + (1 | subject)
I have a clear difference between levels and I would like to see now if there is a difference between subjects within levels. Is this possible? If so, after filtering by group (df %>% filter(group == level1)) woul... |
The joint distribution of a undirected graph can be factorized as a product of potential functions over the maximal cliques of an undirected graph.
$$
p(\mathsf{x} \mid \theta) = \frac {1} {Z(\theta)} \prod_C \psi_C (\mathsf{x_C} \mid \theta_C)
$$
$\mathsf{x_C}$ is a set of variables in the clique $C$
$Z$ normalizes t... |
The book says: for the standard linear regression model, we assume:
\begin{equation}
y_i= \beta_0 + \beta_1 x_i + \epsilon_i
\end{equation}
where $E[\epsilon_i]=0$ and $Var[\epsilon_i]=\sigma^2$.
Homoskedasticity implies that the errors are independent of the covariates.
For constructing confidence interval and hypothe... |
Objective:
Estimate the mechanical tension of a cable using the velocity of the waves travelling along it.
Experimental setup:
I have a cable in tension equipped with accelerometers. I measure a strong cross-correlation between the sensors which corresponds to waves propagating along the cable.
Tension measurement:
I h... |
Let's say A is a normal distribution A = N(mean = 0, SD = 1). Let's say B = A + N(0, 0.5), such that A and B are dependent. What is P(A>1, B>1) (the probability of seeing a point whose A and B values are both >1)?
Apologies if my notation isn't quite right, my pure math background isn't that strong. I'm currently tryin... |
If a customer arrives according to a Possion process with rate $\lambda$, how can I show that the time interval $X$ taken to receive $k$ customers is an Erlang-$k$ random variable with parameters $n$ and $\lambda$?
|
Many software implementations of locally weighted scatterplot smoothing (LOWESS), such as those in Python and R, require a frac parameter as an input. I am confused as to how frac is mathematically related to the term 'window size'.
According to Statsmodels' documentation,
The algorithm works by estimating the smooth ... |
I am experiencing a delay between the test data and predictions after some time:
The first row is earlier than the second row. Data are residuals calculated on time series velocity data.
Why does such a delay occur? How can I investigate this further?
Edit: To clarify, in the first row that corresponds to the first 50... |
I am working with a dataset including 65 participants, 35 in the control group and 30 in the experimental group. The objective is to assess wether the experimental group is non-inferior to the control group.
There are 2 events in the control group and 1 in the experimental group. Independent sample test of proportions ... |
If A and B are independent events but both are dependent on event C, how can I rewrite:
$P(A \cap B \cap C)$ ?
I was given in a question that:
$P(A \cap B \mid C)$ = $P(A \mid C)$ $P(B \mid C)$
and I'm trying to prove it to myself.
I'm stuck at proving that:
$P(A \cap B \cap C)$ = $P(A \cap C)$ $P(B \cap C)$
again, giv... |
I'm looking for help/indication on approaching a data integration problem.
I have a dose-response curve that is described by a log curve. Because of measurement difficulties, the dose and response can't be measured in the same experiment, for high and low doses. I can estimate the function's slope at low and high doses... |
This is a question from Exercises 8.3 from Introduction to Mathematical Statistics by Hogg, Craig, McKean.
Question: Let $X_1, X_2, \cdots ,X_n$ and $Y_1, Y_2, \cdots ,Y_n$ be independent random samples from two normal distributions $\mathcal{N}(μ_1, σ^2)$ and $\mathcal{N}(μ_2, σ^2)$, respectively, where $σ^2$ is the ... |
This is a figure for survival analysis on a dataset. The article is found at this link
I am self teaching survival analysis. Up until recently, I believed that AUC and ROC were only for classification. How are AUC curves computed for survival times? I'd like to remake this.
The data is found
at this second link
|
In Chang et al. "The Higher Moments of Future Earnings" (2014), the authors say say that based on (predicted) conditonal quantiles of a variable $y$, one can derive the (predicted) conditional variance of $y$ as follows (A3, page 34):
$$ var(y|\cdot) = \frac{1}{Q}\Sigma_{q\in Q}(quant_q(y|\cdot))^2 - (e(y|\cdot))^2, $$... |
I want to predict on a test set.
I have created a binary logistic regression using my current training set and have predicted on the test set. The dataset I used to split has 299 observations.
What if I want to remove outliers? Do I only remove them within the training set or from the entire dataset and split it once a... |
Kendall (1945) defines the curve of concentration (AFAIU, this is a synonym for Lorenz curve) as a parametric curve
$$
\left\{ \begin{aligned}F(x) & =\int_{-\infty}^{x}f(t)\mathrm{d}t\\
G(x) & =\frac{1}{\mu}\int_{-\infty}^{x}tf(t)\mathrm{d}t,
\end{aligned}
\right.
$$
where $F(x)$ is the CDF of a random variable $X$ wit... |
Currently, I am studying the book "storytelling with data - Cole Nussbaumer Knaflic" to learn about data visualization. Now I am learning why the slope graph can be very helpful. If you have too many observations it could become a mess. The book says the following:
If many of the lines are overlapping, a slopegraph ma... |
Suppose I am training a generative model G to produce vectors z in R^d, where d is fixed. The objective of G is to produce realistic vectors, which I am calling the "reality objective". Further suppose that G produces "plausible" and "implausible" vectors during training and I have a second model E, which can tell whet... |
On the XGBoost site, it is stated: "XGBoost mostly combines a huge number of regression trees with a small learning rate. In this situation, trees added early are significant and trees added late are unimportant" (https://xgboost.readthedocs.io/en/stable/tutorials/dart.html). AFAIK, the weight applied to each tree's o... |
I am investigating the improvement of learning a task over time. I have five individuals that take the same test over period of time. My assumption is that the number of minutes they need to complete the task will decrease with the number of tries.
However, I don't have an equal sample size to use a repeated measures A... |
I am trying to run a nls() to interpolate height growth of a tree given a series of samples, where each sample has a value of age, and height. I am using the Richards (1959) method:
$$
\textrm{Height}=x\left(1-e^{-y\cdot\textrm{Age}}\right)^z
$$
my age and height values:
> age
[1] 0 3 6 17 29 47 57 63 72
> height
[1... |
I have been trying to wrap my head around transformers. While I have found many good resources that explain the self attention mechanism I've yet to find a good answer on how it really works with respect to training.
With respect to the embedding layer my understanding is that an input of words or pixels is first token... |
I stumbled upon a (for me) odd formula for the sample covariance matrix. Is there anyone who can show me how to get to this form?:
Start with the simple regression $\iota = Xb + \epsilon$, a $1\times T$ vector, and by applying OLS we get $\hat{b} = (X'X)^{-1}X'\iota.$
Now the formula stated:
$$\hat{\Sigma} = \frac{1}{T... |
I am new to analyzing complex datasets using mixed models in R, so please forgive me if I am asking something very basic.
I'm currently trying to write a linear mixed model using the lmer function of package lme4. However, I cannot find much on the correct notation of nested fixed factors in the model. I only seem to f... |
Let's say I have some continuous variables and a binary treatment indicator. I want to cluster my observations based on the variables while ensuring that each cluster contains at least one member of each treatment level. Is there a variant of k-means clustering or another principled clustering algorithm that can be use... |
We know that sample variance $\sum(x- \bar{x})^2/(n-1) = \sum(x^2- 2x\bar{x}+\bar{x}^2)/(n-1)$ is an unbiasedd estimator of variance
Is $\sum(x^2 - \bar{x}^2)/(n-1)$ also an unbiased estimator of variance?
|
[My first question here. Thanks for taking the time to look into it!]
I am working on public health data where I calculate the correlation between incident counts (zero or positive integers) from two different locations. I calculate the Pearson correlation coefficient r - as I am testing for a linear relationship. Ever... |
In the wiki link for likelihood-ratio tests, it states
Suppose that we have a random sample, of size n, from a population
that is normally-distributed. Both the mean, μ, and the standard
deviation, σ, of the population are unknown. We want to test whether
the mean is equal to a given value, μ0 .
$${\displaystyle {\mat... |
Given the following PDF of continuous 2 random variables:
$$
f_{X,Y}(x,y)=\begin{cases}
y^2 & 0\le y\le x\le 1;\newline
0 & \text{otherwise}.
\end{cases}
$$
Graph showing the region of integration with x and y random variables:
Question is to find the marginal CDF $F_{Y}(y)$ and $P[Y > x]$
My attempt to ... |
I am estimating some panel ARDL models, and wanted to ask where the value add comes from with cointegration analysis. From what I've read, one can estimate long-run effects using an ARDL in levels as long as variables are I(0) or I(1) (Pesaran and Shin papers from 1990s say as much). I'm aware that spurious regressions... |
I have developed a GCN architecture with 3 different inputs, related to 3 different blocks of layers. After that, the outputs of those layers are concatenated. And after that, the architecture has a fully connected layer. I detail the architecture involves:
Input block (there are three of these, independent from each o... |
When performing resampling, I wish to perform the same imputation on the test set as I performed on the training set, which is accepted practice. So, when imputing with MICE, I generate a predictor matrix when imputing the training set and use the same predictor matrix when imputing the test set.
This works fine if the... |
Setup
Let's assume we have data $(x_{i},y_{i})_{i=1}^N$ and we assume they have a true functional relation $y_{i}=g(x_{i})$. I.e. we choose an arbitrarly complex function (like $g(x)=\sin(x^{2}\cdot \ln(\tanh(x)))+x e^x+\dots$)
Now I want to fit a feed-forward-NN $f_{\theta}$ with witdh $W$ and depth $D$ to the data t... |
I am trying to do a k=fold cross-validation on a polynomial regression. Unfortunately, I am getting an MSE that is vastly different from the MSE I would get if I were to just manually change the degrees in the code. Below is my code:
Validation Approach
# Polynomial Using sales, discount and quantity as dependent varia... |
I am reading section for 7.4 in elements of statistical learning, and I have some questions about some definitions and results in this section, and I would like to check if my understanding is correct.
In the definition for generalization error $Err_T=\mathbb{E}_{X^0,Y^0}[L(Y^0,\hat{f}(X^0)|T]$, why do we condition on... |
I need to solve the equation of
$$\log\left(\frac{\operatorname{Pr}(Y=k|X=x)}{\operatorname{Pr}(Y=K|X=x)}\right)$$
$$=\log\left(\frac{\pi_k \exp\left((x-\mu_k)^T|\Sigma|^{-1}(x-\mu_k)\right)}
{\pi_K \exp\left((x-\mu_K)^T|\Sigma|^{-1}(x-\mu_K)\right)}\right)$$
to find the following constants $a_k$, $b_{kj}$ and $c_{kjl}... |
I have two vectors with two levels:
vector 1:[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Levels: 0 1
vector 2:[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 ... |
Given the following PDF of continuous 2 random variables:
$$
f_{X,Y}(x,y)=\begin{cases}
y^2 & 0\le y\le x\le 1;\newline
0 & \text{otherwise}.
\end{cases}
$$
Graph showing the region of integration with x and y random variables:
Question is to find the marginal CDF $F_{Y}(y)$ and $P[Y > x]$
My attempt to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.