10,881 reputation
13063
bio website fromthebottomoftheheap.net
location Regina, Canada
age 37
visits member for 4 years, 1 month
seen 19 secs ago

I'm Quantitative Environmental Scientist in the Institute of Environmental Change & Society, at the University of Regina, Canada. I undertake research on environmental problems, including climate change and atmospheric pollution, affecting lakes. I use lake sediments to look back in time at the history of lakes to look at what organisms are present and how the species in the lake have changed through time and how lakes evolve and respond to pollution and perturbations.

I'm also an Adjunct Professor in the Department of Biology at the University of Regina.


11h
comment elastic net- confidence intervals for parameters
If you are interested in this test, there is a paper and an R package too. These links and some discussion are from Andrew Gelman's blog
11h
answered elastic net- confidence intervals for parameters
22h
comment Assumptions on a multiple linear regression model and elastic net
Well, you only need to check for constant variance, normality of residuals, etc if you want to do inference on the model, such as assess statistical significance of estimated coefficients. So you don't need to do this at all if you are only interested in quality of fitted values. I'd be more concerned with the linearity assumption inherit in the model, i.e. effects are linear. What about interactions (these get tricky in standard lasso/elastic net models)?
1d
comment Elastic net regularization: mean square error monotonically increases with lambda
Alternatively, run the CV quite a few times and record the $\lambda$ for the 1SE solution from each of these. Use a representative value for your chosen $\lambda$.
1d
comment Elastic net regularization: mean square error monotonically increases with lambda
@crippledlambda your setting is sparse; you have remove ~ 1800 of the predictors from the model by shrinking their coefficients to zero. The CV is a stochastic procedure; samples are assigned to folds at random hence one would expect some variation between runs unless you set the random seed the same each time. If you want to hone in the best 1SE value of $\lambda$ you'll need to use a lot more points over range say -6 to -3. but really it isn't going to matter much in terms of prediction.
1d
comment Elastic net regularization: mean square error monotonically increases with lambda
@crippledlambda then, in that case, you are seeing huge shrinkage for effectively no impact on the model's ability to explain variance in your sample. That is good! I think at low values of $\lambda$ you are overfitting so go with the 1SE mode fit.
1d
comment Elastic net regularization: mean square error monotonically increases with lambda
@crippledlambda What would you expect if you had 100 independent/orthogonal predictors, all known to be strongly predictive of the response? A true solution would include all parameters and we would expect large (relatively) coefficients for each one. This would mean that the error should increase away from this full fit (similar to what you see but stronger). The true solution is dense; shrinkage methods like the lasso and the elastic net assume the solution is sparse. I'm not saying this is the case here, just that is one example of how you might see this sort of CV error trace.
1d
answered Elastic net regularization: mean square error monotonically increases with lambda
1d
revised elastic net min deviance when lambda tends to 0
deleted 1 character in body
1d
comment elastic net min deviance when lambda tends to 0
The penalization is in terms of shrinkage of model coefficients. On the left you have the CV binomial deviance for the full, unpenalized model; on the right you have a heavily shrunk fit with large penalties. What this plot is showing you is that you can shrink the coefficients of a lot covariates by an amount sufficient to remove them from the model (their coefficient becomes zero) without affecting the model fit - the deviance of the model doesn't change much. Only at large penalties (large values of $\log(\lambda)$) does the model start to loose fit relative to the full model.
1d
comment glmnet- introduce cost function
Possibly; I'm not familiar with this sort of thing.
1d
comment elastic net min deviance when lambda tends to 0
@GabyP You are mixing up $\alpha$ and $\lambda$. The former, $\alpha$ is the mixing of L1 and L2 penalties, and is set as argument alpha in the cv.glmnet call. $\lambda$ is the amount of shrinkage applied. cv.glmnet optimises over $\lambda$ only. You need to do your own procedure if you wish to tune over both $\lambda$ and $\alpha$. If this is what you were trying to do, consider the caret package, which should be able to tune over both parameters for you using glmnet models.
1d
comment glmnet- introduce cost function
I don't think this is possible with glmnet, unless you can specify it via observation weights on the observations via the weights argument.
1d
answered elastic net min deviance when lambda tends to 0
1d
answered Getting to predicted values using cv.glmnet
1d
comment Assumptions on a multiple linear regression model and elastic net
What are you fitting the model for? If for prediction, you may not need to if the predicted values are OK.
1d
answered Missing factor levels after logistic regression glm()
1d
comment GAM model has lowest GCV and highest deviance explained but factors are not significant
Why do you want year as a factor? The huge standard errors suggest real problems with this model as it stands. You could try to convert Year to an integer and then use s(Year) in the model for example. If you do this, you can use select = TRUE, method = "REML" to turn on additional penalties that can shrink terms out of the model - which performs a sort of feature selection for you in a much more principled manner than stepwise selection.
1d
revised How to interpret ANOVA output when comparing two nested mixed-effect models?
I added some practical explanation
1d
revised How to interpret ANOVA output when comparing two nested mixed-effect models?
oops on the math