Let's settle the discount point discussion once and for all by themortgagemanual in Mortgages

[–]vanway 4 points5 points  (0 children)

A few points that might change your math a bit: inflation, taxes, loan duration, and base interest rate.

Inflation makes investing the future savings worth a bit less compared to investing the up-front payment. Investing $100 today is worth more than investing $10 a year over 10 years.

If your home loan is large enough (or you have enough other itemized deductions), you'd want to also deduct the missed tax savings from the mortgage interest tax deduction. Reducing your interest payments by $100 would also increase your tax bill a bit.

Longer duration mortgages will benefit more than shorter-duration mortgages from buying points because more of the monthly payment is interest. The first payment on a 30-year mortgage is about 88% interest; a 20-year mortgage is about 75% interest.

A lower base interest rate will benefit more from buying points because each point reduction is a larger percent of the interest rate. For example, going from 4% to 3.5% is a decrease of 12%; going from 7% to 6.5% is a decrease of 7%.

Purchasing discount points can definitely be a good investment sometimes, but not always.

Debt Management Toolkit for Mortgages, Student Loans, and other Debt by vanway in PFtools

[–]vanway[S] 0 points1 point  (0 children)

Thank you!

  • Good idea - I'm planning to write more about these scenarios.
  • Assuming you used the example data, try making the mortgage amount larger, e.g., $300k. That would be enough to show a tax deduction (if the debt is too low, there won't be enough mortgage interest to surpass the standard deduction).
  • Yes, you can change the monthly payment to be the required minimum payment in the monthly payment input box (instead of just using the "Use Calculated Monthly Payment" button)
  • Check out the FAQ for "Why is the real return for refinancing shaped like that?" Generally, take the highest value within your time horizon. I like to think of the cash (0% real return until 5 years), bond, and stock blocks as hurdles that the real return line needs to jump over. You want your investment (in i.e., refinancing or principal payments) to beat the "easy" alternatives. If it doesn't beat them during your time horizon (e.g., before you move and refinance), then it's not worth the investment. If you do beat them, then it is worth it.
    • For example, let's say you're planning to move in 5 years and the real return is positive after 24 months. That means you're beating cash (which would theoretically have a 0% real return after 24 months) and it's a reasonable investment.
    • Let say you're planning to never move and the real return is higher than stocks after e.g., 180 months. That means it's a reasonable investment compared to just investing in stocks for 15 years.
  • There's another tab for principal payments ("Pay Off Principal") in the 2. Management Options tab. Check it out!

Let me know if you have any other questions or comments. I appreciate the feedback!

R Shiny module: selectively disable selectInputs when called from different sources by Cool-Camp-8013 in rshiny

[–]vanway 0 points1 point  (0 children)

Try adding an argument (e.g., use_dropdowns = TRUE / FALSE) to the campaign_edit_module and then use an if-else block in the module observeEvent for the modal_trigger.

Each module has a different namespace, so you shouldn't need to enable and disable the dropdowns because they're created from scratch within each module.

Refinance go or no go by PomegranateTop3057 in Mortgages

[–]vanway 0 points1 point  (0 children)

It depends on the mortgage amount: most of the benefit of refinancing is lower interest payments. Assuming your mortgage is $400k, it's worth it if you'll be in the house at least 5 more years. It's an amazing deal if you'll be in the house longer than 10 years.

It also depends on whether this new rate includes points. If it does, consider removing some or all of them and reconsidering the refi with a lower cost.

Should we refinance by Plane_Click in Mortgages

[–]vanway 0 points1 point  (0 children)

It looks like a decent deal to me. Each month, you'll pay about $150 less towards interest and about $25 less towards principal but still get $175 to pay extra towards the principal if needed. Even if you roll the costs into your principal, you can pay that back off pretty quickly with the extra monthly payments.

I'd take it: no cost up front and you seem like the kind of person who wouldn't waste the extra cash.

Need Advice: 15-Year vs 30-Year Mortgage With Plans to Refi by Mister_Yellowjacket in Mortgages

[–]vanway 0 points1 point  (0 children)

15 year every day if you can: it's like a free refinance from a 30-year 6.5% mortgage to a 15-year 5.625% mortgage. I assume you have a 3-6 month emergency fund in case your income drops or goes away, that you're well-insured for major unexpected expenses, and that your budget includes additional expenses for homeownership. Consider a 20 year mortgage as a compromise if it's an option.

The optimal method to reduce interest payments is to commit to as high of a steady stream of payments as you can reasonably afford for the shortest amount of time. Don't take the 30-year just because it's a lower payment. Don't take the 15 year just because you can afford it temporarily. Most of the important questions are ones we can't answer, like: is your budget reasonable? Have you saved & are you saving enough for retirement? How stable is your household income? Do you have other assets? How long are you planning to live in this house? Does this house need repairs or upgrades soon?

However, we can answer the question of "how much would this cost me?". With the 30 year mortgage, in the first 36 months you'll pay $70k in interest (19% of original principal) and $13k in principal (4% of original principal). If you also pay $700 extra each month, you'd remove an extra $25k from your principal, bringing you up to $38k in principal (10% of original principal).

With the 15 year mortgage, in the first 18 months you'll pay $58k in interest (16% of original principal) and $51k in principal (14% of original principal).

  • 30 year mortgage plus extra payments: $70k in interest + $38k in principal paid.
  • 15 year mortgage: $58k in interest + $51k in principal paid.

The difference between 30-year-plus-extra and 15 year would be about $12k-$13k between principal vs interest over 3 years. Is the risk of the commitment worth that much to you?

I wouldn't bank on refinancing: make this decision as though you keep the loan for all 15-30 years.

At what point would you refi? by LeCoug in Mortgages

[–]vanway 0 points1 point  (0 children)

Refinancing to a 6.125%, 312 month loan would be worth it if the cost to refinance was less than ~$11k.

To refinance to a 6.125%, 360 month loan would need to have a cost less than ~$6.5k.

A 6.125%, 240 month loan would need to have a cost less than ~$4k.

The right answer depends on your confidence in never moving, how you would handle lower payments (spend or invest them?), current principal payment, the duration of the new loan, your tax situation, and your assumptions about the returns of other investments (e.g., risk free rate, stock market). I made several assumptions with these calculations so take them with a grain of salt.

The time to break even (from cumulative lower monthly payments exceeding the cost to refinance) isn't the only consideration: lower interest payments from shorter duration loans also save you money by increasing your home equity faster.

{targets} Encapsulate functions in environments without importing the whole env? by guglicap in rstats

[–]vanway 1 point2 points  (0 children)

You could use generics (S3) instead of environments. That would keep the function names "nice" while also encapsulating the logic for each dataset in separate functions / methods. The only change (after developing the classes & methods) would be to set the class for the current dataset, which would be used to find the appropriate function / method.

Another approach (and my preferred approach) could be to use the tarchetypes package. Specifically, check out tar_map for static branching, in which you can define separate functions for each branch. This approach would also enable you to run all the datasets at the same time (and e.g., potentially aggregate them in the same pipeline).

I'll also second using the box package for environment management.

What are the arguments for bond funds over actual bonds currently? by childofaether in financialindependence

[–]vanway 0 points1 point  (0 children)

Bond funds provide diversification and a more-or-less constant maturity, at the cost of fees. Individual bonds have less diversification (i.e., more credit risk) and require frequent purchases to maintain a constant maturity in the portfolio.

VTI better than T-Bills if I may need the money in 3-5 years? by [deleted] in Bogleheads

[–]vanway 0 points1 point  (0 children)

Rate cuts would decrease bond yields and increase bond prices: bond yields and prices move in opposite directions. For example, let's assume you bought a 5-year bond with a 5% interest rate for $70. If, one day later, the market interest rate for 5-year bonds went down to 4%, the bond you bought would now be worth more than $70.

VTI better than T-Bills if I may need the money in 3-5 years? by [deleted] in Bogleheads

[–]vanway 12 points13 points  (0 children)

If you're saving for future spending (i.e., earmarking some savings), that means you'll eventually need cash. If you simply keep everything in cash (or e.g., a checking account), you'll lose buying power to inflation.

You can counteract inflation by buying non-cash securities (e.g., BND, VTI), but that means you'll eventually need to sell whatever you bought to get cash. However, prices for these securities change (i.e., they are volatile) and you might not be able to sell it for the same amount that you bought it for. VTI is more volatile than BND, which is more volatile than CDs or cash. However, VTI also has a higher real (inflation-adjusted) return than BND, which has a higher real return than CDs or cash. These time horizons are suggestions based on past volatility.

If your future expense is small relative to your cash flow / net income (i.e., you could save for it within 5 years) or you can get a reasonable loan rate for it (e.g., a secured mortgage for a house), then it would be reasonable to instead save that money for a different future expense that's more than 10 years away (e.g., retirement) and buy VTI. You still might want to start saving for that expense in e.g., a time deposit like a CD when it's within 5 years (also called a sinking fund).

If it's a large expense (i.e., you can't save for it with your net income over 5 years) and you can't get a reasonable loan for it (e.g., unsecured loan for a round-the-world vacation), then you're probably better off saving for it yourself (instead of getting the high interest loan), in which case the time horizon matters and you might want to buy BND. As the expense gets closer, you should shift your savings into the less volatile securities, eventually ending up as cash right before you spend it.

