You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just realise that probably the easiest way to support weights in lm's or nls models would be to multiply both the dependent variable and each of the predictors with the sqrt(weights) if weights are given, since weighted least squares minimizes sum( w * (Y - X %% beta)^2 ) = sum_i( (sqrt(w[i]) * X[i, ] %% beta - sqrt(w[i]) * Y[i])^2 )
The help file of investr seems to indicate that weights are ignored when using weighted linear (lm) or nonlinear least squares analysis (nls). Would it be hard to take into account weights, e.g. if one uses weights to deal with heteroscedastic errors? I understand that this should be straightforward, right, looking at
https://stats.stackexchange.com/questions/175127/prediction-intervals-with-heteroscedasticity
and
http://weightinginbayesianmodels.github.io/poctcalibration/over_tutorials.html
http://weightinginbayesianmodels.github.io/poctcalibration/calib_tut4_curve_ocon.html
http://weightinginbayesianmodels.github.io/poctcalibration/calib_tut5_precision_ocon.html
http://weightinginbayesianmodels.github.io/poctcalibration/AMfunctions.html#sdXhat ?
Would it require a big change in the code to take into account weights (in my case I was using a model where variance was a power function of the mean, resulting in weights = 1/variance = 1/(fitted vals^power in an nls model)?
The text was updated successfully, but these errors were encountered: