Posts by: WST Expert 1
Re: WLSRegression using Excel VBA
Actually, if you extend to a fourth cell, you should get the missing number.
Using the data and code you provided, we're getting these four numbers:
0
22.11698721
0.01370646
-1.032383816
Actually, if you extend to a fourth cell, you should get the missing number.
Using the data and code you provided, we're getting these four numbers:
0
22.11698721
0.01370646
-1.032383816
Re: WLSRegression using Excel VBA
Hi Brendan, After looking through your code a bit more, it looks like it actually does work as intended, as long as you first select three cells going across, paste in the formula, and hit Ctrl + Shift + Enter to make it an array formula. The formula I tested with is: =TRANSPOSE(WLSregression... Read More
Hi Brendan, After looking through your code a bit more, it looks like it actually does work as intended, as long as you first select three cells going across, paste in the formula, and hit Ctrl + Shift + Enter to make it an array formula. The formula I tested with is: =TRANSPOSE(WLSregression... Read More
Re: I answered my own
Hi Peter,
Glad to hear that you were able to figure it out before we could post a response to you. The implications of random walk can be a bit tricky sometimes!
Hi Peter,
Glad to hear that you were able to figure it out before we could post a response to you. The implications of random walk can be a bit tricky sometimes!
Re: WLSRegression using Excel VBA
Let's start with that random data you have there. We could do a few useful things, like generate a covariance matrix, etc.
What's the desired behavior of the WLSregression function? Should it calculate and then return the three calculated coefficients, or something else?
Let's start with that random data you have there. We could do a few useful things, like generate a covariance matrix, etc.
What's the desired behavior of the WLSregression function? Should it calculate and then return the three calculated coefficients, or something else?
Re: WLSRegression using Excel VBA
Hi Brendan, Just to make sure we understand the desired effect: how do you envision the usage of the Diagonal function? It looks like you're giving it a range of cells (I suppose it would be any NxN matrix on your spreadsheet), and return the elements of the main diagonal. For example, you mig... Read More
Hi Brendan, Just to make sure we understand the desired effect: how do you envision the usage of the Diagonal function? It looks like you're giving it a range of cells (I suppose it would be any NxN matrix on your spreadsheet), and return the elements of the main diagonal. For example, you mig... Read More
Re: VLOOK and MATCH
Hi Peter, In step 3, the MATCH function will always only point you to one value/position. In other words, if on those three trading dates, the stock all closed at exactly $50.00, then your result would simply show the first date in the search. So in this case, the latest dates are at the top, des... Read More
Hi Peter, In step 3, the MATCH function will always only point you to one value/position. In other words, if on those three trading dates, the stock all closed at exactly $50.00, then your result would simply show the first date in the search. So in this case, the latest dates are at the top, des... Read More
Re: Valuation Summary - Private Company Differences
For a private company, you would start with Equity Value. Typically we would use the anticipated Transaction Equity Value which is justified from your standalone valuation for a private company. You would simply not have the share price or share price premium. However, do note that despite being... Read More
For a private company, you would start with Equity Value. Typically we would use the anticipated Transaction Equity Value which is justified from your standalone valuation for a private company. You would simply not have the share price or share price premium. However, do note that despite being... Read More
Re: Valuation Summary - Private Company Differences
Hello, For valuation of private companies, there are many techniques that unfortunately is too extensive to go into on this forum. The challenge is that there are too many nuances given the relatively lack of information available on private companies. Even if you have access to management and inte... Read More
Hello, For valuation of private companies, there are many techniques that unfortunately is too extensive to go into on this forum. The challenge is that there are too many nuances given the relatively lack of information available on private companies. Even if you have access to management and inte... Read More
Re: Adding hyperlink to header in Excel
If you're simply inserting an image manually, you can easily make it a link via Ctrl + K (or right click, Link -> Insert Link...). Afterward, you can copy this image link and paste it throughout your Excel file. VBA would likely be useful if you had a lot of pages (or a dynamic number of pages_, ... Read More
If you're simply inserting an image manually, you can easily make it a link via Ctrl + K (or right click, Link -> Insert Link...). Afterward, you can copy this image link and paste it throughout your Excel file. VBA would likely be useful if you had a lot of pages (or a dynamic number of pages_, ... Read More
You could actually simplify this by removing (try commenting first, of course) every line after your declaration of b. Then, your last line will just be: WLSregression = b Or you can just skip the need for b completely and just have: WLSregression = Application.WorksheetFunction.MMult(XwXin... You could actually simplify this by removing (try commenting first, of course) every line after your declaration of b. Then, your last line will just be:
WLSregression = b
Or you can just skip the need for b completely and just have:
WLSregression = Application.WorksheetFunction.MMult(XwXinv, Xwy)
(By the way, you could just use Application.MMult here.)
If, for some reason, you needed the k and output and all that, then you have to fix the indexing. Basically, VBA arrays start with index 0 by default. So the first element in output would be output(0). However, note that you are initializing bcnt = 1 in your loop. Thus, the first iteration will be setting output(1) to b(1, 1). The second iteration will work on output(2). But what about index(0)?
In essence, you skipped index(0) and that's why an empty 0 is sitting there in the first spot. You could fix this by simply changing that line to:
output(bcnt - 1) = b(bcnt, 1)
Now it works as expected! Read More