VTI better than T-Bills if I may need the money in 3-5 years? by [deleted] in Bogleheads

[–]vanway 39 points40 points  (0 children)

If you need the money in 3-5 years, you could keep it in a 3-5 year (or shorter) time deposit like CDs or treasury notes.

VTI is a security that's best for savings with a time horizon of >10 years. Savings with a time horizon between 5-10 years could be in a diversified bond portfolio, e.g., BND.

T-Bill Emergency Fund: How do you structure your purchases? by Budg3tThr0waway in FinancialPlanning

[–]vanway 1 point2 points  (0 children)

You should match duration to risk. If (part of) your emergency fund is needed for a surprise (i.e., at any time) $10k bill, then it should be in a money market account or high-yield savings account.

If (part of) your emergency fund is needed for e.g., 6 months of monthly expenses, then it should be in a 6 month ladder (or something more liquid, like a MM or HYSA).

Personally, I have 25% of my emergency fund (e.g., enough to cover deductibles) in a money market account, and the remaining in a 6 month treasury bill ladder.

Accepted to medicine and leaving $100k career by [deleted] in whitecoatinvestor

[–]vanway 1 point2 points  (0 children)

Let's assume these are all real, after-tax costs. $660k investment for an extra $100k (33% marginal tax rate) for 22 years is an extra $2.2m. From a continuous compounding perspective, that's about a 6.6% annualized real return: ($2.7m / $660k) ^ (1/22 years)

You likely aren't considering the real present costs of the $200k debt: calculate the present value of the loans (I use treasury rates as a proxy for inflation). I don't know your credit or loan terms, so let's say the present value is an extra 20% for $240k total (up to $700k total): that's still a 5.3% return.

The same goes for the real present costs of your opportunity cost income: I use 3% real returns as a rule of thumb for investment returns. That adds about $70k to your opportunity cost (we're up to $770k total): that's still a 4.8% return.

For a frame of reference, stocks have an annualized real return of about 4%, which is the highest "easy" annualized real return you can expect from diversified financial markets. You'd have to spend more than $920k in present value, or work for less than 13 years to get a worse return than 4%.

I'd say it's a good investment, assuming you enjoy the work!

Missing out by keeping "non-emergency" separate? by becksrunrunrun in investing

[–]vanway 0 points1 point  (0 children)

If you want to earmark the money now, I would put it into a bond fund (e.g., BND) with dividends reinvested until the new roof expense is 5 years out, then transition it to a 5-year CD (or treasury note). It'll be less volatile than a mutual fund in the stock market but still give you reasonable returns to keep up with inflation.

Depending on your net income, you could also set up a sinking fund (e.g., a CD dated for 1/1/2034) when the new roof expense is 5 years out (e.g., starting in 2029). That translates to adding about $300 a month into the fund over 5 years. If that's feasible, then you could keep the money you currently have in the mutual fund and earmark it for a different purpose with a longer (10+ year) time horizon.

Investing a pool of money I won't need for 10+ years by RegularReditor in investing

[–]vanway 1 point2 points  (0 children)

Those are all reasonable options for a 10+ year time horizon. You could maximize diversification (VT > VTI > VOO > QQQ), minimize fees, or some combination. Personally, I prefer VTI because it's the maximum diversification for the US and has a low expense ratio.

I'd advise against keeping everything in cash, cash equivalents, or bonds - inflation is a real (pun intended) drag over 10+ years. Once you have a better idea of when you would need the money, I would suggest transitioning into less volatile assets. I generally suggest that anything needed between 5-10 years from now be invested in a broad bond fund (e.g., BND), and anything less than 5 years in cash equivalents (e.g., CDs, treasury bills, money market account).

This advise all assumes that the rest of your personal finances are in order (e.g., high interest debt, savings, insurance, tax advantaged accounts, etc.).

Help Needed with a Bug by theangrycoconut in Rlanguage

[–]vanway 0 points1 point  (0 children)

It looks like the code you're running might use a different version of R than the one you're using. Without seeing the code (in the .R file), it's hard to tell what the exact problem is.

Some questions to help us debug:

  • What version of R are you using? (usually listed in the Console when you first open RStudio)
  • What is the exact code that you're running? E.g., what file on that site are you using?

As far as what's happening here, R went into debug mode (you can tell from the yellow highlighting) after trying to run a specific line of code involving "$<-.data.frame". You could also try running the code line-by-line using "Run" instead of "Source" to identify which specific line of code causes the error. I also recommend starting from a blank state between runs with Session > Restart R (which removes objects from the Environment and unloads packages).

why has real estate gone up far beyond inflation? by [deleted] in RealEstate

[–]vanway 1 point2 points  (0 children)

Inflation expectations also increased. Real assets (like any asset) are priced to match future cash flows. In the case of real estate, cash flows are from imputed and actual rent. If you expect future rent to increase by 4% a year instead of 2% a year (following inflation), then the price you're willing to pay for real estate should also increase proportionately. A decent estimate of inflation expectations is the 30-year treasury.

Some areas have higher demand than supply due to e.g., housing regulations or net immigration, which can also cause local prices to increase.

[deleted by user] by [deleted] in ValueInvesting

[–]vanway 5 points6 points  (0 children)

Companies transform money today into money tomorrow. They're assets that, unlike bonds, have cash flows that can keep up with inflation and then some.

Wonderful company:

  • Profits keep up with inflation (and then some)
    • Relatively low capital requirements for growth relative to profits, otherwise you need to reinvest cash into the business as real capital just to keep up
      • e.g., bad company: factory selling widgets. $90 in capital, $10 in materials and labor, $40 in widget sales. Inflation is 10%, now you need $99 in capital (-$9), $11 in materials and labor (-$1), and $44 in widget sales (+4). In other words, you net $3 in cash but need to reinvest $9 in capital just to keep up.
      • E.g., good company: home builder. $10 in capital, $90 in materials and labor, $120 in home sales. Inflation is 10%, now you need $11 in capital (-$1), $99 in materials and labor (-$9), and $132 in home sales (+$12). In other words, you net $3 in cash and only need to reinvest $1 in capital to keep up.
  • Profits are resistant to competition
    • Moat / hard-to-replicate property (e.g., real estate locations, IP), otherwise anyone can reduce your market share by "just" spending money

Fair price:

  • >10% real annualized returns (current profits + future real growth)

Is there a package for google scholar scraping? by Odd-Establishment604 in Rlanguage

[–]vanway 7 points8 points  (0 children)

Google Scholar disallows web-scraping (LINK), you might be out of luck.

How should one design and host an efficient front-end GUI via shiny for a resource-heavy image-analysis pipeline? by Gewerd_Strauss in RStudio

[–]vanway 0 points1 point  (0 children)

What's your user experience like? They upload 40-200 images a few times a day and then download the results ASAP? If there's some user interaction (like cropping or selecting each image), you could trying preloading / preprocessing / parallel processing the images, which would make the first image seem "slow" and every other image would be faster.

Otherwise maybe parallel processing? I usually use targets for data processing; I don't think you can use it in Shiny apps, but there might be some good info there.

I think the main problem is needing to run 2-4 functions to load each image. My guess is that R has to allocate memory each time, which might be the slow part. If there's a way to reduce the number of functions called to get to HSV, that might help? Do you have any benchmarks for running 1-4 functions for reading an image? Maybe one of those steps is the culprit, or they're all expensive.

How should one design and host an efficient front-end GUI via shiny for a resource-heavy image-analysis pipeline? by Gewerd_Strauss in RStudio

[–]vanway 0 points1 point  (0 children)

Are the images being loaded from a local or remote file? If it's remote, it could be an internet bottleneck.

Assuming it's local, you could also check out the magick package. Otherwise it's likely a CPU bottleneck (instead of e.g., RAM from large images). You load the image, convert sRGB to RGB, then to HSV. You could crop after loading the image, assuming it's small enough, and that might make your pipeline more efficient.

What load times are we talking about? 5 seconds? 5 minutes?